Commit 567b6128 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

диаграммы. каркас и шаблоны.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@56068 954022d7-b5bf-4e40-9824-e11837661b57
parent e119f7b0
......@@ -942,6 +942,14 @@
RelativePath=".\OdfFormat\office_body.h"
>
</File>
<File
RelativePath=".\OdfFormat\office_chart.cpp"
>
</File>
<File
RelativePath=".\OdfFormat\office_chart.h"
>
</File>
<File
RelativePath=".\OdfFormat\office_spreadsheet.cpp"
>
......
......@@ -279,7 +279,6 @@ void draw_object::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
//draw_object_attlist_.serialize(CP_GET_XML_NODE());
common_xlink_attlist_.serialize(CP_GET_XML_NODE());
}
}
......
......@@ -183,6 +183,7 @@ public:
virtual void serialize(std::wostream & _Wostream);
common_xlink_attlist common_xlink_attlist_;
//draw:notify-on-update-of-ranges
};
CP_REGISTER_OFFICE_ELEMENT2(draw_object);
......
......@@ -78,30 +78,8 @@ namespace odf
CP_XML_NODE(L"manifest:manifest")
{
CP_XML_ATTR(L"xmlns:manifest", L"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0");
CP_XML_NODE(L"manifest:file-entry")
{
CP_XML_ATTR(L"manifest:full-path", L"/");
CP_XML_ATTR(L"manifest:media-type", std::wstring(L"application/vnd.oasis.opendocument.") + type_);
}
rels_.serialize(CP_XML_STREAM());//
CP_XML_NODE(L"manifest:file-entry")
{
CP_XML_ATTR(L"manifest:full-path", L"content.xml");
CP_XML_ATTR(L"manifest:media-type", L"text/xml");
}
CP_XML_NODE(L"manifest:file-entry")
{
CP_XML_ATTR(L"manifest:full-path", L"styles.xml");
CP_XML_ATTR(L"manifest:media-type", L"text/xml");
}
CP_XML_NODE(L"manifest:file-entry")
{
CP_XML_ATTR(L"manifest:full-path", L"meta.xml");
CP_XML_ATTR(L"manifest:media-type", L"text/xml");
}
rels_.serialize(CP_XML_STREAM());
}
}
fs::wpath path = fs::wpath(RootPath) / L"META-INF";
......@@ -128,7 +106,7 @@ namespace odf
CP_XML_ATTR(L"xmlns:presentation", L"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0");
CP_XML_ATTR(L"xmlns:smil", L"urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0");
CP_XML_ATTR(L"xmlns:anim", L"urn:oasis:names:tc:opendocument:xmlns:animation:1.0");
CP_XML_ATTR(L"xmlns:chartooo", L"http://openoffice.org/2010/chart");
CP_XML_NODE(L"office:meta")
{
......@@ -237,13 +215,21 @@ namespace odf
void odf_document::add_object(element_ptr _object, bool root)
{
if (root)base_ = _object;
else objects_.push_back(_object);
rels r;
if (root)
{
base_ = _object;
}
else
{
objects_.push_back(_object);
}
dynamic_cast<manifect_file*>(manifest_.get())->add_rels(r);
}
void odf_document::set_rels(rels & r)
{
(dynamic_cast<manifect_file*>(manifest_.get()))->add_rels(r);
dynamic_cast<manifect_file*>(manifest_.get())->add_rels(r);
}
odf_document::odf_document(std::wstring type)
......@@ -257,17 +243,14 @@ namespace odf
long count = 0;
BOOST_FOREACH(const element_ptr & item, objects_)
{
std::wstring name = L"Object " + boost::lexical_cast<std::wstring>(++count);
fs::wpath path = fs::wpath(RootPath) / name;
{
fs::wpath path = fs::wpath(RootPath) / item->local_path;
fs::create_directory(path);
item->write(path.string());
}
if (manifest_) manifest_->write(RootPath);
if (settings_) settings_->write(RootPath);
if (settings_) settings_->write(RootPath);
}
void content_file::write(const std::wstring & RootPath)
......@@ -277,43 +260,44 @@ namespace odf
{
CP_XML_NODE(L"office:document-content")
{
CP_XML_ATTR(L"xmlns:office",L"urn:oasis:names:tc:opendocument:xmlns:office:1.0" );
CP_XML_ATTR(L"xmlns:style", L"urn:oasis:names:tc:opendocument:xmlns:style:1.0" );
CP_XML_ATTR(L"xmlns:text", L"urn:oasis:names:tc:opendocument:xmlns:text:1.0" );
CP_XML_ATTR(L"xmlns:table", L"urn:oasis:names:tc:opendocument:xmlns:table:1.0" );
CP_XML_ATTR(L"xmlns:draw", L"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" );
CP_XML_ATTR(L"xmlns:fo", L"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" );
CP_XML_ATTR(L"xmlns:xlink", L"http://www.w3.org/1999/xlink" );
CP_XML_ATTR(L"xmlns:dc", L"http://purl.org/dc/elements/1.1/" );
CP_XML_ATTR(L"xmlns:meta", L"urn:oasis:names:tc:opendocument:xmlns:meta:1.0" );
CP_XML_ATTR(L"xmlns:number",L"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" );
CP_XML_ATTR(L"xmlns:office", L"urn:oasis:names:tc:opendocument:xmlns:office:1.0" );
CP_XML_ATTR(L"xmlns:style", L"urn:oasis:names:tc:opendocument:xmlns:style:1.0" );
CP_XML_ATTR(L"xmlns:text", L"urn:oasis:names:tc:opendocument:xmlns:text:1.0" );
CP_XML_ATTR(L"xmlns:table", L"urn:oasis:names:tc:opendocument:xmlns:table:1.0" );
CP_XML_ATTR(L"xmlns:draw", L"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" );
CP_XML_ATTR(L"xmlns:fo", L"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" );
CP_XML_ATTR(L"xmlns:xlink", L"http://www.w3.org/1999/xlink" );
CP_XML_ATTR(L"xmlns:dc", L"http://purl.org/dc/elements/1.1/" );
CP_XML_ATTR(L"xmlns:meta", L"urn:oasis:names:tc:opendocument:xmlns:meta:1.0" );
CP_XML_ATTR(L"xmlns:number", L"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" );
CP_XML_ATTR(L"xmlns:presentation", L"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" );
CP_XML_ATTR(L"xmlns:svg", L"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0");
CP_XML_ATTR(L"xmlns:chart", L"urn:oasis:names:tc:opendocument:xmlns:chart:1.0" );
CP_XML_ATTR(L"xmlns:dr3d", L"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" );
CP_XML_ATTR(L"xmlns:math", L"http://www.w3.org/1998/Math/MathML" );
CP_XML_ATTR(L"xmlns:form", L"urn:oasis:names:tc:opendocument:xmlns:form:1.0" );
CP_XML_ATTR(L"xmlns:script",L"urn:oasis:names:tc:opendocument:xmlns:script:1.0" );
CP_XML_ATTR(L"xmlns:ooo", L"http://openoffice.org/2004/office" );
CP_XML_ATTR(L"xmlns:ooow", L"http://openoffice.org/2004/writer" );
CP_XML_ATTR(L"xmlns:oooc", L"http://openoffice.org/2004/calc" );
CP_XML_ATTR(L"xmlns:dom", L"http://www.w3.org/2001/xml-events" );
CP_XML_ATTR(L"xmlns:xforms",L"http://www.w3.org/2002/xforms");
CP_XML_ATTR(L"xmlns:xsd", L"http://www.w3.org/2001/XMLSchema" );
CP_XML_ATTR(L"xmlns:xsi", L"http://www.w3.org/2001/XMLSchema-instance" );
CP_XML_ATTR(L"xmlns:rpt", L"http://openoffice.org/2005/report" );
CP_XML_ATTR(L"xmlns:of", L"urn:oasis:names:tc:opendocument:xmlns:of:1.2" );
CP_XML_ATTR(L"xmlns:xhtml", L"http://www.w3.org/1999/xhtml" );
CP_XML_ATTR(L"xmlns:grddl", L"http://www.w3.org/2003/g/data-view#" );
CP_XML_ATTR(L"xmlns:tableooo", L"http://openoffice.org/2009/table" );
CP_XML_ATTR(L"xmlns:drawooo", L"http://openoffice.org/2010/draw" );
CP_XML_ATTR(L"xmlns:calcext", L"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" );
CP_XML_ATTR(L"xmlns:field", L"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" );
CP_XML_ATTR(L"xmlns:formx", L"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" );
CP_XML_ATTR(L"xmlns:css3t", L"http://www.w3.org/TR/css3-text/" );
CP_XML_ATTR(L"office:version", L"1.2");
CP_XML_ATTR(L"xmlns:svg", L"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0");
CP_XML_ATTR(L"xmlns:chart", L"urn:oasis:names:tc:opendocument:xmlns:chart:1.0" );
CP_XML_ATTR(L"xmlns:dr3d", L"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" );
CP_XML_ATTR(L"xmlns:math", L"http://www.w3.org/1998/Math/MathML" );
CP_XML_ATTR(L"xmlns:form", L"urn:oasis:names:tc:opendocument:xmlns:form:1.0" );
CP_XML_ATTR(L"xmlns:script", L"urn:oasis:names:tc:opendocument:xmlns:script:1.0" );
CP_XML_ATTR(L"xmlns:ooo", L"http://openoffice.org/2004/office" );
CP_XML_ATTR(L"xmlns:ooow", L"http://openoffice.org/2004/writer" );
CP_XML_ATTR(L"xmlns:oooc", L"http://openoffice.org/2004/calc" );
CP_XML_ATTR(L"xmlns:dom", L"http://www.w3.org/2001/xml-events" );
CP_XML_ATTR(L"xmlns:xforms", L"http://www.w3.org/2002/xforms");
CP_XML_ATTR(L"xmlns:xsd", L"http://www.w3.org/2001/XMLSchema" );
CP_XML_ATTR(L"xmlns:xsi", L"http://www.w3.org/2001/XMLSchema-instance" );
CP_XML_ATTR(L"xmlns:rpt", L"http://openoffice.org/2005/report" );
CP_XML_ATTR(L"xmlns:of", L"urn:oasis:names:tc:opendocument:xmlns:of:1.2" );
CP_XML_ATTR(L"xmlns:xhtml", L"http://www.w3.org/1999/xhtml" );
CP_XML_ATTR(L"xmlns:grddl", L"http://www.w3.org/2003/g/data-view#" );
CP_XML_ATTR(L"xmlns:tableooo", L"http://openoffice.org/2009/table" );
CP_XML_ATTR(L"xmlns:drawooo", L"http://openoffice.org/2010/draw" );
CP_XML_ATTR(L"xmlns:chartooo", L"http://openoffice.org/2010/chart" );
CP_XML_ATTR(L"xmlns:calcext", L"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" );
CP_XML_ATTR(L"xmlns:field", L"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" );
CP_XML_ATTR(L"xmlns:formx", L"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" );
CP_XML_ATTR(L"xmlns:css3t", L"http://www.w3.org/TR/css3-text/" );
CP_XML_ATTR(L"office:version", L"1.2");
CP_XML_NODE(L"office:scripts");
//CP_XML_NODE(L"office:scripts");
if (content_)
{
CP_XML_STREAM() << content_->styles_str();
......@@ -338,41 +322,42 @@ namespace odf
{
CP_XML_NODE(L"office:document-styles")
{
CP_XML_ATTR(L"xmlns:office",L"urn:oasis:names:tc:opendocument:xmlns:office:1.0" );
CP_XML_ATTR(L"xmlns:style", L"urn:oasis:names:tc:opendocument:xmlns:style:1.0" );
CP_XML_ATTR(L"xmlns:text", L"urn:oasis:names:tc:opendocument:xmlns:text:1.0" );
CP_XML_ATTR(L"xmlns:table", L"urn:oasis:names:tc:opendocument:xmlns:table:1.0" );
CP_XML_ATTR(L"xmlns:draw", L"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" );
CP_XML_ATTR(L"xmlns:fo", L"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" );
CP_XML_ATTR(L"xmlns:xlink", L"http://www.w3.org/1999/xlink" );
CP_XML_ATTR(L"xmlns:dc", L"http://purl.org/dc/elements/1.1/" );
CP_XML_ATTR(L"xmlns:meta", L"urn:oasis:names:tc:opendocument:xmlns:meta:1.0" );
CP_XML_ATTR(L"xmlns:number",L"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" );
CP_XML_ATTR(L"xmlns:office", L"urn:oasis:names:tc:opendocument:xmlns:office:1.0" );
CP_XML_ATTR(L"xmlns:style", L"urn:oasis:names:tc:opendocument:xmlns:style:1.0" );
CP_XML_ATTR(L"xmlns:text", L"urn:oasis:names:tc:opendocument:xmlns:text:1.0" );
CP_XML_ATTR(L"xmlns:table", L"urn:oasis:names:tc:opendocument:xmlns:table:1.0" );
CP_XML_ATTR(L"xmlns:draw", L"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" );
CP_XML_ATTR(L"xmlns:fo", L"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" );
CP_XML_ATTR(L"xmlns:xlink", L"http://www.w3.org/1999/xlink" );
CP_XML_ATTR(L"xmlns:dc", L"http://purl.org/dc/elements/1.1/" );
CP_XML_ATTR(L"xmlns:meta", L"urn:oasis:names:tc:opendocument:xmlns:meta:1.0" );
CP_XML_ATTR(L"xmlns:number", L"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" );
CP_XML_ATTR(L"xmlns:presentation", L"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" );
CP_XML_ATTR(L"xmlns:svg", L"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0");
CP_XML_ATTR(L"xmlns:chart", L"urn:oasis:names:tc:opendocument:xmlns:chart:1.0" );
CP_XML_ATTR(L"xmlns:dr3d", L"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" );
CP_XML_ATTR(L"xmlns:math", L"http://www.w3.org/1998/Math/MathML" );
CP_XML_ATTR(L"xmlns:form", L"urn:oasis:names:tc:opendocument:xmlns:form:1.0" );
CP_XML_ATTR(L"xmlns:script",L"urn:oasis:names:tc:opendocument:xmlns:script:1.0" );
CP_XML_ATTR(L"xmlns:ooo", L"http://openoffice.org/2004/office" );
CP_XML_ATTR(L"xmlns:ooow", L"http://openoffice.org/2004/writer" );
CP_XML_ATTR(L"xmlns:oooc", L"http://openoffice.org/2004/calc" );
CP_XML_ATTR(L"xmlns:dom", L"http://www.w3.org/2001/xml-events" );
CP_XML_ATTR(L"xmlns:xforms",L"http://www.w3.org/2002/xforms");
CP_XML_ATTR(L"xmlns:xsd", L"http://www.w3.org/2001/XMLSchema" );
CP_XML_ATTR(L"xmlns:xsi", L"http://www.w3.org/2001/XMLSchema-instance" );
CP_XML_ATTR(L"xmlns:rpt", L"http://openoffice.org/2005/report" );
CP_XML_ATTR(L"xmlns:of", L"urn:oasis:names:tc:opendocument:xmlns:of:1.2" );
CP_XML_ATTR(L"xmlns:xhtml", L"http://www.w3.org/1999/xhtml" );
CP_XML_ATTR(L"xmlns:grddl", L"http://www.w3.org/2003/g/data-view#" );
CP_XML_ATTR(L"xmlns:tableooo", L"http://openoffice.org/2009/table" );
CP_XML_ATTR(L"xmlns:drawooo", L"http://openoffice.org/2010/draw" );
CP_XML_ATTR(L"xmlns:calcext", L"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" );
CP_XML_ATTR(L"xmlns:field", L"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" );
CP_XML_ATTR(L"xmlns:formx", L"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" );
CP_XML_ATTR(L"xmlns:css3t", L"http://www.w3.org/TR/css3-text/" );
CP_XML_ATTR(L"office:version", L"1.2");
CP_XML_ATTR(L"xmlns:svg", L"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0");
CP_XML_ATTR(L"xmlns:chart", L"urn:oasis:names:tc:opendocument:xmlns:chart:1.0" );
CP_XML_ATTR(L"xmlns:dr3d", L"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" );
CP_XML_ATTR(L"xmlns:math", L"http://www.w3.org/1998/Math/MathML" );
CP_XML_ATTR(L"xmlns:form", L"urn:oasis:names:tc:opendocument:xmlns:form:1.0" );
CP_XML_ATTR(L"xmlns:script", L"urn:oasis:names:tc:opendocument:xmlns:script:1.0" );
CP_XML_ATTR(L"xmlns:ooo", L"http://openoffice.org/2004/office" );
CP_XML_ATTR(L"xmlns:ooow", L"http://openoffice.org/2004/writer" );
CP_XML_ATTR(L"xmlns:oooc", L"http://openoffice.org/2004/calc" );
CP_XML_ATTR(L"xmlns:dom", L"http://www.w3.org/2001/xml-events" );
CP_XML_ATTR(L"xmlns:xforms", L"http://www.w3.org/2002/xforms");
CP_XML_ATTR(L"xmlns:xsd", L"http://www.w3.org/2001/XMLSchema" );
CP_XML_ATTR(L"xmlns:xsi", L"http://www.w3.org/2001/XMLSchema-instance" );
CP_XML_ATTR(L"xmlns:rpt", L"http://openoffice.org/2005/report" );
CP_XML_ATTR(L"xmlns:of", L"urn:oasis:names:tc:opendocument:xmlns:of:1.2" );
CP_XML_ATTR(L"xmlns:xhtml", L"http://www.w3.org/1999/xhtml" );
CP_XML_ATTR(L"xmlns:grddl", L"http://www.w3.org/2003/g/data-view#" );
CP_XML_ATTR(L"xmlns:tableooo", L"http://openoffice.org/2009/table" );
CP_XML_ATTR(L"xmlns:drawooo", L"http://openoffice.org/2010/draw" );
CP_XML_ATTR(L"xmlns:chartooo", L"http://openoffice.org/2010/chart" );
CP_XML_ATTR(L"xmlns:calcext", L"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" );
CP_XML_ATTR(L"xmlns:field", L"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" );
CP_XML_ATTR(L"xmlns:formx", L"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" );
CP_XML_ATTR(L"xmlns:css3t", L"http://www.w3.org/TR/css3-text/" );
CP_XML_ATTR(L"office:version", L"1.2");
if (content_)
{
......
......@@ -57,11 +57,9 @@ namespace odf
{
public:
virtual ~element() = 0;
//void set_main_document(element * _element) { element_ = _element; }
//document * get_main_document() { return element_; }
virtual void write(const std::wstring & RootPath) = 0;
std::wstring local_path;
private:
element * element_;
};
......
......@@ -2,6 +2,9 @@
#include <boost/foreach.hpp>
#include "office_spreadsheet.h"
#include "office_chart.h"
#include "office_elements_create.h"
#include "odf_conversion_context.h"
......@@ -42,10 +45,7 @@ odf_conversion_context::~odf_conversion_context()
}
//void odf_conversion_context::start_font_face()
//{
// create_element(L"office", L"font-face-decls", styles_, this,true);
//}
void odf_conversion_context::end_document()
{
......@@ -57,7 +57,7 @@ void odf_conversion_context::end_document()
if (object.content == NULL)continue;
process_styles(object);
process_styles(object,isRoot);
package::content_content_ptr content_root_ = package::content_content::create();
object.content->serialize(content_root_->content());
......@@ -81,7 +81,16 @@ void odf_conversion_context::end_document()
object_files->set_media (object.mediaitems);
object_files->set_pictures (object.mediaitems);
output_document_->add_object(package::element_ptr(object_files ),isRoot);
if (!isRoot)object_files->local_path = object.name + L"/";
rels_.add(relationship(std::wstring(L"text/xml"), object_files->local_path + L"styles.xml"));
rels_.add(relationship(std::wstring(L"text/xml"), object_files->local_path + L"content.xml"));
rels_.add(relationship(std::wstring(L"text/xml"), object_files->local_path + L"meta.xml"));
if (isRoot)object_files->local_path = L"/";
rels_.add(relationship(std::wstring(L"application/vnd.oasis.opendocument.") + object.content->get_name(), object_files->local_path));
output_document_->add_object(package::element_ptr(object_files),isRoot);
}
object.mediaitems.dump_rels(rels_);
......@@ -105,6 +114,8 @@ void odf_conversion_context::create_object()
obj.style_context = boost::make_shared<odf_style_context>();
obj.style_context->set_odf_context(this);
obj.name = get_next_name_object();
objects_.push_back(obj);
current_object_ = objects_.size()-1;
......@@ -113,22 +124,29 @@ void odf_conversion_context::end_object()
{
current_object_ = 0;
}
std::wstring odf_conversion_context::get_next_name_object()
{
return std::wstring(L"Object ") + boost::lexical_cast<std::wstring>(objects_.size());
}
void odf_conversion_context::process_styles(_object & object)
void odf_conversion_context::process_styles(_object & object, bool isRoot)
{
create_element(L"office", L"font-face-decls", object.styles, this,true);
create_element(L"office", L"styles", object.styles, this,true);//îáùèå ñòèëè
object.style_context->process_office(object.styles.back());
create_element(L"office", L"automatic-styles", object.styles, this,true);
object.style_context->process_automatic_styles(object.styles.back());
create_element(L"office", L"master-styles", object.styles, this,true);
object.style_context->process_master(object.styles.back());
if (isRoot)
{
create_element(L"office", L"font-face-decls", object.styles, this,true);
create_element(L"office", L"automatic-styles", object.styles, this,true);
object.style_context->process_automatic_styles(object.styles.back());
create_element(L"office", L"master-styles", object.styles, this,true);
object.style_context->process_master(object.styles.back());
create_element(L"office", L"font-face-decls", object.content_styles, this,true);
}
///////////////////////////////
create_element(L"office", L"font-face-decls", object.content_styles, this,true);
create_element(L"office", L"automatic-styles", object.content_styles, this,true);
object.style_context->process_automatic(object.content_styles.back());
......
......@@ -17,6 +17,8 @@ class odf_conversion_context : boost::noncopyable
{
struct _object
{
std::wstring name;
office_element_ptr content;
std::vector<office_element_ptr> content_styles;
std::vector<office_element_ptr> styles;
......@@ -48,9 +50,10 @@ public:
void create_object();
void end_object();
std::wstring get_next_name_object();
private:
void process_styles(_object & object);
void process_styles(_object & object, bool isRoot);
int current_object_;
//page_layout_container & pageLayoutContainer() { return page_layout_container_; }
......
......@@ -448,7 +448,6 @@ void odf_drawing_context::end_line_properies()
{
impl_->current_drawing_part_ = Unknown;
}
void odf_drawing_context::start_shadow_properies()
{
impl_->current_drawing_part_ = Shadow;
......@@ -724,13 +723,21 @@ void odf_drawing_context::start_image(std::wstring & path)
set_image_style_repeat(1);//default
}
void odf_drawing_context::start_object()
void odf_drawing_context::start_object(std::wstring name)
{
start_frame();
office_element_ptr object_elm;
create_element(L"draw", L"object", object_elm, impl_->odf_context_);
draw_object* object = dynamic_cast<draw_object*>(object_elm.get());
if (object == NULL)return;
object->common_xlink_attlist_.href_= std::wstring(L"./") + name;
object->common_xlink_attlist_.type_= xlink_type::Simple;
object->common_xlink_attlist_.show_ = xlink_show::Embed;
object->common_xlink_attlist_.actuate_= xlink_actuate::OnLoad;
start_element(object_elm);
}
......
......@@ -43,7 +43,7 @@ public:
void start_text_box();
void end_text_box();
void start_object();
void start_object(std::wstring name);
void end_object();
void start_element(office_element_ptr & elm);
......
......@@ -17,8 +17,8 @@ void relationship::serialize(std::wostream & _Wostream)
{
CP_XML_NODE(L"manifest:file-entry")
{
CP_XML_ATTR(L"manifest:media-type", type());
CP_XML_ATTR(L"manifest:full-path", target());
CP_XML_ATTR(L"manifest:media-type", type());
}
}
}
......
......@@ -551,7 +551,7 @@ void ods_table_state::convert_position(oox_table_position & oox_pos, double & x,
int curr_col = 1,i;
for (i=0; i< columns_.size(); i++)
{
if (oox_pos.col > columns_[i].repeated - curr_col)
if (oox_pos.col > columns_[i].repeated + curr_col)
{
sz_col += (columns_[i].repeated ) * columns_[i].size;
}
......@@ -569,7 +569,7 @@ void ods_table_state::convert_position(oox_table_position & oox_pos, double & x,
int curr_row = 1;
for (i=0; i< rows_.size(); i++)
{
if (oox_pos.row > rows_[i].repeated - curr_row)
if (oox_pos.row > rows_[i].repeated + curr_row)
{
sz_row += (rows_[i].repeated ) * rows_[i].size;
}
......
#include "precompiled_cpodf.h"
#include "office_chart.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/serialize.h>
#include <cpdoccore/xml/attributes.h>
namespace cpdoccore {
namespace odf {
// office:chart
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * office_chart::ns = L"office";
const wchar_t * office_chart::name = L"chart";
void office_chart::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void office_chart::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & elm, content_)
{
elm->serialize(CP_XML_STREAM());
}
}
}
}
void office_chart::add_child_element(office_element_ptr & child_element)
{
content_.push_back(child_element);
}
void chart_chart_attlist::serialize(CP_ATTR_NODE)
{
common_draw_size_attlist_.serialize(CP_GET_XML_NODE());
common_attlist_.serialize(CP_GET_XML_NODE());
CP_XML_ATTR_OPT(L"chart:class", chart_class_);
CP_XML_ATTR_OPT(L"chart:column-mapping", chart_column_mapping_);
CP_XML_ATTR_OPT(L"chart:row-mapping", chart_row_mapping_);
}
// chart:chart
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_chart::ns = L"chart";
const wchar_t * chart_chart::name = L"chart";
void chart_chart::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void chart_chart::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
chart_chart_attlist_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & elm, content_)
{
elm->serialize(CP_XML_STREAM());
}
}
}
}
void chart_chart::add_child_element(office_element_ptr & child_element)
{
content_.push_back(child_element);
}
//////////////////////////////////////////////////////////////////////////////////////////////////
void chart_title_attlist::serialize(CP_ATTR_NODE)
{
common_draw_position_attlist_.serialize(CP_GET_XML_NODE());
common_attlist_.serialize(CP_GET_XML_NODE());
CP_XML_ATTR_OPT(L"table:cell-range", table_cell_range_);
}
// chart:title
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_title::ns = L"chart";
const wchar_t * chart_title::name = L"title";
void chart_title::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
if CP_CHECK_NAME(L"text", L"p")
{
CP_CREATE_ELEMENT(text_p_);
}
else
CP_NOT_APPLICABLE_ELM();
}
void chart_title::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
chart_title_attlist_.serialize(CP_GET_XML_NODE());
if (text_p_)text_p_->serialize(CP_XML_STREAM());
}
}
}
void chart_title::add_child_element(office_element_ptr & child_element)
{
text_p_ = child_element;
}
// chart:subtitle
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_subtitle::ns = L"chart";
const wchar_t * chart_subtitle::name = L"subtitle";
void chart_subtitle::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
if CP_CHECK_NAME(L"text", L"p")
{
CP_CREATE_ELEMENT(text_p_);
}
else
CP_NOT_APPLICABLE_ELM();
}
void chart_subtitle::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
chart_title_attlist_.serialize(CP_GET_XML_NODE());
if (text_p_)text_p_->serialize(CP_XML_STREAM());
}
}
}
void chart_subtitle::add_child_element(office_element_ptr & child_element)
{
text_p_ = child_element;
}
// chart:footer
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_footer::ns = L"chart";
const wchar_t * chart_footer::name = L"footer";
void chart_footer::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
if CP_CHECK_NAME(L"text", L"p")
{
CP_CREATE_ELEMENT(text_p_);
}
else
CP_NOT_APPLICABLE_ELM();
}
void chart_footer::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
common_attlist_.serialize(CP_GET_XML_NODE());
if (text_p_)text_p_->serialize(CP_XML_STREAM());
}
}
}
void chart_footer::add_child_element(office_element_ptr & child_element)
{
text_p_ = child_element;
}
// chart:legend
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_legend::ns = L"chart";
const wchar_t * chart_legend::name = L"legend";
void chart_legend_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"chart:legend-position", chart_legend_position_);
CP_XML_ATTR_OPT(L"chart:legend-align", chart_legend_align_);
common_draw_position_attlist_.serialize(CP_GET_XML_NODE());
CP_XML_ATTR_OPT(L"style:legend-expansion", style_legend_expansion_);
CP_XML_ATTR_OPT(L"style:legend-expansion-aspect-ratio", style_legend_expansion_aspect_ratio_);
common_attlist_.serialize(CP_GET_XML_NODE());
}
void chart_legend::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
chart_legend_attlist_.serialize(CP_GET_XML_NODE());
}
}
}
/////////////////////
void chart_plot_area_attlist::serialize(CP_ATTR_NODE)
{
common_draw_position_attlist_.serialize(CP_GET_XML_NODE());
common_draw_size_attlist_.serialize(CP_GET_XML_NODE());
common_attlist_.serialize(CP_GET_XML_NODE());
CP_XML_ATTR_OPT(L"table:cell-range-address", table_cell_range_address_);
CP_XML_ATTR_OPT(L"chart:data-source-has-labels", chart_data_source_has_labels_);
}
// chart:plot-area
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_plot_area::ns = L"chart";
const wchar_t * chart_plot_area::name = L"plot-area";
void chart_plot_area::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void chart_plot_area::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
chart_plot_area_attlist_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & elm, content_)
{
elm->serialize(CP_XML_STREAM());
}
}
}
}
void chart_plot_area::add_child_element(office_element_ptr & child_element)
{
content_.push_back(child_element);
}
/////////////
void chart_wall_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"svg:width", svg_width_);
common_attlist_.serialize(CP_GET_XML_NODE());
}
// chart:wall
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_wall::ns = L"chart";
const wchar_t * chart_wall::name = L"wall";
void chart_wall::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
chart_wall_attlist_.serialize(CP_GET_XML_NODE());
}
}
}
// chart:floor
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_floor::ns = L"chart";
const wchar_t * chart_floor::name = L"floor";
void chart_floor::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
common_attlist_.serialize(CP_GET_XML_NODE());
}
}
}
///////////////
void chart_axis_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"chart:dimension", chart_dimension_);
CP_XML_ATTR_OPT(L"chart:name", chart_name_);
common_attlist_.serialize(CP_GET_XML_NODE());
}
// chart:axis
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_axis::ns = L"chart";
const wchar_t * chart_axis::name = L"axis";
void chart_axis::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void chart_axis::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
chart_axis_attlist_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & elm, content_)
{
elm->serialize(CP_XML_STREAM());
}
}
}
}
void chart_axis::add_child_element(office_element_ptr & child_element)
{
content_.push_back(child_element);
}
//////
void chart_grid_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"chart:class", chart_class_);
common_attlist_.serialize(CP_GET_XML_NODE());
}
// chart:grid
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_grid::ns = L"chart";
const wchar_t * chart_grid::name = L"grid";
void chart_grid::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
chart_grid_attlist_.serialize(CP_GET_XML_NODE());
}
}
}
// chart:categories
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_categories::ns = L"chart";
const wchar_t * chart_categories::name = L"categories";
void chart_categories::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"chart:table-cell-range-address", table_cell_range_address_);
}
}
}
///////
void chart_series_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"chart:values-cell-range-address", chart_values_cell_range_address_);
CP_XML_ATTR_OPT(L"chart:label-cell-", chart_label_cell_address_);
CP_XML_ATTR_OPT(L"chart:class", chart_class_);
CP_XML_ATTR_OPT(L"chart:attached-axis", chart_attached_axis_);
common_attlist_.serialize(CP_GET_XML_NODE());
}
// chart:categories
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_series::ns = L"chart";
const wchar_t * chart_series::name = L"series";
void chart_series::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void chart_series::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
chart_series_attlist_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & elm, content_)
{
elm->serialize(CP_XML_STREAM());
}
}
}
}
void chart_series::add_child_element(office_element_ptr & child_element)
{
content_.push_back(child_element);
}
// chart:domain
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_domain::ns = L"chart";
const wchar_t * chart_domain::name = L"domain";
void chart_domain::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"chart:table-cell-range-address", table_cell_range_address_);
}
}
}
///////////////////////////////////////
void chart_data_point_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"chart:repeated", chart_repeated_);
common_attlist_.serialize(CP_GET_XML_NODE());
}
// chart:data-point
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_data_point::ns = L"chart";
const wchar_t * chart_data_point::name = L"data-point";
void chart_data_point::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
chart_data_point_attlist_.serialize(CP_GET_XML_NODE());
}
}
}
// chart:mean-value
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_mean_value::ns = L"chart";
const wchar_t * chart_mean_value::name = L"mean-value";
void chart_mean_value::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
common_attlist_.serialize(CP_GET_XML_NODE());
}
}
}
// chart:error-indicator
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_error_indicator::ns = L"chart";
const wchar_t * chart_error_indicator::name = L"error-indicator";
void chart_error_indicator::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
common_attlist_.serialize(CP_GET_XML_NODE());
}
}
}
// chart:regression-curve
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_regression_curve::ns = L"chart";
const wchar_t * chart_regression_curve::name = L"regression-curve";
void chart_regression_curve::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
if CP_CHECK_NAME(L"chart", L"equation")
{
CP_CREATE_ELEMENT(chart_equation_);
}
}
void chart_regression_curve::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
common_attlist_.serialize(CP_GET_XML_NODE());
if (chart_equation_)chart_equation_->serialize(CP_XML_STREAM());
}
}
}
void chart_regression_curve::add_child_element(office_element_ptr & child_element)
{
chart_equation_ = child_element;
}
// chart:equatione
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_equation::ns = L"chart";
const wchar_t * chart_equation::name = L"equation";
void chart_equation::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
common_attlist_.serialize(CP_GET_XML_NODE());
CP_XML_ATTR_OPT(L"chart:display-r-square", display_r_square_);
}
}
}
// chart:stock-gain-marker
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_stock_gain_marker::ns = L"chart";
const wchar_t * chart_stock_gain_marker::name = L"stock-gain-marker";
void chart_stock_gain_marker::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
common_attlist_.serialize(CP_GET_XML_NODE());
}
}
}
// chart:stock-loss-marker
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_stock_loss_marker::ns = L"chart";
const wchar_t * chart_stock_loss_marker::name = L"stock-loss-marker";
void chart_stock_loss_marker::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
common_attlist_.serialize(CP_GET_XML_NODE());
}
}
}
// chart:stock-range-line
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * chart_stock_range_line::ns = L"chart";
const wchar_t * chart_stock_range_line::name = L"stock-range-line";
void chart_stock_range_line::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
common_attlist_.serialize(CP_GET_XML_NODE());
}
}
}
}
}
#pragma once
#include <iosfwd>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h>
#include "common_attlists.h"
#include "text_elements.h"
namespace cpdoccore {
namespace odf {
/// \brief office:chart
class office_chart : public office_element_impl<office_chart>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeChart;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(office_chart);
///common-chart-attlis
class common_chart_attlist
{
public:
_CP_OPT(std::wstring) chart_style_name_;
void serialize(CP_ATTR_NODE) {CP_XML_ATTR_OPT(L"chart:style-name", chart_style_name_);}
};
/// chart-chart-attlist
class chart_chart_attlist
{
public:
void serialize(CP_ATTR_NODE);
common_draw_size_attlist common_draw_size_attlist_;
common_chart_attlist common_attlist_;
_CP_OPT(std::wstring) chart_class_;
_CP_OPT(std::wstring) chart_column_mapping_;
_CP_OPT(std::wstring) chart_row_mapping_;
};
/// \brief chart:chart
class chart_chart : public office_element_impl<chart_chart>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartChart;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
chart_chart_attlist chart_chart_attlist_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_chart);
/// chart-title-attlist
class chart_title_attlist
{
public:
void serialize(CP_ATTR_NODE);
_CP_OPT(std::wstring) table_cell_range_;
common_draw_position_attlist common_draw_position_attlist_;
common_chart_attlist common_attlist_;
};
/// \brief chart:title
class chart_title : public office_element_impl<chart_title>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartTitle;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
chart_title_attlist chart_title_attlist_;
office_element_ptr text_p_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_title);
/// \brief chart:subtitle
class chart_subtitle : public office_element_impl<chart_subtitle>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartSubtitle;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
chart_title_attlist chart_title_attlist_;
office_element_ptr text_p_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_subtitle);
/// \brief chart:footer
class chart_footer : public office_element_impl<chart_footer>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartFooter;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
common_chart_attlist common_attlist_;
office_element_ptr text_p_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_footer);
class chart_legend_attlist
{
public:
void serialize(CP_ATTR_NODE);
_CP_OPT(std::wstring) chart_legend_position_;
_CP_OPT(std::wstring) chart_legend_align_;
common_draw_position_attlist common_draw_position_attlist_;
_CP_OPT(std::wstring) style_legend_expansion_;
_CP_OPT(double) style_legend_expansion_aspect_ratio_;
common_chart_attlist common_attlist_;
};
/// \brief chart:legend
class chart_legend : public office_element_impl<chart_legend>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartLegend;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element( office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
chart_legend_attlist chart_legend_attlist_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_legend);
class chart_plot_area_attlist
{
public:
void serialize(CP_ATTR_NODE);
common_draw_position_attlist common_draw_position_attlist_;
common_draw_size_attlist common_draw_size_attlist_;
common_chart_attlist common_attlist_;
_CP_OPT(std::wstring) table_cell_range_address_;
_CP_OPT(std::wstring) chart_data_source_has_labels_;
// dr3d-scene-attlist
// common-dr3d-transform-attlist
};
/// \brief chart:plot-area
class chart_plot_area : public office_element_impl<chart_plot_area>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartPlotArea;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
chart_plot_area_attlist chart_plot_area_attlist_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_plot_area);
class chart_wall_attlist
{
public:
void serialize(CP_ATTR_NODE);
_CP_OPT(length) svg_width_;
common_chart_attlist common_attlist_;
};
class chart_wall : public office_element_impl<chart_wall>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartWall;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element( office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
chart_wall_attlist chart_wall_attlist_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_wall);
/// \brief chart:floor
class chart_floor : public office_element_impl<chart_floor>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartFloor;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element( office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
common_chart_attlist common_attlist_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_floor);
class chart_axis_attlist
{
public:
void serialize(CP_ATTR_NODE);
_CP_OPT(std::wstring) chart_dimension_;
_CP_OPT(std::wstring) chart_name_;
common_chart_attlist common_attlist_;
};
/// \brief chart:axis
class chart_axis : public office_element_impl<chart_axis>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartAxis;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
chart_axis_attlist chart_axis_attlist_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_axis);
class chart_grid_attlist
{
public:
void serialize(CP_ATTR_NODE);
_CP_OPT(std::wstring) chart_class_;
common_chart_attlist common_attlist_;
};
/// \brief chart:grid
class chart_grid : public office_element_impl<chart_grid>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartGrid;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element( office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
chart_grid_attlist chart_grid_attlist_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_grid);
/// \brief chart:categories
class chart_categories : public office_element_impl<chart_categories>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartCategories;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element( office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
_CP_OPT(std::wstring) table_cell_range_address_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_categories);
class chart_series_attlist
{
public:
void serialize(CP_ATTR_NODE);
_CP_OPT(std::wstring) chart_values_cell_range_address_;
_CP_OPT(std::wstring) chart_label_cell_address_;
_CP_OPT(std::wstring) chart_class_;
_CP_OPT(std::wstring) chart_attached_axis_;
common_chart_attlist common_attlist_;
};
/// \brief chart:series
class chart_series : public office_element_impl<chart_series>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartSeries;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
chart_series_attlist chart_series_attlist_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_series);
/// \brief chart:domain
class chart_domain : public office_element_impl<chart_domain>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartDomain;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element( office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
_CP_OPT(std::wstring) table_cell_range_address_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_domain);
class chart_data_point_attlist
{
public:
void serialize(CP_ATTR_NODE);
_CP_OPT(unsigned int) chart_repeated_;
common_chart_attlist common_attlist_;
};
/// \brief chart:data-point
class chart_data_point : public office_element_impl<chart_data_point>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartDataPoint;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element( office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
chart_data_point_attlist chart_data_point_attlist_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_data_point);
/// \brief chart:mean-value
class chart_mean_value : public office_element_impl<chart_mean_value>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartMeanValue;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element( office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
common_chart_attlist common_attlist_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_mean_value);
/// \brief chart:error-indicator
class chart_error_indicator : public office_element_impl<chart_error_indicator>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartErrorIndicator;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element( office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
common_chart_attlist common_attlist_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_error_indicator);
class chart_equation : public office_element_impl<chart_equation>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartEquation;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}//???
virtual void add_child_element( office_element_ptr & child_element){}//???
virtual void serialize(std::wostream & _Wostream);
common_chart_attlist common_attlist_;
_CP_OPT(Bool) display_r_square_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_equation);
class chart_regression_curve : public office_element_impl<chart_regression_curve>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartRegressionCurve;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
common_chart_attlist common_attlist_;
office_element_ptr chart_equation_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_regression_curve);
/// \brief chart:stock-gain-marker
class chart_stock_gain_marker : public office_element_impl<chart_stock_gain_marker>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartStockGainMarker;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element( office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
common_chart_attlist common_attlist_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_stock_gain_marker);
/// \brief chart:stock-loss-marker
class chart_stock_loss_marker : public office_element_impl<chart_stock_loss_marker>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartStockLossMarker;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element( office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
common_chart_attlist common_attlist_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_stock_loss_marker);
/// \brief chart:stock-range-line
class chart_stock_range_line : public office_element_impl<chart_stock_range_line>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartStockRangeLine;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element( office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
common_chart_attlist common_attlist_;
};
CP_REGISTER_OFFICE_ELEMENT2(chart_stock_range_line);
}
}
......@@ -1133,7 +1133,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CGraphicFrame* oox_graphic_frame)
{
if (!oox_graphic_frame)return;
////////////////////////////////////////////////////////////////////////////////
ods_context->drawing_context()->start_object();
ods_context->drawing_context()->start_object(ods_context->get_next_name_object());
{
if (oox_graphic_frame->m_oNvGraphicFramePr.IsInit())
{
......@@ -1159,7 +1159,6 @@ void XlsxConverter::convert(OOX::Spreadsheet::CGraphicFrame* oox_graphic_frame)
}
//
}
}
ods_context->drawing_context()->end_object();
}
......
......@@ -2,6 +2,6 @@
//1
//2
//0
//31
#define INTVER 1,2,0,31
#define STRVER "1,2,0,31\0"
//32
#define INTVER 1,2,0,32
#define STRVER "1,2,0,32\0"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment