Commit 621acc78 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormatWriter - add review contents

parent a69dc9e5
......@@ -30,18 +30,14 @@
*
*/
#include "abstract_xml.h"
//#include "paragraph_elements.h"
#include <boost/foreach.hpp>
namespace cpdoccore {
namespace odf_writer {
// abstract-xml
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * abstract_xml::ns = L"";
const wchar_t * abstract_xml::name = L"abstract-xml";
......@@ -50,16 +46,6 @@ void abstract_xml::serialize(std::wostream & strm)
{
}
//void abstract_xml::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
//{
// CP_CREATE_ELEMENT(xml_content_);
//}
//
//void abstract_xml::add_child_element( const office_element_ptr & child_element)
//{
// xml_content_.push_back(child_element);
//}
}
}
......@@ -72,7 +72,7 @@ void calcext_date_is_attr::serialize(CP_ATTR_NODE)
const wchar_t * calcext_conditional_formats::ns = L"calcext";
const wchar_t * calcext_conditional_formats::name = L"conditional-formats";
void calcext_conditional_formats::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void calcext_conditional_formats::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -99,7 +99,7 @@ void calcext_conditional_formats::serialize(std::wostream & _Wostream)
const wchar_t * calcext_conditional_format::ns = L"calcext";
const wchar_t * calcext_conditional_format::name = L"conditional-format";
void calcext_conditional_format::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void calcext_conditional_format::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -128,7 +128,7 @@ void calcext_conditional_format::serialize(std::wostream & _Wostream)
const wchar_t * calcext_data_bar::ns = L"calcext";
const wchar_t * calcext_data_bar::name = L"data-bar";
void calcext_data_bar::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void calcext_data_bar::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -156,7 +156,7 @@ void calcext_data_bar::serialize(std::wostream & _Wostream)
const wchar_t * calcext_color_scale::ns = L"calcext";
const wchar_t * calcext_color_scale::name = L"color-scale";
void calcext_color_scale::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void calcext_color_scale::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -182,7 +182,7 @@ void calcext_color_scale::serialize(std::wostream & _Wostream)
const wchar_t * calcext_icon_set::ns = L"calcext";
const wchar_t * calcext_icon_set::name = L"icon-set";
void calcext_icon_set::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void calcext_icon_set::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......
......@@ -99,7 +99,7 @@ public:
static const ElementType type = typeCalcextColorScaleEntry;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -121,7 +121,7 @@ public:
static const ElementType type = typeCalcextFormattingEntry;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -142,7 +142,7 @@ public:
static const ElementType type = typeCalcextIconSet;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -165,7 +165,7 @@ public:
static const ElementType type = typeCalcextDataBar;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -187,7 +187,7 @@ public:
static const ElementType type = typeCalcextColorScale;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -207,7 +207,7 @@ public:
static const ElementType type = typeCalcextDateIs;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -226,7 +226,7 @@ public:
static const ElementType type = typeCalcextCondition;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -245,7 +245,7 @@ public:
static const ElementType type = typeCalcextConditionalFormat;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -268,7 +268,7 @@ public:
static const ElementType type = typeCalcextConditionalFormats;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......
......@@ -59,7 +59,7 @@ const wchar_t * draw_base::ns = L"draw";
const wchar_t * draw_base::name = L"base";
/////////////////////////////////////////////////////////////////////////////////////////////////////////
void draw_base::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void draw_base::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......
......@@ -53,7 +53,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......
......@@ -97,7 +97,7 @@ void draw_image::serialize(std::wostream & _Wostream)
}
}
void draw_image::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void draw_image::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"office", L"binary-data")
{
......@@ -144,7 +144,7 @@ void draw_chart::serialize(std::wostream & _Wostream)
}
void draw_chart::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void draw_chart::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -174,7 +174,7 @@ void draw_g::serialize(std::wostream & _Wostream)
}
}
}
void draw_g::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void draw_g::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -204,7 +204,7 @@ void draw_frame::serialize(std::wostream & _Wostream)
}
}
void draw_frame::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void draw_frame::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (CP_CHECK_NAME(L"draw", L"text-box") ||
CP_CHECK_NAME(L"draw", L"image") ||//копия чарта в виде картинки ну.. или просто картинка
......@@ -293,7 +293,7 @@ void draw_text_box::serialize(std::wostream & _Wostream)
}
}
void draw_text_box::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void draw_text_box::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -318,7 +318,7 @@ void draw_object::serialize(std::wostream & _Wostream)
}
}
void draw_object::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void draw_object::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM(); // TODO
}
......@@ -343,7 +343,7 @@ void draw_object_ole::serialize(std::wostream & _Wostream)
}
}
void draw_object_ole::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void draw_object_ole::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
......
......@@ -71,7 +71,7 @@ public:
static const ElementType type = typeDrawImage;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -97,7 +97,7 @@ public:
static const ElementType type = typeDrawChart;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -122,7 +122,7 @@ public:
static const ElementType type = typeDrawFrame;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -152,7 +152,7 @@ public:
static const ElementType type = typeDrawG;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -187,7 +187,7 @@ public:
static const ElementType type = typeDrawTextBox;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -208,7 +208,7 @@ public:
static const ElementType type = typeDrawObject;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -229,7 +229,7 @@ public:
static const ElementType type = typeDrawObjectOle;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......
......@@ -444,7 +444,7 @@ void draw_enhanced_geometry::serialize(std::wostream & _Wostream)
typedef shared_ptr<draw_handle> draw_handle_ptr;
void draw_enhanced_geometry::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void draw_enhanced_geometry::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"draw", L"handle")
{
......
......@@ -256,7 +256,7 @@ public:
static const xml::NodeType xml_type = xml::typeElement;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -302,7 +302,7 @@ public:
static const xml::NodeType xml_type = xml::typeElement;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -343,7 +343,7 @@ public:
static const ElementType type = typeDrawEnhancedGeometry;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......
......@@ -61,7 +61,7 @@ void style_header_footer_properties_attlist::serialize(CP_ATTR_NODE)
const wchar_t * style_header_footer_properties::ns = L"style";
const wchar_t * style_header_footer_properties::name = L"header-footer-properties";
void style_header_footer_properties::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_header_footer_properties::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (L"style" == Ns && L"background-image" == Name)
{
......@@ -84,19 +84,44 @@ void style_header_footer_properties::serialize(std::wostream & strm)
}
}
//////////////////////////////////////////
void header_footer_content::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context)
void header_footer_content::create_child_element(const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context)
{
if CP_CHECK_NAME(L"text", L"tracked-changes")
{
CP_CREATE_ELEMENT_SIMPLE(tracked_changes_);
}
else
CP_CREATE_ELEMENT_SIMPLE(content_);
}
void header_footer_content::add_child_element( const office_element_ptr & child)
void header_footer_content::add_child_element( const office_element_ptr & child_element, odf_conversion_context * Context)
{
content_.push_back(child);
if (!child_element) return;
switch(child_element->get_type())
{
case typeTextTrackedChanges:
{
tracked_changes_ = child_element;
}break;
case typeTextChangedRegion:
{
if (!tracked_changes_)
create_child_element(L"text", L"tracked-changes", Context);
tracked_changes_->add_child_element(child_element);
}break;
default:
content_.push_back(child_element);
}
}
void header_footer_content::serialize(std::wostream & strm)
{
BOOST_FOREACH(const office_element_ptr & elm, content_)
if (tracked_changes_)
tracked_changes_->serialize(strm);
for (int i = 0; i < content_.size(); i++)
{
elm->serialize(strm);
content_[i]->serialize(strm);
}
}
}
......
......@@ -75,7 +75,7 @@ public:
static const ElementType type = typeStyleHeaderFooterProperties;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child)
{
_CP_LOG << L"Non add child in " << ns << L":" << name << std::endl;
......@@ -102,11 +102,12 @@ public:
class header_footer_content
{
public:
void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context);
void add_child_element( const office_element_ptr & child);
void create_child_element ( const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context);
void add_child_element ( const office_element_ptr & child, odf_conversion_context * Context);
void serialize(std::wostream & strm);
private:
office_element_ptr tracked_changes_;
office_element_ptr_array content_;
};
......
......@@ -52,14 +52,14 @@ public:
public:
text_number() {}
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
virtual void add_text(const std::wstring & Text);
::std::wstring string_;
std::wstring string_;
};
......@@ -71,7 +71,7 @@ CP_REGISTER_OFFICE_ELEMENT2(text_number);
class text_list_item;
typedef shared_ptr<text_list_item>::Type text_list_item_ptr;
typedef ::std::vector<text_list_item_ptr> text_list_item_ptr_array;
typedef std::vector<text_list_item_ptr> text_list_item_ptr_array;
class text_list_item : public office_element_impl<text_list_item>
{
......@@ -82,7 +82,7 @@ public:
static const ElementType type = typeTextListItem;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -116,7 +116,7 @@ public:
static const ElementType type = typeTextListHeader;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......
......@@ -109,7 +109,7 @@ void number_time_style::serialize(std::wostream & strm)
}
}
}
void number_style_base::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void number_style_base::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"style", L"text-properties")
{
......@@ -238,7 +238,7 @@ void number_number::serialize(std::wostream & strm)
}
}
void number_number::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void number_number::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"number", L"embedded-text")
{
......
......@@ -49,7 +49,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -184,7 +184,7 @@ public:
static const ElementType type = typeNumberText;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
......@@ -206,7 +206,7 @@ public:
static const ElementType type = typeNumberNumber;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -238,7 +238,7 @@ public:
static const ElementType type = typeNumberEmbeddedText;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void serialize(std::wostream & strm);
virtual void add_text(const std::wstring & Text);
......@@ -260,7 +260,7 @@ public:
static const ElementType type = typeNumberScientificNumber;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void serialize(std::wostream & strm);
// number-scientific-number-attlist
......@@ -287,7 +287,7 @@ public:
static const ElementType type = typeNumberCurrencySymbol;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void serialize(std::wostream & strm);
virtual void add_text(const std::wstring & Text);
......@@ -311,7 +311,7 @@ public:
static const ElementType type = typeNumberTextContent;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void serialize(std::wostream & strm);
......@@ -335,7 +335,7 @@ public:
static const ElementType type = typeNumberDayOfWeek;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void serialize(std::wostream & strm);
_CP_OPT(std::wstring) number_style_;
......@@ -356,7 +356,7 @@ public:
static const ElementType type = typeNumberQuarter;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void serialize(std::wostream & strm);
_CP_OPT(std::wstring) number_style_;
......@@ -377,7 +377,7 @@ public:
static const ElementType type = typeNumberDay;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void serialize(std::wostream & strm);
_CP_OPT(std::wstring) number_style_;
......@@ -397,7 +397,7 @@ public:
static const ElementType type = typeNumberMonth;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void serialize(std::wostream & strm);
_CP_OPT(odf_types::Bool) number_textual_;
......@@ -420,7 +420,7 @@ public:
static const ElementType type = typeNumberYear;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void serialize(std::wostream & strm);
_CP_OPT(std::wstring) number_style_;
......@@ -440,7 +440,7 @@ public:
static const ElementType type = typeNumberHours;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void serialize(std::wostream & strm);
_CP_OPT(std::wstring) number_style_;
......@@ -460,7 +460,7 @@ public:
static const ElementType type = typeNumberMinutes;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void serialize(std::wostream & strm);
_CP_OPT(std::wstring) number_style_;
......@@ -480,7 +480,7 @@ public:
static const ElementType type = typeNumberSeconds;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void serialize(std::wostream & strm);
_CP_OPT(std::wstring) number_style_;
......@@ -501,7 +501,7 @@ public:
static const ElementType type = typeNumberAmPm;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void serialize(std::wostream & strm);
......@@ -519,7 +519,7 @@ public:
static const ElementType type = typeNumberFraction;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){CP_NOT_APPLICABLE_ELM();}
virtual void serialize(std::wostream & strm);
_CP_OPT(int) number_min_integer_digits_;
......
......@@ -169,7 +169,7 @@ void odf_comment_context::set_author(std::wstring author)
if ((impl_->comments_.size()<1) || !is_started()) return;
office_element_ptr elm;
create_element(L"dc", L"creator",elm,impl_->odf_context_);
create_element(L"dc", L"creator", elm, impl_->odf_context_);
dc_creator* creator = dynamic_cast<dc_creator*>(elm.get());
if (!creator)return;
......@@ -183,8 +183,9 @@ void odf_comment_context::set_author(std::wstring author)
void odf_comment_context::set_date(std::wstring _date)
{
if ((impl_->comments_.size()<1) || !is_started()) return;
office_element_ptr elm;
create_element(L"dc", L"date",elm,impl_->odf_context_);
create_element(L"dc", L"date", elm, impl_->odf_context_);
dc_date* date = dynamic_cast<dc_date*>(elm.get());
if (!date)return;
......
......@@ -59,7 +59,7 @@ odf_conversion_context::odf_conversion_context(_office_type_document type_, pack
: type (type_), chart_context_ (this), page_layout_context_(this)
{
output_document_ = outputDocument;
current_object_ =0;
current_object_ = 0;
applicationFonts_ = new CApplicationFonts();
......@@ -174,7 +174,7 @@ void odf_conversion_context::end_document()
void odf_conversion_context::start_chart()
{
create_object();
create_element(L"office", L"chart", objects_.back().content, this,true);
create_element(L"office", L"chart", objects_.back().content, this, true);
chart_context_.set_styles_context(styles_context());
chart_context_.start_chart(get_current_object_element());
......@@ -182,12 +182,12 @@ void odf_conversion_context::start_chart()
void odf_conversion_context::start_spreadsheet()
{
create_object();
create_element(L"office", L"spreadsheet", objects_.back().content, this,true);
create_element(L"office", L"spreadsheet", objects_.back().content, this, true);
}
void odf_conversion_context::start_text()
{
create_object();
create_element(L"office", L"text", objects_.back().content, this,true);
create_element(L"office", L"text", objects_.back().content, this, true);
}
void odf_conversion_context::create_object()
{
......@@ -203,7 +203,7 @@ void odf_conversion_context::create_object()
objects_.push_back(obj);
current_object_ = objects_.size()-1;
current_object_ = objects_.size() - 1;
}
void odf_conversion_context::end_chart()
{
......@@ -222,7 +222,7 @@ void odf_conversion_context::end_spreadsheet()
}
void odf_conversion_context::end_object()
{
current_object_ = 0;
current_object_ = 0;//main
}
office_element_ptr & odf_conversion_context::get_current_object_element()
......@@ -243,7 +243,6 @@ void odf_conversion_context::process_settings(_object & object, bool isRoot)
if (isRoot)
{
}
}
void odf_conversion_context::process_styles(_object & object, bool isRoot)
......
......@@ -139,6 +139,7 @@ void odf_notes_context::end_note_content()
{
impl_->notes_.back().is_started = false;
}
int odf_notes_context::find_by_id(int oox_id, int type)
{
for (int i=0; i < impl_->notes_.size(); i++)
......
......@@ -255,23 +255,23 @@ void odf_page_layout_context::set_background(_CP_OPT(color) & color, int type)
///////////////////////////////////////////////////////////////
bool odf_page_layout_context::add_footer(int type)
{
office_element_ptr elm;
root_header_footer_ = office_element_ptr();
if (type == 1)
{
if (even_and_left_headers_)
create_element(L"style", L"footer-left", elm, odf_context_);
create_element(L"style", L"footer-left", root_header_footer_, odf_context_);
}
else if (type == 2)
create_element(L"style", L"footer-first", elm, odf_context_);
create_element(L"style", L"footer-first", root_header_footer_, odf_context_);
else
create_element(L"style", L"footer", elm, odf_context_);
create_element(L"style", L"footer", root_header_footer_, odf_context_);
if (!elm) return false;
if (!root_header_footer_) return false;
if (master_state_list_.empty())
add_master_page(L"");
master_state_list_.back().add_footer(elm);
master_state_list_.back().add_footer(root_header_footer_);
/////////////////////////////////////////////////////////////////////
//настраить нужно 1 раз
......@@ -313,30 +313,31 @@ bool odf_page_layout_context::add_footer(int type)
}
bool odf_page_layout_context::add_header(int type)
{
office_element_ptr elm;
root_header_footer_ = office_element_ptr();
if (type == 1)
{
if (even_and_left_headers_)
create_element(L"style", L"header-left", elm, odf_context_);
create_element(L"style", L"header-left", root_header_footer_, odf_context_);
}
else if (type == 2)
create_element(L"style", L"header-first", elm, odf_context_);
create_element(L"style", L"header-first", root_header_footer_, odf_context_);
else
create_element(L"style", L"header", elm, odf_context_);
create_element(L"style", L"header", root_header_footer_, odf_context_);
if (!elm) return false;
if (!root_header_footer_) return false;
if (master_state_list_.empty())
add_master_page(L"");
master_state_list_.back().add_header(elm);
master_state_list_.back().add_header(root_header_footer_);
////////////////////////////////////////////////////////////////////////
//настроить нужно один раз
if (!layout_state_list_.back().header_size_) return true;
style_header_footer_properties * header_props = get_header_properties();
if (!header_props)return true;
style_page_layout_properties * props = get_properties();
if (!props)return true;
......
......@@ -101,6 +101,8 @@ public:
void set_page_number_format (_CP_OPT(int) & type, _CP_OPT(int) & start);
office_element_ptr root_header_footer_; //для топовых элементов в style:footer
double current_page_width_;
bool even_and_left_headers_;
private:
......
......@@ -110,7 +110,7 @@ void odf_master_state::add_footer(office_element_ptr & elm)
style_->add_child_element(elm);
odf_element_state state = {elm,L"",office_element_ptr(), 1};
odf_element_state state = {elm, L"", office_element_ptr(), 1};
elements_.push_back(state);
}
......@@ -121,7 +121,7 @@ void odf_master_state::add_header(office_element_ptr & elm)
style_->add_child_element(elm);
odf_element_state state = {elm,L"",office_element_ptr(), 1};
odf_element_state state = {elm, L"", office_element_ptr(), 1};
elements_.push_back(state);
}
......
......@@ -48,7 +48,7 @@ public:
relationship(const std::wstring & Type,const std::wstring & Target) : type_(Type), target_(Target)
{}
void serialize(::std::wostream & _Wostream);
void serialize(std::wostream & _Wostream);
const std::wstring & type() const { return type_; }
const std::wstring & target() const { return target_; }
......
......@@ -281,14 +281,15 @@ void odf_text_context::start_element(office_element_ptr & elm, office_element_pt
odf_element_state state={elm, style_name, style_elm, level};
text_elements_list_.push_back(state);
if (current_level_.size()>0)
if (!current_level_.empty())
current_level_.back().elm->add_child_element(elm);
current_level_.push_back(state);
}
void odf_text_context::end_element()
{
if (single_paragraph_ == false && current_level_.size() > 0)
if (single_paragraph_ == false && !current_level_.empty())
{
current_level_.pop_back();
}
......@@ -533,7 +534,7 @@ void odf_text_context::save_property_break()
if (paragraph_properties_ == NULL)
{
for (unsigned int i = current_level_.size()-1; i>=0; i--)
for (int i = current_level_.size() - 1; i >= 0; i--)
{
office_element_ptr & elm = current_level_[i].elm;
......@@ -543,7 +544,7 @@ void odf_text_context::save_property_break()
if ((p || h) && !current_level_[i].style_elm)
{
styles_context_->create_style(L"",odf_types::style_family::Paragraph, true, false, -1);
styles_context_->create_style(L"", odf_types::style_family::Paragraph, true, false, -1);
odf_style_state_ptr style_ = styles_context_->last_state();
if (style_)
{
......@@ -563,23 +564,29 @@ void odf_text_context::save_property_break()
need_break_ = boost::none;
}
void odf_text_context::set_type_break(int type, int clear)
bool odf_text_context::set_type_break(int type, int clear)//todooo clear ???
{
//brclearAll = 0,
//brclearLeft = 1,
//brclearNone = 2,
//brclearRight = 3
bool need_restart = false;
if (type == -1)
{
need_break_= boost::none;
need_break_ = boost::none;
}
else if (type == 0)//brtypeColumn
{
need_break_= fo_break(fo_break::Column);
need_break_ = fo_break(fo_break::Column);
need_restart = true;
}
else if (type == 1)//brtypePage
{
office_element_ptr elm;
create_element(L"text", L"soft-page-break", elm, odf_context_);
start_element(elm);
end_element();
need_break_ = fo_break(fo_break::Page);
need_restart = true;
}
else //brtypeTextWrapping
{
......@@ -589,7 +596,7 @@ void odf_text_context::set_type_break(int type, int clear)
if (current_level_.size()>0)
current_level_.back().elm->add_child_element(elm);
}
return need_restart;
}
bool odf_text_context::set_master_page_name (std::wstring & master_page_name)
......
......@@ -53,8 +53,8 @@ class style_text_properties;
class odf_text_context: boost::noncopyable
{
public:
odf_text_context(odf_conversion_context *odf_context);
~odf_text_context();
odf_text_context (odf_conversion_context *odf_context);
~odf_text_context ();
public:
odf_style_context* get_styles_context();//для embedded
void set_styles_context(odf_style_context* styles_context);//для embedded
......@@ -75,7 +75,6 @@ public:
void start_paragraph (office_element_ptr & elm, bool styled = false);
void end_paragraph ();
void start_element (office_element_ptr & elm, office_element_ptr style_elm = office_element_ptr(),std::wstring style_name = L"");
void end_element ();
......@@ -92,25 +91,24 @@ public:
void end_list ();
bool is_need_break (){return bool(need_break_);}
void set_type_break (int type, int clear);
bool set_type_break (int type, int clear);
void save_property_break();
void add_tab(_CP_OPT(int) ref);
void add_tab (_CP_OPT(int) ref = boost::none);
void set_outline_level (int level);
bool get_list_item_state() {return list_state_.levels.size() > 0 ? list_state_.levels.back() : false;}
void set_parent_paragraph_style (std::wstring & style_name);
void set_parent_span_style (std::wstring & style_name);
bool set_master_page_name (std::wstring & master_page_name);
style_text_properties *get_text_properties () {return text_properties_;}
style_paragraph_properties *get_paragraph_properties () {return paragraph_properties_;}
void set_outline_level (int level);
bool get_KeepNextParagraph () {return keep_next_paragraph_;}
void set_KeepNextParagraph (bool val) {keep_next_paragraph_ = val;}
bool get_list_item_state () {return list_state_.levels.size() > 0 ? list_state_.levels.back() : false;}
style_text_properties *get_text_properties () {return text_properties_;}
style_paragraph_properties *get_paragraph_properties () {return paragraph_properties_;}
//------------------------------------------------------------------------------------
int current_outline_;
bool in_field_;
......
......@@ -46,6 +46,8 @@
#include "style_text_properties.h"
#include "office_text.h"
#include "office_annotation.h"
#include "paragraph_elements.h"
#include "text_elements.h"
......@@ -75,6 +77,7 @@ odt_conversion_context::odt_conversion_context(package::odf_document * outputDoc
: odf_conversion_context (TextDocument, outputDocument),
comment_context_(this), notes_context_(this), main_text_context_(NULL), table_context_(this)
{
current_field_.enabled = false;
current_field_.started = false;
current_field_.in_span = false;
......@@ -86,6 +89,9 @@ odt_conversion_context::odt_conversion_context(package::odf_document * outputDoc
is_paragraph_in_current_section_ = false;
text_changes_state_.main_text_context = NULL; //header, footer, drawing, main, ..
text_changes_state_.level = 0;
drop_cap_state_.clear();
}
......@@ -104,8 +110,6 @@ void odt_conversion_context::start_document()
page_layout_context()->set_styles_context(styles_context());
//current_level_.push_back(get_current_object_element());
/////////////////настройки дефолтовые
root_text_->office_text_attlist_.text_use_soft_page_breaks_ = true;
......@@ -209,7 +213,7 @@ void odt_conversion_context::add_text_content(const std::wstring & text)
}
void odt_conversion_context::add_to_root()
{
if (text_context_.size() >0) return; // не root element (embedded) ????
if (!text_context_.empty()) return; // не root element (embedded) ????
if (comment_context_.is_started()) return;
......@@ -282,15 +286,15 @@ void odt_conversion_context::start_paragraph(bool styled)
add_to_root();
}
void odt_conversion_context::add_page_break()
void odt_conversion_context::add_paragraph_break(int type)
{
office_element_ptr elm;
create_element(L"text", L"soft-page-break", elm, this);
//office_element_ptr elm;
//create_element(L"text", L"soft-page-break", elm, this);
if (current_root_elements_.size() > 0)
{
text_p* para = NULL;
style * style_ = NULL;
//text_p* para = NULL;
//style * style_ = NULL;
//http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415190_253892949
//нихере не работает !! в span, ... приходится генерить разрыв вручную !!
......@@ -300,34 +304,36 @@ void odt_conversion_context::add_page_break()
// end_paragraph();
//}
//else/* if (header = dynamic_cast<text_h*>(current_root_elements_.back().elm.get()))*/
{
//{
//тут получается что разрыв будет прописан внутри элемента (не параграфа) - так что вручную свойство запишем
//в случае разрыва параграфов оно запишется при старте после-разрывного параграфа
text_context()->set_type_break(1, 0);
//text_context()->set_type_break(type, 0);
text_context()->save_property_break();
}
text_context()->start_element(elm);
add_to_root();
text_context()->end_element();
if (para)
{
styles_context()->create_style(L"", odf_types::style_family::Paragraph, true, false, -1);
//styles_context()->last_state().apply_from(style_);
if (style_ )
{
style_paragraph_properties * new_props = NULL;
if (styles_context()->last_state())
{// нужна именно копия св-в так как будет добавочные свойства
new_props = styles_context()->last_state()->get_paragraph_properties();
if (new_props)new_props->apply_from(style_->style_content_.get_style_paragraph_properties());
if (style_->style_parent_style_name_)
styles_context()->last_state()->set_parent_style_name(*style_->style_parent_style_name_);
}
}
start_paragraph(true);
}
//}
//if (type == 1) //page
//{
// text_context()->start_element(elm);
// //add_to_root();
// text_context()->end_element();
//}
//if (para)
//{
// styles_context()->create_style(L"", odf_types::style_family::Paragraph, true, false, -1);
// //styles_context()->last_state().apply_from(style_);
// if (style_ )
// {
// style_paragraph_properties * new_props = NULL;
// if (styles_context()->last_state())
// {// нужна именно копия св-в так как будет добавочные свойства
// new_props = styles_context()->last_state()->get_paragraph_properties();
// if (new_props)new_props->apply_from(style_->style_content_.get_style_paragraph_properties());
//
// if (style_->style_parent_style_name_)
// styles_context()->last_state()->set_parent_style_name(*style_->style_parent_style_name_);
// }
// }
// start_paragraph(true);
//}
}
}
void odt_conversion_context::start_hyperlink(std::wstring ref)
......@@ -576,7 +582,7 @@ void odt_conversion_context::start_list_item(int level, std::wstring style_name
// add_to_root();
// text_context()->start_list_item();
//}
level = level +1; //отсчет от 1 (а не 0)
level = level + 1; //отсчет от 1 (а не 0)
if (text_context()->list_state_.style_name != style_name && text_context()->list_state_.started_list)
{
......@@ -792,18 +798,117 @@ void odt_conversion_context::end_note()
text_context()->current_level_.pop_back();
}
//--------------------------------------------------------------------------------------------------------
void odt_conversion_context::start_change (int id, int type, std::wstring &author, std::wstring &userId, std::wstring &date)
{
if (!text_changes_state_.main_text_context)
{
text_changes_state_.main_text_context = text_context();
}
text_changes_state_.level++;
if (!text_changes_state_.main_text_context) return;
std::wstring strId = L"ct" + std::to_wstring(id);
//---------------------------------------------------------------------------------
office_element_ptr start_elm;
if (type == 2) create_element(L"text", L"change", start_elm, this); //место удаления ..
else
create_element(L"text", L"change-start", start_elm, this); //место изменения ....
text_add_change* change = dynamic_cast<text_add_change*>(start_elm.get());
if (change) change->text_change_id_ = strId;
text_changes_state_.main_text_context->start_element(start_elm);
text_changes_state_.main_text_context->end_element();
//---------------------------------------------------------------------------------
office_element_ptr region_elm;
create_element(L"text", L"changed-region", region_elm, this);
text_changed_region* region = dynamic_cast<text_changed_region*>(region_elm.get());
if (region)region->text_id_ = strId;
office_element_ptr child_elm;
if (type == 1) create_element(L"text", L"insertion", child_elm, this);
if (type == 2) create_element(L"text", L"deletion", child_elm, this);
if (type == 3) create_element(L"text", L"format-change", child_elm, this);
office_element_ptr info_elm;
create_element(L"office", L"change-info", info_elm, this);
child_elm->add_child_element(info_elm);
if (info_elm)
{
office_element_ptr creator_elm;
create_element(L"dc", L"creator", creator_elm, this);
info_elm->add_child_element(creator_elm);
dc_creator* creator = dynamic_cast<dc_creator*>(creator_elm.get());
if (!creator)return;
creator->content_ = author;
office_element_ptr date_elm;
create_element(L"dc", L"date", date_elm, this);
info_elm->add_child_element(date_elm);
dc_date* date_ = dynamic_cast<dc_date*>(date_elm.get());
if (!date_) return;
date_->content_ = date;
}
if (is_header_ || is_footer_) page_layout_context()->root_header_footer_->add_child_element(region_elm);
else get_current_object_element()->add_child_element(region_elm);
region_elm->add_child_element(child_elm);
if (type == 2)//delete
{
start_text_context();
text_context()->start_element(child_elm);
}
}
void odt_conversion_context::end_change (int id, int type)
{
if (!text_changes_state_.main_text_context) return;
std::wstring strId = L"ct" + std::to_wstring(id);
if (type == 2)//delete
{
text_context()->end_element();
end_text_context();
}
else
{
office_element_ptr end_elm;
create_element(L"text", L"change-end", end_elm, this);
text_add_change* change = dynamic_cast<text_add_change*>(end_elm.get());
if (change) change->text_change_id_ = strId;
text_changes_state_.main_text_context->start_element(end_elm);
text_changes_state_.main_text_context->end_element();
}
text_changes_state_.level--;
if (text_changes_state_.level < 1)
text_changes_state_.main_text_context = NULL;
}
//--------------------------------------------------------------------------------------------------------
void odt_conversion_context::start_image(const std::wstring & image_file_name)
{
std::wstring odf_ref_name ;
mediaitems()->add_or_find(image_file_name,_mediaitems::typeImage,odf_ref_name);
mediaitems()->add_or_find(image_file_name, _mediaitems::typeImage,odf_ref_name);
drawing_context()->start_image(odf_ref_name);
}
void odt_conversion_context::start_drop_cap(style_paragraph_properties *paragraph_properties)
{
if (drop_cap_state_.enabled) end_drop_cap(); // 2 подряд ваще возможны ???
if (drop_cap_state_.enabled)
end_drop_cap(); // 2 подряд ваще возможны ???
if (paragraph_properties == NULL) return;
......@@ -811,7 +916,7 @@ void odt_conversion_context::start_drop_cap(style_paragraph_properties *paragrap
drop_cap_state_.paragraph_properties = paragraph_properties;
office_element_ptr comm_elm;
create_element(L"style", L"drop-cap",drop_cap_state_.paragraph_properties->content().style_drop_cap_,this);
create_element(L"style", L"drop-cap", drop_cap_state_.paragraph_properties->content().style_drop_cap_, this);
}
void odt_conversion_context::set_drop_cap_lines(int lines)
......@@ -877,14 +982,14 @@ void odt_conversion_context::start_table(bool styled)
style_name = style_state->get_name();
}
}
text_context()->start_element(elm,style_elm,style_name);
text_context()->start_element(elm, style_elm, style_name);
add_to_root();
}
void odt_conversion_context::start_table_columns()
{
office_element_ptr elm;
create_element(L"table", L"table-columns",elm,this);
create_element(L"table", L"table-columns", elm, this);
text_context()->start_element(elm);
}
......
......@@ -79,39 +79,39 @@ public:
odf_comment_context * comment_context();
odf_table_context * table_context();
void start_drawings();
void end_drawings();
void start_drawings ();
void end_drawings ();
virtual void start_image(const std::wstring & image_file_name);
void add_text_content (const std::wstring & text);
void start_paragraph(bool styled = false);
void end_paragraph();
void start_paragraph (bool styled = false);
void end_paragraph ();
void add_page_break();
void add_paragraph_break(int type);
void start_hyperlink(std::wstring ref);
void end_hyperlink();
void start_hyperlink (std::wstring ref);
void end_hyperlink ();
void start_field(bool in_span);
void end_field();
void set_field_instr(std::wstring instr);
void start_field (bool in_span);
void end_field ();
void set_field_instr (std::wstring instr);
void start_run(bool styled = false);
void end_run();
void start_run (bool styled = false);
void end_run ();
void add_section(bool continuous);
void add_section_columns(int count, double space_pt, bool separator );
void add_section_column(std::vector<std::pair<double,double>> width_space);
int get_current_section_columns();
void flush_section();
void add_section (bool continuous);
void add_section_columns (int count, double space_pt, bool separator );
void add_section_column (std::vector<std::pair<double,double>> width_space);
int get_current_section_columns ();
void flush_section ();
void set_master_page_name(std::wstring master_name);
void start_drop_cap(style_paragraph_properties * paragraph_properties);
void set_drop_cap_lines(int lines);
void start_drop_cap (style_paragraph_properties * paragraph_properties);
void set_drop_cap_lines (int lines);
void set_drop_cap_margin(bool val);
void end_drop_cap();
void end_drop_cap ();
bool start_comment (int oox_comment_id);
void end_comment (int oox_comment_id);
......@@ -123,34 +123,37 @@ public:
void end_note_content ();
void end_note ();
void start_table(bool styled = false);
void start_table_columns();
void add_table_column(double width = -1);
void end_table_columns();
void start_change (int id, int type, std::wstring &author, std::wstring &userId, std::wstring &date);
void end_change (int id, int type);
void start_table (bool styled = false);
void start_table_columns ();
void add_table_column (double width = -1);
void end_table_columns ();
void start_table_header_rows();
void end_table_header_rows();
void start_table_row(bool styled = false);
void add_default_cell();
void start_table_cell(int col, bool covered, bool styled = false);
void end_table_cell();
void end_table_row();
void end_table();
void end_table_header_rows ();
void start_table_row (bool styled = false);
void add_default_cell ();
void start_table_cell (int col, bool covered, bool styled = false);
void end_table_cell ();
void end_table_row ();
void end_table ();
void start_list_item(int level, std::wstring style_name);
void end_list_item();
void start_list_item (int level, std::wstring style_name);
void end_list_item ();
void set_no_list();
bool is_empty_section(){return current_root_elements_.size() > 0 ? false : true; }
bool is_empty_section (){return current_root_elements_.size() > 0 ? false : true; }
bool start_header(int type);
bool start_footer(int type);
void end_header_footer();
bool start_header (int type);
bool start_footer (int type);
void end_header_footer ();
void add_empty_header(int type);
void add_empty_footer(int type);
void add_empty_header (int type);
void add_empty_footer (int type);
void set_background(_CP_OPT(color) & color, int type);
void set_background (_CP_OPT(color) & color, int type);
bool is_paragraph_in_current_section_;
......@@ -168,7 +171,7 @@ private:
bool is_footer_;
std::vector<odf_drawing_context_ptr> drawing_context_;
std::vector<odf_text_context_ptr> text_context_;//for embedded
std::vector<odf_text_context_ptr> text_context_; //for embedded
std::vector<odf_element_state> current_root_elements_; // for section, if needed
std::vector<odt_section_state> sections_;
......@@ -185,6 +188,12 @@ private:
bool in_span;
}current_field_;
struct _text_changes_state
{
odf_text_context *main_text_context;
int level;
}text_changes_state_;
bool is_hyperlink_;
struct _drop_cap_state
......@@ -199,8 +208,6 @@ private:
double characters_size_pt;
}drop_cap_state_;
};
......
......@@ -46,7 +46,7 @@ namespace cpdoccore {
namespace odf_writer {
// dc:date
/////////////////////////////////////////////
//-------------------------------------------------------------------------------------------------------------------
const wchar_t * dc_date::ns = L"dc";
const wchar_t * dc_date::name = L"date";
......@@ -65,7 +65,7 @@ void dc_date::serialize(std::wostream & _Wostream)
}
}
// dc:creator
///////////////////////////////////////////
//-------------------------------------------------------------------------------------------------------------------
const wchar_t * dc_creator::ns = L"dc";
const wchar_t * dc_creator::name = L"creator";
......@@ -83,7 +83,7 @@ void dc_creator::serialize(std::wostream & _Wostream)
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------------------------------------------------
void office_annotation_attr::serialize(CP_ATTR_NODE)
{
......@@ -103,11 +103,11 @@ void office_annotation_attr::serialize(CP_ATTR_NODE)
}
// office:annotation
//////////////////////////////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------------------------------------------------
const wchar_t * office_annotation::ns = L"office";
const wchar_t * office_annotation::name = L"annotation";
void office_annotation::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void office_annotation::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if (Ns==L"dc" && Name == L"date")
{
......@@ -165,11 +165,11 @@ void office_annotation::serialize(std::wostream & _Wostream)
}
}
// officeooo:annotation
//////////////////////////////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------------------------------------------------
const wchar_t * officeooo_annotation::ns = L"officeooo";
const wchar_t * officeooo_annotation::name = L"annotation";
void officeooo_annotation::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void officeooo_annotation::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (Ns==L"dc" && Name == L"date")
{
......
......@@ -61,15 +61,13 @@ public:
_CP_OPT(odf_types::length) caption_point_y_;
_CP_OPT(odf_types::length) caption_point_x_;
_CP_OPT(std::wstring) name_;
_CP_OPT(odf_types::Bool) display_;
_CP_OPT(odf_types::style_ref) draw_text_style_name_;
_CP_OPT(odf_types::style_ref) draw_style_name_;
_CP_OPT(std::wstring) name_;
};
/// \brief dc:date
class dc_date : public office_element_impl<dc_date>
{
public:
......@@ -79,8 +77,8 @@ public:
static const ElementType type = typeDcDate;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element ( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -91,7 +89,6 @@ public:
};
CP_REGISTER_OFFICE_ELEMENT2(dc_date);
/// \brief dc:creator
class dc_creator : public office_element_impl<dc_creator>
{
public:
......@@ -101,7 +98,7 @@ public:
static const ElementType type = typeDcCreator;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -113,7 +110,6 @@ public:
};
CP_REGISTER_OFFICE_ELEMENT2(dc_creator);
/// \brief office:annotation
class office_annotation : public office_element_impl<office_annotation>
{
public:
......@@ -123,7 +119,7 @@ public:
static const ElementType type = typeOfficeAnnotation;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -140,7 +136,6 @@ private:
};
CP_REGISTER_OFFICE_ELEMENT2(office_annotation);
/// \brief office:annotation-end
class office_annotation_end : public office_element_impl<office_annotation_end>
{
public:
......@@ -150,7 +145,7 @@ public:
static const ElementType type = typeOfficeAnnotationEnd;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -166,8 +161,8 @@ public:
};
CP_REGISTER_OFFICE_ELEMENT2(office_annotation_end);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//officeooo:annotation
//----------------------------------------------------------------------------------------------------------
class officeooo_annotation : public office_element_impl<officeooo_annotation>
{
public:
......@@ -177,15 +172,14 @@ public:
static const ElementType type = typeOfficeAnnotation;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
private:
office_element_ptr_array content_;
office_annotation_attr office_annotation_attr_;
office_element_ptr_array content_;
office_element_ptr dc_date_;
office_element_ptr dc_creator_;
......
......@@ -52,7 +52,7 @@ const wchar_t * office_body::name = L"body";
office_body::office_body()
{}
void office_body::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void office_body::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......
......@@ -44,7 +44,6 @@ namespace odf_writer {
class office_body;
typedef shared_ptr<office_body>::Type office_body_ptr;
/// \brief office:body
class office_body : public office_element_impl<office_body>
{
public:
......@@ -60,7 +59,7 @@ public:
public:
office_body();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -69,7 +68,6 @@ private:
office_element_ptr content_;
};
CP_REGISTER_OFFICE_ELEMENT2(office_body);
}
......
......@@ -50,7 +50,7 @@ namespace odf_writer {
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)
void office_chart::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -89,7 +89,7 @@ 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)
void chart_chart::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -127,7 +127,7 @@ 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)
void chart_title::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"text", L"p")
{
......@@ -157,7 +157,7 @@ void chart_title::add_child_element( const office_element_ptr & child_element)
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)
void chart_subtitle::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"text", L"p")
{
......@@ -186,7 +186,7 @@ void chart_subtitle::add_child_element( const office_element_ptr & child_element
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)
void chart_footer::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"text", L"p")
{
......@@ -259,7 +259,7 @@ void chart_plot_area_attlist::serialize(CP_ATTR_NODE)
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)
void chart_plot_area::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -336,7 +336,7 @@ void chart_axis_attlist::serialize(CP_ATTR_NODE)
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)
void chart_axis::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -415,7 +415,7 @@ void chart_series_attlist::serialize(CP_ATTR_NODE)
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)
void chart_series::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -512,7 +512,7 @@ void chart_error_indicator::serialize(std::wostream & _Wostream)
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)
void chart_regression_curve::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"chart", L"equation")
{
......
......@@ -53,7 +53,7 @@ public:
static const ElementType type = typeOfficeChart;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -96,7 +96,7 @@ public:
static const ElementType type = typeChartChart;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -128,7 +128,7 @@ public:
static const ElementType type = typeChartTitle;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -149,7 +149,7 @@ public:
static const ElementType type = typeChartSubtitle;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -171,7 +171,7 @@ public:
static const ElementType type = typeChartFooter;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -210,7 +210,7 @@ public:
static const ElementType type = typeChartLegend;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -249,7 +249,7 @@ public:
static const ElementType type = typeChartPlotArea;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -280,7 +280,7 @@ public:
static const ElementType type = typeChartWall;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -301,7 +301,7 @@ public:
static const ElementType type = typeChartFloor;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -332,7 +332,7 @@ public:
static const ElementType type = typeChartAxis;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -364,7 +364,7 @@ public:
static const ElementType type = typeChartGrid;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -385,7 +385,7 @@ public:
static const ElementType type = typeChartCategories;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -419,7 +419,7 @@ public:
static const ElementType type = typeChartSeries;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -441,7 +441,7 @@ public:
static const ElementType type = typeChartDomain;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -471,7 +471,7 @@ public:
static const ElementType type = typeChartDataPoint;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -492,7 +492,7 @@ public:
static const ElementType type = typeChartMeanValue;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -513,7 +513,7 @@ public:
static const ElementType type = typeChartErrorIndicator;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -533,7 +533,7 @@ public:
static const ElementType type = typeChartEquation;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}//???
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}//???
virtual void add_child_element( const office_element_ptr & child_element){}//???
virtual void serialize(std::wostream & _Wostream);
......@@ -555,7 +555,7 @@ public:
static const ElementType type = typeChartRegressionCurve;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -576,7 +576,7 @@ public:
static const ElementType type = typeChartStockGainMarker;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -597,7 +597,7 @@ public:
static const ElementType type = typeChartStockLossMarker;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -618,7 +618,7 @@ public:
static const ElementType type = typeChartStockRangeLine;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......
......@@ -75,13 +75,13 @@ public:
void set_root(bool root){is_root_ = root;}
////////////////////////
virtual ::std::wostream & serialize(::std::wostream & _Wostream) const
virtual std::wostream & serialize(std::wostream & _Wostream) const
{
_CP_LOG << L"[warning] use base text_to_stream\n";
return _Wostream;
}
virtual ::std::wostream & xml_to_stream(::std::wostream & _Wostream) const
virtual std::wostream & xml_to_stream(std::wostream & _Wostream) const
{
_CP_LOG << L"[warning] use base xml_to_stream\n";
return _Wostream;
......
......@@ -30,7 +30,6 @@
*
*/
#include "office_elements_create.h"
#include <iostream>
......@@ -45,7 +44,7 @@ office_element_creator::office_element_creator()
{
}
office_element_ptr office_element_creator::create(const ::std::wstring & ns, const ::std::wstring & name, odf_conversion_context * Context, bool isRoot) const
office_element_ptr office_element_creator::create(const std::wstring & ns, const std::wstring & name, odf_conversion_context * Context, bool isRoot) const
{
const std::wstring fullName = ns + (ns.size() > 0 ? L":" : L"") + name;
......@@ -124,8 +123,8 @@ void not_applicable_element(const office_element * CurrentElm, const std::wstrin
not_applicable_element(ss.str(), Ns, Name);
}
bool create_element(const ::std::wstring & Ns,
const ::std::wstring & Name,
bool create_element(const std::wstring & Ns,
const std::wstring & Name,
office_element_ptr & _Element,
odf_conversion_context * Context,
bool isRoot)
......@@ -149,8 +148,8 @@ bool create_element(const ::std::wstring & Ns,
return false;
}
bool create_element(const ::std::wstring & Ns,
const ::std::wstring & Name,
bool create_element(const std::wstring & Ns,
const std::wstring & Name,
office_element_ptr_array & _Elements,
odf_conversion_context * Context,
bool isRoot)
......
......@@ -64,10 +64,10 @@ public:
bool register_element(const std::wstring &ns, const std::wstring & name, CreateFuncImpl f);
// Создать элемент по имени
office_element_ptr create(const ::std::wstring & ns, const ::std::wstring & name, odf_conversion_context * Context = NULL, bool isRoot = false) const;
office_element_ptr create(const std::wstring & ns, const std::wstring & name, odf_conversion_context * Context = NULL, bool isRoot = false) const;
private:
typedef std::map<::std::wstring, CreateFuncImpl> MapType;
typedef std::map<std::wstring, CreateFuncImpl> MapType;
MapType map_;
public:
......@@ -120,8 +120,8 @@ bool create_element(const std::wstring & Ns,
odf_conversion_context * Context,
bool isRoot = false);
bool create_element(const ::std::wstring & Ns,
const ::std::wstring & Name,
bool create_element(const std::wstring & Ns,
const std::wstring & Name,
office_element_ptr_array & _Elements,
odf_conversion_context * Context,
bool isRoot = false);
......
......@@ -88,6 +88,18 @@ enum ElementType
typeTextIndexTitle,
typeTextIndexBody,
typeTextTrackedChanges,
typeTextChangedRegion,
typeTextChangeStart,
typeTextChangeEnd,
typeTextChange,
typeOfficeChangeInfo,
typeTextUnknownChange,
typeTextDeletion,
typeTextFormatChange,
typeTextInsertion,
typeTextNumberedParagraph,
typeDrawA,
......@@ -188,6 +200,16 @@ enum ElementType
typeTableTableRowGroup,
typeTableTableRowNoGroup,
typeTableShapes,
typeTableCalculationSettings,
typeTableNullDate,
typeTableTrackedChanges,
typeTableChangeTrackTableCell,
typeTableCellContentChange,
typeTableDeletion,
typeTablePrevious,
typeOfficeBody,
typeOfficeText,
typeOfficeDocument,
......@@ -278,8 +300,7 @@ enum ElementType
typeScriptEventListener,
typeTableCalculationSettings,
typeTableNullDate,
typeNumberNumberStyle,
typeNumberDataStyle,
......@@ -303,7 +324,6 @@ enum ElementType
typeNumberMinutes,
typeNumberSeconds,
typeNumberAmPm,
typeTableShapes,
typeChartChart,
typeChartTitle,
......
......@@ -45,7 +45,7 @@ namespace odf_writer {
const wchar_t * office_settings::ns = L"office";
const wchar_t * office_settings::name = L"settings";
void office_settings::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void office_settings::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -73,7 +73,7 @@ void office_settings::add_child_element( const office_element_ptr & child_elemen
const wchar_t * settings_config_item_set::ns = L"config";
const wchar_t * settings_config_item_set::name = L"config-item-set";
void settings_config_item_set::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void settings_config_item_set::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -104,7 +104,7 @@ void settings_config_item_set::add_child_element( const office_element_ptr & chi
const wchar_t * settings_config_item::ns = L"config";
const wchar_t * settings_config_item::name = L"config-item";
void settings_config_item::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void settings_config_item::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
}
......@@ -132,7 +132,7 @@ const wchar_t * settings_config_item_map_indexed::ns = L"config";
const wchar_t * settings_config_item_map_indexed::name = L"config-item-map-indexed";
void settings_config_item_map_indexed::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void settings_config_item_map_indexed::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -161,7 +161,7 @@ void settings_config_item_map_indexed::add_child_element( const office_element_p
const wchar_t * settings_config_item_map_named::ns = L"config";
const wchar_t * settings_config_item_map_named::name = L"config-item-map-named";
void settings_config_item_map_named::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void settings_config_item_map_named::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......@@ -190,7 +190,7 @@ void settings_config_item_map_named::add_child_element( const office_element_ptr
const wchar_t * settings_config_item_map_entry::ns = L"config";
const wchar_t * settings_config_item_map_entry::name = L"config-item-map-entry";
void settings_config_item_map_entry::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void settings_config_item_map_entry::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......
......@@ -53,7 +53,7 @@ public:
static const ElementType type = typeOfficeSettings;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -73,7 +73,7 @@ public:
static const ElementType type = typeOfficeSettingsConfigItemSet;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -93,7 +93,7 @@ public:
static const ElementType type = typeOfficeSettingsConfigItem;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -114,7 +114,7 @@ public:
static const ElementType type = typeOfficeSettingsConfigItemMapIndexed;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -134,7 +134,7 @@ public:
static const ElementType type = typeOfficeSettingsConfigItemMapNamed;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -154,7 +154,7 @@ public:
static const ElementType type = typeOfficeSettingsConfigItemMapEntry;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......
......@@ -44,12 +44,11 @@
namespace cpdoccore {
namespace odf_writer {
// office:spreadsheet
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * office_spreadsheet::ns = L"office";
const wchar_t * office_spreadsheet::name = L"spreadsheet";
void office_spreadsheet::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void office_spreadsheet::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
......
......@@ -56,7 +56,7 @@ public:
office_element_ptr_array & getContent(){return content_;}
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......
......@@ -67,8 +67,6 @@ bool is_text_content(const std::wstring & ns, const std::wstring & name)
name == L"user-index" ||
name == L"alphabetical-index" ||
name == L"bibliography" ||
// change-marks
name == L"change" ||
name == L"change-start" ||
name == L"change-end"
......@@ -92,19 +90,40 @@ void office_text_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"text:use-soft-page-breaks", text_use_soft_page_breaks_);
}
void office_text::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void office_text::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (is_text_content(Ns, Name))
{
CP_CREATE_ELEMENT(content_);
}
else if CP_CHECK_NAME(L"text", L"tracked-changes")
{
CP_CREATE_ELEMENT(tracked_changes_);
}
else
CP_NOT_APPLICABLE_ELM();
}
void office_text::add_child_element( const office_element_ptr & child_element)
{
if (!child_element) return;
switch(child_element->get_type())
{
case typeTextTrackedChanges:
{
tracked_changes_ = child_element;
}break;
case typeTextChangedRegion:
{
if (!tracked_changes_)
create_child_element(L"text", L"tracked-changes");
tracked_changes_->add_child_element(child_element);
}break;
default:
content_.push_back(child_element);
}
}
void office_text::serialize(std::wostream & _Wostream)
{
......@@ -114,10 +133,49 @@ void office_text::serialize(std::wostream & _Wostream)
{
office_text_attlist_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(office_element_ptr & elm, content_)
if (tracked_changes_)
tracked_changes_->serialize(CP_XML_STREAM());
for (int i = 0; i < content_.size(); i++)
{
content_[i]->serialize(CP_XML_STREAM());
}
}
}
}
// office:change-info
//-------------------------------------------------------------------------------------------------------------------
const wchar_t * office_change_info::ns = L"office";
const wchar_t * office_change_info::name = L"change-info";
void office_change_info::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (Ns==L"dc" && Name == L"date")
{
elm->serialize(CP_XML_STREAM());
CP_CREATE_ELEMENT(dc_date_);
}
else if (Ns==L"dc" && Name == L"creator")
{
CP_CREATE_ELEMENT(dc_creator_);
}
}
void office_change_info::add_child_element( const office_element_ptr & child_element)
{
ElementType type = child_element->get_type();
if (type == typeDcCreator)
dc_creator_ = child_element;
else if (type == typeDcDate)
dc_date_ = child_element;
}
void office_change_info::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
if (dc_creator_)dc_creator_->serialize (CP_XML_STREAM());
if (dc_date_) dc_date_->serialize (CP_XML_STREAM());
}
}
}
......
......@@ -45,7 +45,6 @@
namespace cpdoccore {
namespace odf_writer {
//office_text_attlist
class office_text_attlist
{
public:
......@@ -54,7 +53,6 @@ public:
void serialize(CP_ATTR_NODE);
};
/// \brief office:text
class office_text : public office_element_impl<office_text>
{
public:
......@@ -64,33 +62,49 @@ public:
static const ElementType type = typeOfficeText;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
// virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
// virtual void add_child_element(const xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
// virtual void add_text(const std::wstring & Text);
office_text_attlist office_text_attlist_;
private:
bool text_global_;
office_element_ptr tracked_changes_;
office_element_ptr_array content_;
// TODO: office-text-content-prelude:
// TODO: office-forms
// TODO: text-tracked-changes
// TODO: text-decls
// TODO: table-decls
office_element_ptr_array content_;
// TODO: text-page-sequence
// TODO: office-text-content-epilogue:
// TODO: table-functions
};
CP_REGISTER_OFFICE_ELEMENT2(office_text)
//-------------------------------------------------------------------------------------
class office_change_info : public office_element_impl<office_change_info>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeChangeInfo;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
private:
office_element_ptr dc_date_;
office_element_ptr dc_creator_;
};
CP_REGISTER_OFFICE_ELEMENT2(office_change_info)
CP_REGISTER_OFFICE_ELEMENT2(office_text)
}
}
......
......@@ -133,7 +133,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}
virtual void serialize(std::wostream & strm);
......
......@@ -161,7 +161,7 @@ public:
graphic_format_properties & content(){ return graphic_format_properties_; }
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}
virtual void serialize(std::wostream & strm);
......
......@@ -50,7 +50,7 @@ namespace odf_writer {
const wchar_t * style_map::ns = L"style";
const wchar_t * style_map::name = L"map";
void style_map::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_map::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
......
......@@ -54,7 +54,7 @@ public:
static const ElementType type = typeStyleMap;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm){}
std::wstring style_condition_;
......
......@@ -159,7 +159,7 @@ void style_page_layout_properties_attlist::serialize(CP_ATTR_NODE)
const wchar_t * style_page_layout_properties::ns = L"style";
const wchar_t * style_page_layout_properties::name = L"page-layout-properties";
void style_page_layout_properties::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_page_layout_properties::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
style_page_layout_properties_elements_.create_child_element( Ns, Name, getContext());
}
......@@ -182,7 +182,7 @@ void style_page_layout_properties::serialize(std::wostream & strm)
}
//////////////////////////////////////////////////////////////////////////////////////////////////
void style_page_layout_properties_elements::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context )
void style_page_layout_properties_elements::create_child_element( const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context )
{
if (L"style" == Ns && L"background-image" == Name)
{
......
......@@ -103,7 +103,7 @@ public:
class style_page_layout_properties_elements
{
public:
void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context);
void create_child_element( const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context);
void add_child_element( const office_element_ptr & child);
void serialize(std::wostream & strm);
......@@ -125,7 +125,7 @@ public:
style_page_layout_properties() { }
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......
......@@ -137,7 +137,7 @@ void style_background_image::serialize(std::wostream & strm)
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////
void paragraph_format_properties::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name,odf_conversion_context * Context)
void paragraph_format_properties::create_child_element(const std::wstring & Ns, const std::wstring & Name,odf_conversion_context * Context)
{
if (L"style" == Ns)
{
......@@ -251,7 +251,7 @@ void paragraph_format_properties::serialize(std::wostream & _Wostream ,const wch
const wchar_t * style_paragraph_properties::ns = L"style";
const wchar_t * style_paragraph_properties::name = L"paragraph-properties";
void style_paragraph_properties::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void style_paragraph_properties::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
style_paragraph_properties_content_.create_child_element(Ns, Name, getContext());
}
......
......@@ -86,7 +86,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}
virtual void serialize(std::wostream & strm);
......@@ -119,7 +119,7 @@ public:
size_t size() const { return style_tab_stops_.size(); }
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -140,7 +140,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}
virtual void serialize(std::wostream & strm);
......@@ -165,7 +165,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}
virtual void serialize(std::wostream & strm);
......@@ -185,7 +185,7 @@ CP_REGISTER_OFFICE_ELEMENT2(style_background_image)
class paragraph_format_properties
{
public:
void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name,odf_conversion_context * Context);
void create_child_element(const std::wstring & Ns, const std::wstring & Name,odf_conversion_context * Context);
void add_child_element( const office_element_ptr & child);
void serialize(std::wostream & strm, const wchar_t * ns, const wchar_t * name );
......@@ -270,7 +270,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
void apply_from(style_paragraph_properties * Other);
......
......@@ -53,7 +53,7 @@ namespace odf_writer {
const wchar_t * style_columns::ns = L"style";
const wchar_t * style_columns::name = L"columns";
void style_columns::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_columns::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (L"style" == Ns && L"column" == Name)
CP_CREATE_ELEMENT(style_column_);
......@@ -103,7 +103,7 @@ void style_columns::serialize(std::wostream & strm)
const wchar_t * style_column::ns = L"style";
const wchar_t * style_column::name = L"column";
void style_column::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_column::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
......@@ -127,7 +127,7 @@ void style_column::serialize(std::wostream & strm)
const wchar_t * style_column_sep::ns = L"style";
const wchar_t * style_column_sep::name = L"column-sep";
void style_column_sep::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_column_sep::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
......@@ -151,7 +151,7 @@ void style_column_sep::serialize(std::wostream & strm)
const wchar_t * style_section_properties::ns = L"style";
const wchar_t * style_section_properties::name = L"section-properties";
void style_section_properties::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_section_properties::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (L"style" == Ns && L"background-image" == Name)
CP_CREATE_ELEMENT(style_background_image_);
......
......@@ -55,7 +55,7 @@ public:
static const ElementType type = typeStyleColumns;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -80,7 +80,7 @@ public:
static const ElementType type = typeStyleColumn;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child){}
virtual void serialize(std::wostream & strm);
......@@ -104,7 +104,7 @@ public:
static const ElementType type = typeStyleColumnSep;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child){}
virtual void serialize(std::wostream & strm);
......@@ -128,7 +128,7 @@ public:
static const ElementType type = typeStyleSectionProperties;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......
......@@ -45,7 +45,7 @@ namespace odf_writer {
using xml::xml_char_wc;
bool table_format_properties::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context)
bool table_format_properties::create_child_element(const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context)
{
if (L"style" == Ns && L"background-image" == Name)
{
......@@ -118,7 +118,7 @@ const wchar_t * style_table_properties::ns = L"style";
const wchar_t * style_table_properties::name = L"table-properties";
void style_table_properties::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void style_table_properties::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
table_format_properties_.create_child_element(Ns, Name, getContext());
}
......@@ -157,7 +157,7 @@ void style_table_column_properties_attlist::serialize(std::wostream & _Wostream,
const wchar_t * style_table_column_properties::ns = L"style";
const wchar_t * style_table_column_properties::name = L"table-column-properties";
void style_table_column_properties::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_table_column_properties::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
......@@ -173,7 +173,7 @@ void style_table_column_properties::serialize(std::wostream & strm)
const wchar_t * style_table_cell_properties::ns = L"style";
const wchar_t * style_table_cell_properties::name = L"table-cell-properties";
void style_table_cell_properties::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_table_cell_properties::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (L"style" == Ns && L"background-image" == Name)
{
......@@ -281,7 +281,7 @@ const wchar_t * style_table_row_properties::ns = L"style";
const wchar_t * style_table_row_properties::name = L"table-row-properties";
void style_table_row_properties::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_table_row_properties::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (L"style" == Ns && L"background-image" == Name)
{
......
......@@ -60,7 +60,7 @@ namespace odf_writer {
class table_format_properties
{
public:
bool create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context);
bool create_child_element( const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context);
void apply_from(const table_format_properties & Other);
void serialize(std::wostream & strm ,const wchar_t * ns, const wchar_t * name );
......@@ -89,7 +89,7 @@ public:
};
/// style:table-properties
// style:table-properties
class style_table_properties : public office_element_impl<style_table_properties>
{
......@@ -101,7 +101,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child){}
void apply_from(const style_table_properties * Other);
......@@ -127,7 +127,7 @@ public:
};
/// style:table-column-properties
// style:table-column-properties
class style_table_column_properties : public office_element_impl<style_table_column_properties>
{
public:
......@@ -138,7 +138,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
style_table_column_properties_attlist style_table_column_properties_attlist_;
......@@ -161,7 +161,7 @@ public:
odf_types::common_break_attlist common_break_attlist_;
};
/// style:table-row-properties
// style:table-row-properties
class style_table_row_properties : public office_element_impl<style_table_row_properties>
{
public:
......@@ -172,7 +172,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
public:
......@@ -225,7 +225,6 @@ public:
class style_table_cell_properties_elements
{
public:
// 15.11.6
office_element_ptr style_background_image_;
};
......@@ -241,7 +240,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
void apply_from(const style_table_cell_properties * Other);
virtual void serialize(std::wostream & strm);
......
......@@ -387,7 +387,7 @@ void text_format_properties_content::serialize(std::wostream & _Wostream,const w
const wchar_t * style_text_properties::ns = L"style";
const wchar_t * style_text_properties::name = L"text-properties";
void style_text_properties::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void style_text_properties::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
......
......@@ -211,7 +211,7 @@ public:
void apply_from(const style_text_properties * Other);
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child){}
virtual void serialize(std::wostream & strm);
......
......@@ -163,7 +163,7 @@ void style_content::add_child_element( const office_element_ptr & child)
}
}
void style_content::create_child_element( const std::wstring & Ns, const ::std::wstring & Name)
void style_content::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"style", L"text-properties")
{
......@@ -231,7 +231,7 @@ const wchar_t * default_style::ns = L"style";
const wchar_t * default_style::name = L"default-style";
void default_style::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void default_style::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
style_content_.create_child_element(Ns, Name);
}
......@@ -254,7 +254,7 @@ void default_style::serialize(std::wostream & strm)
const wchar_t * draw_fill_image::ns = L"draw";
const wchar_t * draw_fill_image::name = L"fill-image";
void draw_fill_image::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void draw_fill_image::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
......@@ -275,7 +275,7 @@ void draw_fill_image::serialize(std::wostream & strm)
const wchar_t * draw_marker::ns = L"draw";
const wchar_t * draw_marker::name = L"marker";
void draw_marker::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void draw_marker::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
......@@ -297,7 +297,7 @@ void draw_marker::serialize(std::wostream & strm)
const wchar_t * draw_gradient::ns = L"draw";
const wchar_t * draw_gradient::name = L"gradient";
void draw_gradient::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void draw_gradient::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
......@@ -329,7 +329,7 @@ void draw_gradient::serialize(std::wostream & strm)
const wchar_t * draw_hatch::ns = L"draw";
const wchar_t * draw_hatch::name = L"hatch";
void draw_hatch::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void draw_hatch::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
......@@ -354,7 +354,7 @@ void draw_hatch::serialize(std::wostream & strm)
const wchar_t * draw_opacity::ns = L"draw";
const wchar_t * draw_opacity::name = L"opacity";
void draw_opacity::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void draw_opacity::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
......@@ -384,7 +384,7 @@ void draw_opacity::serialize(std::wostream & strm)
const wchar_t * style::ns = L"style";
const wchar_t * style::name = L"style";
void style::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"style", L"map")
{
......@@ -432,7 +432,7 @@ void style::serialize(std::wostream & strm)
// styles & draw_styles
//////////////////////////////////////////////////////////////////////////////////////////////////
void styles::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context)
void styles::create_child_element( const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context)
{
if CP_CHECK_NAME(L"style", L"style")
{
......@@ -497,7 +497,7 @@ void styles::serialize(std::wostream & strm)//content from different element
elm->serialize(strm);
}
}
void templates::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context)
void templates::create_child_element( const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context)
{
if CP_CHECK_NAME(L"table", L"table-template")
{
......@@ -522,7 +522,7 @@ void templates::serialize(std::wostream & strm)
elm->serialize(strm);
}
}
void draw_styles::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context)
void draw_styles::create_child_element(const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context)
{
if CP_CHECK_NAME(L"draw", L"gradient")
{
......@@ -603,7 +603,7 @@ void draw_styles::serialize(std::wostream & strm)
const wchar_t * office_automatic_styles::ns = L"office";
const wchar_t * office_automatic_styles::name = L"automatic-styles";
void office_automatic_styles::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void office_automatic_styles::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (L"style" == Ns && L"page-layout" == Name)
{
......@@ -661,7 +661,7 @@ void style_master_page_attlist::serialize(CP_ATTR_NODE)
const wchar_t * office_master_styles::ns = L"office";
const wchar_t * office_master_styles::name = L"master-styles";
void office_master_styles::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void office_master_styles::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (L"style" == Ns && L"master-page" == Name)
CP_CREATE_ELEMENT(style_master_page_);
......@@ -721,7 +721,7 @@ const wchar_t * office_styles::ns = L"office";
const wchar_t * office_styles::name = L"styles";
void office_styles::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void office_styles::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (CP_CHECK_NAME(L"style", L"style") ||
CP_CHECK_NAME(L"text", L"list-style") ||
......@@ -833,13 +833,13 @@ void office_styles::serialize(std::wostream & strm)
const wchar_t * style_header::ns = L"style";
const wchar_t * style_header::name = L"header";
void style_header::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_header::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
content().header_footer_content_.create_child_element( Ns, Name, getContext());
}
void style_header::add_child_element( const office_element_ptr & child)
{
content().header_footer_content_.add_child_element( child);
content().header_footer_content_.add_child_element( child, getContext());
}
void style_header::serialize(std::wostream & strm)
{
......@@ -856,13 +856,13 @@ const wchar_t * style_footer::ns = L"style";
const wchar_t * style_footer::name = L"footer";
void style_footer::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_footer::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
content().header_footer_content_.create_child_element(Ns, Name, getContext());
}
void style_footer::add_child_element( const office_element_ptr & child)
{
content().header_footer_content_.add_child_element( child);
content().header_footer_content_.add_child_element( child, getContext());
}
void style_footer::serialize(std::wostream & strm)
{
......@@ -878,13 +878,13 @@ void style_footer::serialize(std::wostream & strm)
const wchar_t * style_header_first::ns = L"style";
const wchar_t * style_header_first::name = L"header-first";
void style_header_first::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void style_header_first::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
content().header_footer_content_.create_child_element(Ns, Name, getContext());
}
void style_header_first::add_child_element( const office_element_ptr & child)
{
content().header_footer_content_.add_child_element(child);
content().header_footer_content_.add_child_element(child, getContext());
}
void style_header_first::serialize(std::wostream & strm)
{
......@@ -900,13 +900,13 @@ void style_header_first::serialize(std::wostream & strm)
const wchar_t * style_footer_first::ns = L"style";
const wchar_t * style_footer_first::name = L"footer-first";
void style_footer_first::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_footer_first::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
content().header_footer_content_.create_child_element( Ns, Name, getContext());
}
void style_footer_first::add_child_element( const office_element_ptr & child)
{
content().header_footer_content_.add_child_element( child);
content().header_footer_content_.add_child_element( child, getContext());
}
void style_footer_first::serialize(std::wostream & strm)
{
......@@ -922,13 +922,13 @@ void style_footer_first::serialize(std::wostream & strm)
const wchar_t * style_header_left::ns = L"style";
const wchar_t * style_header_left::name = L"header-left";
void style_header_left::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void style_header_left::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
content().header_footer_content_.create_child_element( Ns, Name, getContext());
}
void style_header_left::add_child_element( const office_element_ptr & child)
{
content().header_footer_content_.add_child_element( child);
content().header_footer_content_.add_child_element( child, getContext());
}
void style_header_left::serialize(std::wostream & strm)
......@@ -945,13 +945,13 @@ void style_header_left::serialize(std::wostream & strm)
const wchar_t * style_footer_left::ns = L"style";
const wchar_t * style_footer_left::name = L"footer-left";
void style_footer_left::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_footer_left::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
content().header_footer_content_.create_child_element( Ns, Name, getContext());
}
void style_footer_left::add_child_element( const office_element_ptr & child)
{
content().header_footer_content_.add_child_element(child);
content().header_footer_content_.add_child_element(child, getContext());
}
void style_footer_left::serialize(std::wostream & strm)
{
......@@ -969,7 +969,7 @@ void style_footer_left::serialize(std::wostream & strm)
const wchar_t * style_header_style::ns = L"style";
const wchar_t * style_header_style::name = L"header-style";
void style_header_style::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void style_header_style::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if (L"style" == Ns && L"header-footer-properties" == Name)
{
......@@ -1005,7 +1005,7 @@ void style_header_style::serialize(std::wostream & strm)
const wchar_t * style_footer_style::ns = L"style";
const wchar_t * style_footer_style::name = L"footer-style";
void style_footer_style::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_footer_style::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (L"style" == Ns && L"header-footer-properties" == Name)
{
......@@ -1046,7 +1046,7 @@ void style_page_layout_attlist::serialize(CP_ATTR_NODE)
const wchar_t * style_page_layout::ns = L"style";
const wchar_t * style_page_layout::name = L"page-layout";
void style_page_layout::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_page_layout::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (L"style" == Ns && L"header-style" == Name)
{
......@@ -1114,7 +1114,7 @@ void style_footnote_sep_attlist::serialize(CP_ATTR_NODE)
const wchar_t * style_footnote_sep::ns = L"style";
const wchar_t * style_footnote_sep::name = L"footnote-sep";
void style_footnote_sep::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_footnote_sep::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
......@@ -1136,7 +1136,7 @@ void style_footnote_sep::serialize(std::wostream & strm)
const wchar_t * style_master_page::ns = L"style";
const wchar_t * style_master_page::name = L"master-page";
void style_master_page::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void style_master_page::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if (L"style" == Ns && L"header" == Name)
CP_CREATE_ELEMENT(style_header_);
......@@ -1265,7 +1265,7 @@ int style_master_page::find_placeHolderIndex(presentation_class::type placeHolde
const wchar_t * text_notes_configuration::ns = L"text";
const wchar_t * text_notes_configuration::name = L"notes-configuration";
void text_notes_configuration::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void text_notes_configuration::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"text", L"note-continuation-notice-forward")
CP_CREATE_ELEMENT(text_note_continuation_notice_forward_);
......@@ -1280,7 +1280,7 @@ void text_notes_configuration::create_child_element(const ::std::wstring & Ns, c
const wchar_t * style_presentation_page_layout::ns = L"style";
const wchar_t * style_presentation_page_layout::name = L"presentation-page-layout";
void style_presentation_page_layout::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_presentation_page_layout::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (L"presentation" == Ns && L"placeholder" == Name)
{
......
......@@ -88,7 +88,7 @@ class style_content : noncopyable
public:
style_content(odf_conversion_context * _context){Context = _context;}
void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
void create_child_element( const std::wstring & Ns, const std::wstring & Name);
void add_child_element( const office_element_ptr & child);
void serialize(std::wostream & strm);
......@@ -121,8 +121,6 @@ private:
};
/// \class default_style
/// style:default-style
class default_style : public office_element_impl<default_style>
{
public:
......@@ -135,7 +133,7 @@ public:
public:
default_style() : style_content_(getContext()) {}
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -148,8 +146,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(default_style)
/////////////////////////////////////////////////////////////////////////////////////////////////
/// \class style_draw_gradient
//----------------------------------------------------------------------------------------------------
class draw_gradient : public office_element_impl<draw_gradient>
{
public:
......@@ -178,13 +175,13 @@ public:
_CP_OPT(std::wstring) draw_name_;
_CP_OPT(std::wstring) draw_display_name_;
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
};
CP_REGISTER_OFFICE_ELEMENT2(draw_gradient)
/////////////////////////////////////////////////////////////////////////////////////////////////
/// \class style_draw_hatch
//----------------------------------------------------------------------------------------------------
class draw_hatch : public office_element_impl<draw_hatch>
{
public:
......@@ -205,13 +202,13 @@ public:
_CP_OPT(std::wstring) draw_name_;
_CP_OPT(std::wstring) draw_display_name_;
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
};
CP_REGISTER_OFFICE_ELEMENT2(draw_hatch)
/////////////////////////////////////////////////////////////////////////////////////////////////
/// \class style_draw_gradient
//----------------------------------------------------------------------------------------------------
class draw_opacity : public office_element_impl<draw_opacity>
{
public:
......@@ -238,13 +235,13 @@ public:
_CP_OPT(std::wstring) draw_name_;
_CP_OPT(std::wstring) draw_display_name_;
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
};
CP_REGISTER_OFFICE_ELEMENT2(draw_opacity)
/// \class style_draw_fill_image
//----------------------------------------------------------------------------------------------------
class draw_fill_image : public office_element_impl<draw_fill_image>
{
public:
......@@ -262,12 +259,12 @@ public:
_CP_OPT(std::wstring) draw_name_;
_CP_OPT(std::wstring) draw_display_name_;
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
};
CP_REGISTER_OFFICE_ELEMENT2(draw_fill_image)
/// \class style_draw_marker
//----------------------------------------------------------------------------------------------------
class draw_marker : public office_element_impl<draw_marker>
{
public:
......@@ -286,18 +283,18 @@ public:
_CP_OPT(std::wstring) draw_name_;
_CP_OPT(std::wstring) draw_display_name_;
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
};
CP_REGISTER_OFFICE_ELEMENT2(draw_marker)
/////////////////////////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------------------------------------------------
class style;
typedef shared_ptr<style>::Type style_ptr;
typedef weak_ptr<style>::Type style_weak_ptr;
typedef ::std::vector< style_weak_ptr > style_weak_ptr_array;
typedef ::std::vector< style_ptr > style_ptr_array;
typedef std::vector< style_weak_ptr > style_weak_ptr_array;
typedef std::vector< style_ptr > style_ptr_array;
/// style:style
class style : public office_element_impl<style>
{
public:
......@@ -309,7 +306,7 @@ public:
style() : style_content_(getContext()) {}
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -336,11 +333,11 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style)
/// \class styles
//----------------------------------------------------------------------------------------------------
class styles
{
public:
void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context);
void create_child_element(const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context);
void add_child_element( const office_element_ptr & child, odf_conversion_context * Context);
void serialize(std::wostream & strm);
......@@ -361,7 +358,7 @@ public:
class draw_styles
{
public:
void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context);
void create_child_element(const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context);
void add_child_element( const office_element_ptr & child, odf_conversion_context * Context);
void serialize(std::wostream & strm);
......@@ -381,7 +378,7 @@ public:
class templates
{
public:
void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context);
void create_child_element(const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context);
void add_child_element( const office_element_ptr & child);
void serialize(std::wostream & strm);
......@@ -390,8 +387,6 @@ public:
};
/// \class office_automatic_styles
/// \brief office:automatic-styles
class office_automatic_styles : public office_element_impl<office_automatic_styles>
{
public:
......@@ -401,7 +396,7 @@ public:
static const ElementType type = typeOfficeAutomaticStyles;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -412,8 +407,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(office_automatic_styles)
/// \class office_master_styles
/// \brief office:master-styles
//----------------------------------------------------------------------------------------------------
class office_master_styles : public office_element_impl<office_master_styles>
{
public:
......@@ -423,7 +417,7 @@ public:
static const ElementType type = typeOfficeMasterStyles;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -438,8 +432,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(office_master_styles)
/// \class class style_master_page_attlist
/// \brief style-master-page-attlist
//----------------------------------------------------------------------------------------------------
class style_master_page_attlist
{
public:
......@@ -453,8 +446,8 @@ public:
_CP_OPT(odf_types::style_ref) style_next_style_name_;
};
/// \class style_master_page
/// \brief style:master-page
//----------------------------------------------------------------------------------------------------
class style_master_page;
typedef boost::shared_ptr<style_master_page> style_master_page_ptr;
......@@ -467,7 +460,7 @@ public:
static const ElementType type = typeStyleMasterPage;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -493,8 +486,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_master_page)
/// \class office_styles
/// \brief office:styles
//----------------------------------------------------------------------------------------------------
class office_styles : public office_element_impl<office_styles>
{
public:
......@@ -504,7 +496,7 @@ public:
static const ElementType type = typeOfficeStyles;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -525,6 +517,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(office_styles)
//----------------------------------------------------------------------------------------------------
class header_footer_content_common
{
public:
......@@ -544,7 +537,7 @@ private:
};
/// style:header
//----------------------------------------------------------------------------------------------------
class style_header : public office_element_impl<style_header>, public header_footer_common
{
public:
......@@ -554,7 +547,7 @@ public:
static const ElementType type = typeStyleHeader;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -564,7 +557,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_header)
/// style:footer
//----------------------------------------------------------------------------------------------------
class style_footer : public office_element_impl<style_footer>, public header_footer_common
{
public:
......@@ -576,7 +569,7 @@ public:
virtual void serialize(std::wostream & strm);
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
header_footer_content_common content_;
......@@ -585,7 +578,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_footer)
/// style:header-first
//----------------------------------------------------------------------------------------------------
class style_header_first : public office_element_impl<style_header_first>, public header_footer_common
{
public:
......@@ -597,7 +590,7 @@ public:
virtual void serialize(std::wostream & strm);
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
header_footer_content_common content_;
......@@ -605,7 +598,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_header_first)
/// style:footer_first
//----------------------------------------------------------------------------------------------------
class style_footer_first : public office_element_impl<style_footer_first>, public header_footer_common
{
public:
......@@ -615,7 +608,7 @@ public:
static const ElementType type = typeStyleFooterFirst;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -625,7 +618,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_footer_first)
/// style:header-left
//----------------------------------------------------------------------------------------------------
class style_header_left : public office_element_impl<style_header_left>, public header_footer_common
{
public:
......@@ -635,7 +628,7 @@ public:
static const ElementType type = typeStyleHeaderLeft;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -645,7 +638,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_header_left)
/// style:footer-left
//----------------------------------------------------------------------------------------------------
class style_footer_left : public office_element_impl<style_footer_left>, public header_footer_common
{
public:
......@@ -655,7 +648,7 @@ public:
static const ElementType type = typeStyleFooterLeft;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -665,7 +658,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_footer_left)
/// style:page-layout-attlist
//----------------------------------------------------------------------------------------------------
class style_page_layout_attlist
{
public:
......@@ -676,7 +669,7 @@ public:
};
/// style:header-style
//----------------------------------------------------------------------------------------------------
class style_header_style : public office_element_impl<style_header_style>
{
public:
......@@ -686,7 +679,7 @@ public:
static const ElementType type = typeStyleHeaderStyle;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -697,8 +690,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_header_style)
/// style:footer-style
//----------------------------------------------------------------------------------------------------
class style_footer_style : public office_element_impl<style_footer_style>
{
public:
......@@ -708,7 +700,7 @@ public:
static const ElementType type = typeStyleFooterStyle;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -718,7 +710,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_footer_style)
/// style:page-layout
//----------------------------------------------------------------------------------------------------
class style_page_layout : public office_element_impl<style_page_layout>
{
public:
......@@ -734,7 +726,7 @@ public:
office_element_ptr style_header_style_;
office_element_ptr style_footer_style_;
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
virtual void serialize(std::wostream & strm);
......@@ -742,7 +734,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_page_layout)
// style:footnote-sep-attlist
//----------------------------------------------------------------------------------------------------
class style_footnote_sep_attlist
{
public:
......@@ -758,7 +750,7 @@ public:
};
// style:footnote-sep
//----------------------------------------------------------------------------------------------------
class style_footnote_sep : public office_element_impl<style_footnote_sep>
{
public:
......@@ -768,7 +760,7 @@ public:
static const ElementType type = typeStyleFootnoteSep;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
style_footnote_sep_attlist style_footnote_sep_attlist_;
......@@ -777,8 +769,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_footnote_sep)
// text:notes-configuration
//----------------------------------------------------------------------------------------------------
class text_notes_configuration : public office_element_impl<text_notes_configuration>
{
public:
......@@ -788,7 +779,7 @@ public:
static const ElementType type = typeTextNotesConfiguration;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm){}
odf_types::noteclass noteclass_;
......@@ -809,8 +800,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(text_notes_configuration)
/// style:presentation-page-layout
//----------------------------------------------------------------------------------------------------
class style_presentation_page_layout;
typedef boost::shared_ptr<style_presentation_page_layout> style_presentation_page_layout_ptr;
......@@ -824,7 +814,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE()
virtual void serialize(std::wostream & strm){}
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
_CP_OPT(std::wstring) style_name_;
......@@ -832,5 +822,8 @@ public:
};
CP_REGISTER_OFFICE_ELEMENT2(style_presentation_page_layout)
} // namespace odf_writer
} // namespace cpdoccore
//----------------------------------------------------------------------------------------------------
}
}
......@@ -31,10 +31,6 @@
*/
#include "styles_list.h"
//#include "style_text_properties.h"
#include <cpdoccore/xml/simple_xml_writer.h>
namespace cpdoccore {
......@@ -85,7 +81,7 @@ const wchar_t * text_list_style::ns = L"text";
const wchar_t * text_list_style::name = L"list-style";
void text_list_style::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void text_list_style::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (L"text" == Ns && L"list-level-style-number" == Name)
CP_CREATE_ELEMENT(text_list_style_content_);
......@@ -124,7 +120,7 @@ const wchar_t * text_list_level_style_number::ns = L"text";
const wchar_t * text_list_level_style_number::name = L"list-level-style-number";
void text_list_level_style_number::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void text_list_level_style_number::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if (L"style" == Ns && L"list-level-properties" == Name)
CP_CREATE_ELEMENT(style_list_level_properties_);
......@@ -166,7 +162,7 @@ void text_list_level_style_number::serialize(std::wostream & strm)
const wchar_t * style_list_level_properties::ns = L"style";
const wchar_t * style_list_level_properties::name = L"list-level-properties";
void style_list_level_properties::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_list_level_properties::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"style", L"list-level-label-alignment")
{
......@@ -217,7 +213,7 @@ void style_list_level_properties::serialize(std::wostream & strm)
const wchar_t * style_list_level_label_alignment::ns = L"style";
const wchar_t * style_list_level_label_alignment::name = L"list-level-label-alignment";
void style_list_level_label_alignment::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void style_list_level_label_alignment::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
......@@ -246,7 +242,7 @@ const wchar_t * text_list_level_style_bullet::ns = L"text";
const wchar_t * text_list_level_style_bullet::name = L"list-level-style-bullet";
void text_list_level_style_bullet::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void text_list_level_style_bullet::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (L"style" == Ns && L"list-level-properties" == Name)
CP_CREATE_ELEMENT(style_list_level_properties_);
......@@ -290,7 +286,7 @@ const wchar_t * text_list_level_style_image::ns = L"text";
const wchar_t * text_list_level_style_image::name = L"list-level-style-image";
void text_list_level_style_image::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void text_list_level_style_image::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (L"style" == Ns && L"list-level-properties" == Name)
CP_CREATE_ELEMENT(style_list_level_properties_);
......
......@@ -124,7 +124,7 @@ void table_table_column_attlist::serialize(CP_ATTR_NODE)
const wchar_t * table_table_source::ns = L"table";
const wchar_t * table_table_source::name = L"table-source";
void table_table_source::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void table_table_source::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
......@@ -148,7 +148,7 @@ void table_table_source::serialize(std::wostream & _Wostream)
const wchar_t * table_table::ns = L"table";
const wchar_t * table_table::name = L"table";
void table_table::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void table_table::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if (L"table" == Ns && L"table-source" == Name)
{
......@@ -243,7 +243,7 @@ void table_table::serialize(std::wostream & _Wostream)
const wchar_t * table_table_column::ns = L"table";
const wchar_t * table_table_column::name = L"table-column";
void table_table_column::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void table_table_column::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
......@@ -266,7 +266,7 @@ void table_table_column::serialize(std::wostream & _Wostream)
const wchar_t * table_table_columns::ns = L"table";
const wchar_t * table_table_columns::name = L"table-columns";
void table_table_columns::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void table_table_columns::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"table", L"table-column")
{
......@@ -301,7 +301,7 @@ void table_table_columns::serialize(std::wostream & _Wostream)
const wchar_t * table_table_header_columns::ns = L"table";
const wchar_t * table_table_header_columns::name = L"table-header-columns";
void table_table_header_columns::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void table_table_header_columns::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"table", L"table-column")
{
......@@ -333,7 +333,7 @@ void table_table_header_columns::serialize(std::wostream & _Wostream)
// table-columns
//////////////////////////////////////////////////////////////////////////////////////////////////
void table_columns::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context)
void table_columns::create_child_element( const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context)
{
if CP_CHECK_NAME(L"table", L"table-columns")
{
......@@ -380,7 +380,7 @@ table_columns_no_group::table_columns_no_group(odf_conversion_context * _Context
Context = _Context;
};
void table_columns_no_group::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void table_columns_no_group::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (CP_CHECK_NAME(L"table", L"table-columns") || CP_CHECK_NAME(L"table", L"table-column"))
{
......@@ -440,7 +440,7 @@ _CP_PTR(table_columns_no_group) table_columns_no_group::create(odf_conversion_co
const wchar_t * table_table_column_group::ns = L"table";
const wchar_t * table_table_column_group::name = L"table-column-group";
void table_table_column_group::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void table_table_column_group::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
table_columns_and_groups_.create_child_element(Ns, Name, getContext());
}
......@@ -468,7 +468,7 @@ table_columns_and_groups::table_columns_and_groups()
}
void table_columns_and_groups::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context)
void table_columns_and_groups::create_child_element(const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context)
{
if (CP_CHECK_NAME(L"table", L"table-column-group"))
{
......@@ -519,7 +519,7 @@ void table_columns_and_groups::serialize(std::wostream & _Wostream)
// table-table-cell-content
//////////////////////////////////////////////////////////////////////////////////////////////////
void table_table_cell_content::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context)
void table_table_cell_content::create_child_element( const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context)
{
CP_CREATE_ELEMENT_SIMPLE(text_content_);
}
......@@ -540,7 +540,7 @@ void table_table_cell_content::serialize(std::wostream & _Wostream)
const wchar_t * table_table_cell::ns = L"table";
const wchar_t * table_table_cell::name = L"table-cell";
void table_table_cell::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void table_table_cell::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
table_table_cell_content_.create_child_element(Ns, Name, getContext());
}
......@@ -568,7 +568,7 @@ void table_table_cell::serialize(std::wostream & _Wostream)
const wchar_t * table_covered_table_cell::ns = L"table";
const wchar_t * table_covered_table_cell::name = L"covered-table-cell";
void table_covered_table_cell::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void table_covered_table_cell::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
empty_ = false;
table_table_cell_content_.create_child_element( Ns, Name, getContext());
......@@ -596,7 +596,7 @@ void table_covered_table_cell::serialize(std::wostream & _Wostream)
const wchar_t * table_table_row::ns = L"table";
const wchar_t * table_table_row::name = L"table-row";
void table_table_row::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void table_table_row::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if ( CP_CHECK_NAME(L"table", L"table-cell") ||
CP_CHECK_NAME(L"table", L"table-covered-cell") )
......@@ -634,7 +634,7 @@ void table_table_row::serialize(std::wostream & _Wostream)
const wchar_t * table_table_rows::ns = L"table";
const wchar_t * table_table_rows::name = L"table-rows";
void table_table_rows::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void table_table_rows::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(table_table_row_);
}
......@@ -661,7 +661,7 @@ void table_table_rows::serialize(std::wostream & _Wostream)
const wchar_t * table_table_header_rows::ns = L"table";
const wchar_t * table_table_header_rows::name = L"table-header-rows";
void table_table_header_rows::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void table_table_header_rows::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"table", L"table-row")
{
......@@ -692,7 +692,7 @@ void table_table_header_rows::serialize(std::wostream & _Wostream)
}
// table-rows
//////////////////////////////////////////////////////////////////////////////////////////////////
void table_rows::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context)
void table_rows::create_child_element(const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context)
{
if CP_CHECK_NAME(L"table", L"table-rows")
{
......@@ -742,7 +742,7 @@ table_rows_no_group::table_rows_no_group(odf_conversion_context * _Context) : wa
Context = _Context;
};
void table_rows_no_group::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void table_rows_no_group::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (CP_CHECK_NAME(L"table", L"table-rows") || CP_CHECK_NAME(L"table", L"table-row"))
{
......@@ -799,7 +799,7 @@ table_rows_and_groups::table_rows_and_groups()
{
}
void table_rows_and_groups::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context)
void table_rows_and_groups::create_child_element( const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context)
{
if (L"table" == Ns && L"table-row-group" == Name)
{
......@@ -843,7 +843,7 @@ const wchar_t * table_table_row_group::ns = L"table";
const wchar_t * table_table_row_group::name = L"table-row-group";
void table_table_row_group::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void table_table_row_group::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
table_rows_and_groups_.create_child_element(Ns, Name, getContext());
}
......@@ -873,7 +873,7 @@ void table_table_row_group::add_child_element( const office_element_ptr & child_
const wchar_t * table_shapes::ns = L"table";
const wchar_t * table_shapes::name = L"shapes";
void table_shapes::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void table_shapes::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
create_element(Ns,Name,content_,getContext());
}
......
......@@ -168,7 +168,7 @@ public:
table_table_source_attlist table_table_source_attlist_;
table_linked_source_attlist table_linked_source_attlist_;
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -181,7 +181,7 @@ CP_REGISTER_OFFICE_ELEMENT2(table_table_source);
class table_columns
{
public:
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -207,7 +207,7 @@ public:
public:
table_columns_no_group(odf_conversion_context * _Context);
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name/*, odf_conversion_context * Context*/);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name/*, odf_conversion_context * Context*/);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -232,7 +232,7 @@ class table_columns_and_groups
public:
table_columns_and_groups();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context);
virtual void add_child_element( const office_element_ptr & child_element, odf_conversion_context * Context);
virtual void serialize(std::wostream & _Wostream);
......@@ -271,7 +271,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -296,7 +296,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -320,7 +320,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -353,7 +353,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -382,7 +382,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -399,7 +399,7 @@ CP_REGISTER_OFFICE_ELEMENT2(table_table_row);
class table_table_cell_content
{
public:
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -425,7 +425,7 @@ public:
table_table_cell() { }
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -453,7 +453,7 @@ public:
table_covered_table_cell() {empty_ = true; }
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -479,7 +479,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -507,7 +507,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -523,7 +523,7 @@ CP_REGISTER_OFFICE_ELEMENT2(table_table_header_rows);
class table_rows
{
public:
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -550,7 +550,7 @@ public:
public:
table_rows_no_group(odf_conversion_context * Context);
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -573,7 +573,7 @@ class table_rows_and_groups
public:
table_rows_and_groups();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context);
virtual void add_child_element( const office_element_ptr & child_element, odf_conversion_context * Context);
virtual void serialize(std::wostream & _Wostream);
......@@ -609,7 +609,7 @@ public:
table_table_row_group()
{
}
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -634,7 +634,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -667,7 +667,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......
......@@ -51,7 +51,7 @@ using xml::xml_char_wc;
const wchar_t * table_database_ranges::ns = L"table";
const wchar_t * table_database_ranges::name = L"database-ranges";
void table_database_ranges::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void table_database_ranges::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"table", L"database-range")
{
......
......@@ -55,7 +55,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -77,7 +77,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......
......@@ -51,7 +51,7 @@ using xml::xml_char_wc;
const wchar_t * table_named_expressions::ns = L"table";
const wchar_t * table_named_expressions::name = L"named-expressions";
void table_named_expressions::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
void table_named_expressions::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"table", L"named-range")
{
......
......@@ -53,7 +53,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -76,7 +76,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -103,7 +103,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......
......@@ -57,7 +57,7 @@ namespace odf_writer {
using xml::xml_char_wc;
// text:h
//////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------------------------------
const wchar_t * text_h::ns = L"text";
const wchar_t * text_h::name = L"h";
......@@ -86,7 +86,6 @@ void paragraph::serialize(std::wostream & _Wostream)
void paragraph::serialize_attr(CP_ATTR_NODE)
{
paragraph_attrs_.serialize(CP_GET_XML_NODE());
}
void paragraph_attrs::serialize(CP_ATTR_NODE)
......@@ -100,7 +99,8 @@ void paragraph_attrs::serialize(CP_ATTR_NODE)
{
text_class_names_all = elm.style_name() + std::wstring(L" ");
}
if (text_class_names_all.length()>0)
if (!text_class_names_all.empty())
CP_XML_ATTR(L"text:class-names", text_class_names_all);
}
//////////////////////////////////////////////
......@@ -115,10 +115,10 @@ void text_h::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR(L"text:outline-level", text_outline_level_);
CP_XML_ATTR(L"text:restart-numbering", text_restart_numbering_);
CP_XML_ATTR_OPT(L"text:start-value", text_start_value_);
CP_XML_ATTR(L"text:is-list-header", text_is_list_header_);
CP_XML_ATTR (L"text:outline-level", text_outline_level_);
CP_XML_ATTR (L"text:restart-numbering", text_restart_numbering_);
CP_XML_ATTR_OPT (L"text:start-value", text_start_value_);
CP_XML_ATTR (L"text:is-list-header", text_is_list_header_);
paragraph_.serialize_attr (CP_GET_XML_NODE());
paragraph_.serialize (CP_XML_STREAM());
......@@ -140,7 +140,7 @@ void text_h::add_child_element( const office_element_ptr & child_element)
paragraph_.add_child_element(child_element);
}
// text:p
//////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------------------------------
const wchar_t * text_p::ns = L"text";
const wchar_t * text_p::name = L"p";
......@@ -171,7 +171,7 @@ void text_p::serialize(std::wostream & _Wostream)
// text:list
//////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------------------------------
const wchar_t * text_list::ns = L"text";
const wchar_t * text_list::name = L"list";
......@@ -215,7 +215,7 @@ void text_list::add_child_element( const office_element_ptr & child_element)
text_list_items_.push_back(child_element);
}
// text:soft-page-break
//////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------------------------------
const wchar_t * text_soft_page_break::ns = L"text";
const wchar_t * text_soft_page_break::name = L"soft-page-break";
......@@ -228,33 +228,27 @@ void text_soft_page_break::serialize(std::wostream & _Wostream)
}
// text-section-attr
//////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------------------------------
void text_section_attr::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"text:style-name", text_style_name_);
CP_XML_ATTR(L"text:name", text_name_);
CP_XML_ATTR_OPT(L"text:protected", text_protected_);
CP_XML_ATTR_OPT(L"text:protection-key", text_protection_key_);
CP_XML_ATTR_OPT(L"text:display", text_display_);
CP_XML_ATTR_OPT(L"text:condition", text_condition_);
CP_XML_ATTR_OPT (L"text:style-name", text_style_name_);
CP_XML_ATTR (L"text:name", text_name_);
CP_XML_ATTR_OPT (L"text:protected", text_protected_);
CP_XML_ATTR_OPT (L"text:protection-key", text_protection_key_);
CP_XML_ATTR_OPT (L"text:display", text_display_);
CP_XML_ATTR_OPT (L"text:condition", text_condition_);
}
// text:section
//////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------------------------------
const wchar_t * text_section::ns = L"text";
const wchar_t * text_section::name = L"section";
void text_section::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
if (L"text" == Ns && L"section-source" == Name)
{
CP_CREATE_ELEMENT(text_section_source_);
}
else
{
CP_CREATE_ELEMENT(text_content_);
}
if (L"text" == Ns && L"section-source" == Name) CP_CREATE_ELEMENT(text_section_source_);
else CP_CREATE_ELEMENT(content_);
}
void text_section::add_child_element( const office_element_ptr & child_element)
......@@ -264,7 +258,7 @@ void text_section::add_child_element( const office_element_ptr & child_element)
if (type == typeTextSectionSource)
text_section_source_ = child_element;
else
text_content_.push_back(child_element);
content_.push_back(child_element);
}
void text_section::serialize(std::wostream & _Wostream)
......@@ -275,18 +269,19 @@ void text_section::serialize(std::wostream & _Wostream)
{
text_section_attr_.serialize(CP_GET_XML_NODE());
if (text_section_source_)text_section_source_->serialize(CP_XML_STREAM());
if (text_section_source_)
text_section_source_->serialize(CP_XML_STREAM());
BOOST_FOREACH(const office_element_ptr & elm, text_content_)
for (int i = 0 ; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
}
// text-section-source-attr
//////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------------------------------
void text_section_source_attr::serialize(CP_ATTR_NODE)
{
......@@ -297,7 +292,7 @@ void text_section_source_attr::serialize(CP_ATTR_NODE)
}
// text:section-source
//////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------------------------------
const wchar_t * text_section_source::ns = L"text";
const wchar_t * text_section_source::name = L"section-source";
......@@ -316,7 +311,7 @@ void text_section_source::serialize(std::wostream & _Wostream)
}
}
// text:index-body
//////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------------------------------
const wchar_t * text_index_body::ns = L"text";
const wchar_t * text_index_body::name = L"index-body";
......@@ -326,9 +321,9 @@ void text_index_body::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & listItem, index_content_main_)
for (int i = 0 ; i < index_content_main_.size(); i++)
{
listItem->serialize(CP_XML_STREAM());
index_content_main_[i]->serialize(CP_XML_STREAM());
}
}
}
......@@ -345,7 +340,7 @@ void text_index_body::add_child_element( const office_element_ptr & child_elemen
}
// text:index-title
//////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------------------------------
const wchar_t * text_index_title::ns = L"text";
const wchar_t * text_index_title::name = L"index-title";
......@@ -355,9 +350,9 @@ void text_index_title::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & listItem, index_content_main_)
for (int i = 0 ; i < index_content_main_.size(); i++)
{
listItem->serialize(CP_XML_STREAM());
index_content_main_[i]->serialize(CP_XML_STREAM());
}
}
}
......@@ -372,7 +367,7 @@ void text_index_title::add_child_element( const office_element_ptr & child_eleme
}
// text:table-of-content
//////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------------------------------
const wchar_t * text_table_of_content::ns = L"text";
const wchar_t * text_table_of_content::name = L"table-of-content";
......@@ -383,8 +378,12 @@ void text_table_of_content::serialize(std::wostream & _Wostream)
CP_XML_NODE_SIMPLE()
{
text_section_attr_.serialize(CP_GET_XML_NODE());
if (text_index_body_)text_index_body_->serialize(CP_XML_STREAM());
if (text_table_of_content_source_)text_table_of_content_source_->serialize(CP_XML_STREAM());
if (text_index_body_)
text_index_body_->serialize(CP_XML_STREAM());
if (text_table_of_content_source_)
text_table_of_content_source_->serialize(CP_XML_STREAM());
}
}
}
......@@ -398,11 +397,214 @@ void text_table_of_content::create_child_element( const std::wstring & Ns, const
void text_table_of_content::add_child_element( const office_element_ptr & child_element)
{
//if CP_CHECK_NAME(L"text", L"index-body")
{
text_index_body_ = child_element;
}
//--------------------------------------------------------------------------------------------------------
// text:tracked-changes
//--------------------------------------------------------------------------------------------------------
const wchar_t * text_tracked_changes::ns = L"text";
const wchar_t * text_tracked_changes::name = L"tracked-changes";
void text_tracked_changes::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"text", L"index-body")
{
CP_CREATE_ELEMENT(content_);
}
}
void text_tracked_changes::add_child_element( const office_element_ptr & child_element)
{
content_.push_back(child_element);
}
void text_tracked_changes::serialize(std::wostream & _Wostream)
{
if (content_.empty()) return;
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
for (int i = 0 ; i < content_.size(); i++)
{
content_[i]->serialize (CP_XML_STREAM());
}
}
}
}
//---------------------------------------------------------------------------------------------------
const wchar_t * text_insertion::ns = L"text";
const wchar_t * text_insertion::name = L"insertion";
void text_insertion::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
if (office_change_info_)
office_change_info_->serialize(CP_XML_STREAM());
for (int i = 0 ; i < content_.size(); i++)
{
content_[i]->serialize(CP_XML_STREAM());
}
}
}
}
//---------------------------------------------------------------------------------------------------
const wchar_t * text_deletion::ns = L"text";
const wchar_t * text_deletion::name = L"deletion";
void text_deletion::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
if (office_change_info_)
office_change_info_->serialize(CP_XML_STREAM());
for (int i = 0 ; i < content_.size(); i++)
{
content_[i]->serialize(CP_XML_STREAM());
}
}
}
}
//---------------------------------------------------------------------------------------------------
const wchar_t * text_format_change::ns = L"text";
const wchar_t * text_format_change::name = L"format-change";
void text_format_change::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
if (office_change_info_)
office_change_info_->serialize(CP_XML_STREAM());
for (int i = 0 ; i < content_.size(); i++)
{
content_[i]->serialize(CP_XML_STREAM());
}
}
}
}
//----------------------------------------------------------------------------------------------------------
const wchar_t * text_unknown_change::ns = L"text";
const wchar_t * text_unknown_change::name = L"UnknownChange";
void text_unknown_change::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if (L"office" == Ns && L"change-info" == Name) CP_CREATE_ELEMENT(office_change_info_);
else CP_CREATE_ELEMENT(content_);
}
void text_unknown_change::add_child_element( const office_element_ptr & child_element)
{
ElementType type = child_element->get_type();
if (type == typeOfficeChangeInfo)
office_change_info_= child_element;
else
content_.push_back(child_element);
}
void text_unknown_change::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
if (office_change_info_)
office_change_info_->serialize(CP_XML_STREAM());
for (int i = 0 ; i < content_.size(); i++)
{
content_[i]->serialize(CP_XML_STREAM());
}
}
}
}
//---------------------------------------------------------------------------------------------------
const wchar_t * text_add_change::ns = L"text";
const wchar_t * text_add_change::name = L"unknown-change-mark";
//---------------------------------------------------------------------------------------------------
const wchar_t * text_change::ns = L"text";
const wchar_t * text_change::name = L"change";
void text_change::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"text:change-id", text_change_id_);
}
}
}
//------------------------------------------------------------------------------------------
const wchar_t * text_change_start::ns = L"text";
const wchar_t * text_change_start::name = L"change-start";
void text_change_start::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"text:change-id", text_change_id_);
}
}
}
//------------------------------------------------------------------------------------------
const wchar_t * text_change_end::ns = L"text";
const wchar_t * text_change_end::name = L"change-end";
void text_change_end::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"text:change-id", text_change_id_);
}
}
}
//---------------------------------------------------------------------------------------------------
const wchar_t * text_changed_region::ns = L"text";
const wchar_t * text_changed_region::name = L"changed-region";
void text_changed_region::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(element_);
}
void text_changed_region::add_child_element( const office_element_ptr & child_element)
{
element_ = child_element;
}
void text_changed_region::serialize(std::wostream & _Wostream)
{
if (!element_) return;
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"xml:id", text_id_);
CP_XML_ATTR_OPT(L"text:id", text_id_);
element_->serialize (CP_XML_STREAM());
}
}
}
}
}
......@@ -40,6 +40,7 @@
#include "office_elements_create.h"
#include "common_attlists.h"
#include "Bool.h"
#include "style_ref.h"
#include "textdisplay.h"
......@@ -69,7 +70,7 @@ public:
void add_text(const std::wstring & Text);
void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name,odf_conversion_context * context);
void create_child_element(const std::wstring & Ns, const std::wstring & Name,odf_conversion_context * context);
void add_child_element( const office_element_ptr & child_element);
void serialize (std::wostream & _Wostream);
......@@ -81,8 +82,8 @@ public:
};
// text:h
//////////////////////////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------------------------------
class text_h : public office_element_impl<text_h>
{
public:
......@@ -92,7 +93,7 @@ public:
static const ElementType type = typeTextH;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -115,8 +116,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(text_h);
// text:p
//////////////////////////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------------------------------
class text_p : public office_element_impl<text_p>
{
public:
......@@ -126,7 +126,7 @@ public:
static const ElementType type = typeTextP;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -139,8 +139,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(text_p);
// text:list
//////////////////////////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------------------------------
class text_list : public office_element_impl<text_list>
{
public:
......@@ -154,7 +153,7 @@ public:
text_list(){};
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -169,8 +168,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(text_list);
// text:soft-page-break
//////////////////////////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------------------------------
class text_soft_page_break : public office_element_impl<text_soft_page_break>
{
public:
......@@ -180,7 +178,7 @@ public:
static const ElementType type = typeTextSoftPageBreak;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
......@@ -195,14 +193,13 @@ public:
std::wstring text_name_;
_CP_OPT(bool) text_protected_;
_CP_OPT(std::wstring) text_protection_key_;
_CP_OPT(odf_types::text_display) text_display_;
_CP_OPT(odf_types::text_display)text_display_;
_CP_OPT(std::wstring) text_condition_;
void serialize(CP_ATTR_NODE);
};
// text:section
//////////////////////////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------------------------------
class text_section : public office_element_impl<text_section>
{
public:
......@@ -212,7 +209,7 @@ public:
static const ElementType type = typeTextSection;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -220,13 +217,12 @@ public:
text_section_attr text_section_attr_;
office_element_ptr text_section_source_;
office_element_ptr_array text_content_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_section);
// text-section-source-attr
class text_section_source_attr
{
public:
......@@ -240,9 +236,7 @@ public:
void serialize(CP_ATTR_NODE);
};
// text:section-source
// text-section-source
//////////////////////////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------------------------------
class text_section_source : public office_element_impl<text_section_source>
{
public:
......@@ -252,20 +246,16 @@ public:
static const ElementType type = typeTextSectionSource;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
text_section_source_attr text_section_source_attr_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_section_source);
// text:table-of-content
// text-table-of-content
//////////////////////////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------------------------------
class text_table_of_content : public office_element_impl<text_table_of_content>
{
public:
......@@ -276,7 +266,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -285,14 +275,11 @@ public:
office_element_ptr text_table_of_content_source_;
office_element_ptr text_index_body_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_table_of_content);
// text:index-body
// text-index-body
//////////////////////////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------------------------------
class text_index_body : public office_element_impl<text_index_body>
{
public:
......@@ -302,7 +289,7 @@ public:
static const ElementType type = typeTextIndexBody;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -313,9 +300,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(text_index_body);
// text:index-title
// text-index-title
//////////////////////////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------------------------------
class text_index_title : public office_element_impl<text_index_title>
{
public:
......@@ -325,7 +310,7 @@ public:
static const ElementType type = typeTextIndexTitle;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
......@@ -334,9 +319,169 @@ public:
office_element_ptr_array index_content_main_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_index_title);
//---------------------------------------------------------------------------------------------------
class text_unknown_change : public office_element_impl<text_unknown_change>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextUnknownChange;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element (const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element ( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
office_element_ptr office_change_info_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_unknown_change);
//---------------------------------------------------------------------------------------------------
class text_insertion : public text_unknown_change
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextInsertion;
virtual void serialize(std::wostream & _Wostream);
};
CP_REGISTER_OFFICE_ELEMENT2(text_insertion);
//---------------------------------------------------------------------------------------------------
class text_deletion : public text_unknown_change
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextDeletion;
virtual void serialize(std::wostream & _Wostream);
};
CP_REGISTER_OFFICE_ELEMENT2(text_deletion);
//---------------------------------------------------------------------------------------------------
class text_format_change : public text_unknown_change
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextFormatChange;
virtual void serialize(std::wostream & _Wostream);
};
CP_REGISTER_OFFICE_ELEMENT2(text_format_change);
//---------------------------------------------------------------------------------------------------
class text_tracked_changes : public office_element_impl<text_tracked_changes>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTrackedChanges;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element (const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element ( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
_CP_OPT(odf_types::Bool) text_track_changes_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_tracked_changes);
//---------------------------------------------------------------------------------------------------
class text_changed_region : public office_element_impl<text_changed_region>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextChangedRegion;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element (const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element ( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
_CP_OPT(std::wstring) text_id_; //== xml:id
office_element_ptr element_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_changed_region);
//---------------------------------------------------------------------------------------------------
class text_add_change : public office_element_impl<text_add_change>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextChange;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element (const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element ( const office_element_ptr & child_element) {}
virtual void serialize(std::wostream & _Wostream) = 0;
_CP_OPT(std::wstring) text_change_id_;
};
//---------------------------------------------------------------------------------------------------
class text_change : public text_add_change
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextChange;
virtual void serialize(std::wostream & _Wostream);
};
CP_REGISTER_OFFICE_ELEMENT2(text_change);
//---------------------------------------------------------------------------------------------------
class text_change_start : public text_add_change
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextChangeStart;
virtual void serialize(std::wostream & _Wostream);
};
CP_REGISTER_OFFICE_ELEMENT2(text_change_start);
//---------------------------------------------------------------------------------------------------
class text_change_end : public text_add_change
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextChangeEnd;
virtual void serialize(std::wostream & _Wostream);
};
CP_REGISTER_OFFICE_ELEMENT2(text_change_end);
//---------------------------------------------------------------------------------------------------
}
}
......@@ -273,6 +273,11 @@ void DocxConverter::convert(OOX::WritingElement *oox_unknown)
OOX::Logic::CIns* pIns= static_cast<OOX::Logic::CIns*>(oox_unknown);
convert(pIns);
}break;
case OOX::et_w_del:
{
OOX::Logic::CDel* pDel= static_cast<OOX::Logic::CDel*>(oox_unknown);
convert(pDel);
}break;
case OOX::et_w_smartTag:
{
OOX::Logic::CSmartTag* pTag= static_cast<OOX::Logic::CSmartTag*>(oox_unknown);
......@@ -529,6 +534,7 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph)
}
if (empty_para) return;
}
if (bStartNewParagraph)
{
odt_context->start_paragraph(bStyled);
......@@ -539,6 +545,12 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph)
odt_context->page_layout_context()->last_master()->get_name() : L"");
}
}
int id_change_properties = -1;
if (oox_paragraph->m_oParagraphProperty)
id_change_properties = convert(oox_paragraph->m_oParagraphProperty->m_oPPrChange.GetPointer());
for (unsigned int nIndex = 0; nIndex < oox_paragraph->m_arrItems.size(); nIndex++ )
{
//те элементы которые тока для Paragraph - здесь - остальные в общей куче
......@@ -553,6 +565,8 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph)
break;
}
}
if (id_change_properties >= 0)
odt_context->end_change(id_change_properties, 3); //todooo change int type to enum
if (odt_context->text_context()->get_KeepNextParagraph()) odt_context->end_drop_cap();
......@@ -562,9 +576,6 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph)
{
odt_context->end_list_item();
}
}
void DocxConverter::convert(OOX::Logic::CRun *oox_run)//wordprocessing 22.1.2.87 math 17.3.2.25
{
......@@ -592,6 +603,10 @@ void DocxConverter::convert(OOX::Logic::CRun *oox_run)//wordprocessing 22.1.2.87
odt_context->start_run(styled);
int id_change_properties = -1;
if (oox_run->m_oRunProperty)
id_change_properties = convert(oox_run->m_oRunProperty->m_oRPrChange.GetPointer());
for(unsigned int i = 0; i < oox_run->m_arrItems.size(); ++i)
{
//те элементы которые тока для Run - здесь - остальные в общей куче
......@@ -607,13 +622,16 @@ void DocxConverter::convert(OOX::Logic::CRun *oox_run)//wordprocessing 22.1.2.87
OOX::Logic::CInstrText* pInstrText= static_cast<OOX::Logic::CInstrText*>(oox_run->m_arrItems[i]);
convert(pInstrText);
}break;
case OOX::et_w_rPr:
case OOX::et_w_delText:
{
// пропускаем ..
OOX::Logic::CDelText* pDelText= static_cast<OOX::Logic::CDelText*>(oox_run->m_arrItems[i]);
convert(pDelText);
}break;
case OOX::et_w_lastRenderedPageBreak:
case OOX::et_w_rPr: // пропускаем ..
{
}break;
case OOX::et_w_lastRenderedPageBreak: // не информативное .. может быть неверно записано
{
//odt_context->add_page_break();
}break;
case OOX::et_w_br:
{
......@@ -622,10 +640,10 @@ void DocxConverter::convert(OOX::Logic::CRun *oox_run)//wordprocessing 22.1.2.87
{
int type = pBr->m_oType.GetValue();
if (type == 1)
odt_context->add_page_break();
else
odt_context->text_context()->set_type_break(type, pBr->m_oClear.GetValue());
bool need_restart_para = odt_context->text_context()->set_type_break(type, pBr->m_oClear.GetValue());
if (need_restart_para)
odt_context->add_paragraph_break(type);
}
}break;
case OOX::et_w_t:
......@@ -641,26 +659,18 @@ void DocxConverter::convert(OOX::Logic::CRun *oox_run)//wordprocessing 22.1.2.87
case OOX::et_w_tab:
{
OOX::Logic::CTab* pTab= static_cast<OOX::Logic::CTab*>(oox_run->m_arrItems[i]);
_CP_OPT(int) ref;
odt_context->text_context()->add_tab(ref);
}break;
case OOX::et_w_delText:
{
odt_context->text_context()->add_tab();
}break;
case OOX::et_w_separator:
case OOX::et_w_continuationSeparator:
{
}break;
//annotationRef
//endnoteRef
//footnoteRef
//contentPart
//cr
//dayLong, dayShort, monthLong, monthShort, yearLong, yearShort
//delText
//noBreakHyphen
//pgNum
//ptab
//ruby
//softHyphen
//delInstrText
......@@ -670,6 +680,7 @@ void DocxConverter::convert(OOX::Logic::CRun *oox_run)//wordprocessing 22.1.2.87
}
odt_context->end_run();
}
void DocxConverter::convert(OOX::Logic::CPTab *oox_ptab)
{
if (oox_ptab == NULL) return;
......@@ -758,37 +769,210 @@ void DocxConverter::convert(OOX::Logic::CFldSimple *oox_fld)
//SimpleTypes::COnOff<SimpleTypes::onoffFalse> m_oFldLock;
odt_context->start_field(true);
if (oox_fld->m_sInstr.IsInit()) odt_context->set_field_instr(string2std_string(oox_fld->m_sInstr.get2()));
{
if (oox_fld->m_sInstr.IsInit())
odt_context->set_field_instr(string2std_string(oox_fld->m_sInstr.get2()));
for (unsigned int i=0; i< oox_fld->m_arrItems.size(); i++)
{
convert(oox_fld->m_arrItems[i]);
}
}
odt_context->end_field();
}
void DocxConverter::convert(OOX::Logic::CInstrText *oox_instr)
void DocxConverter::convert(OOX::Logic::CInstrText *oox_instrText)
{
if (oox_instr == NULL) return;
if (oox_instrText == NULL) return;
odt_context->set_field_instr(string2std_string(oox_instr->m_sText));
odt_context->set_field_instr(string2std_string(oox_instrText->m_sText));
}
void DocxConverter::convert(OOX::Logic::CDelText *oox_delText)
{
if (oox_delText == NULL) return;
if (oox_delText->m_oSpace.IsInit())
{
if (oox_delText->m_oSpace->GetValue() == SimpleTypes::xmlspacePreserve)
{
}
//odt_context->text_context()->add_text_space(26);
}
odt_context->add_text_content(string2std_string(oox_delText->m_sText));
}
void DocxConverter::convert(OOX::Logic::CIns *oox_ins)
{
if (oox_ins == NULL) return;
//текст-вставка авторский
//todooo сделать должную организацию text:change-start -> text:change-end c трейсером Abortion.docx
//Abortion.docx
std::wstring author = oox_ins->m_sAuthor.IsInit() ? oox_ins->m_sAuthor.get2() : L"";
std::wstring userId = oox_ins->m_sUserId.IsInit() ? oox_ins->m_sUserId.get2() : L"";
int id = oox_ins->m_oId.IsInit() ? oox_ins->m_oId->GetValue() : -1;
std::wstring date = oox_ins->m_oDate.IsInit() ? oox_ins->m_oDate->GetValue() : L"";
odt_context->start_change(id, 1, author, userId, date);
for (unsigned int i=0; i< oox_ins->m_arrItems.size(); i++)
{
convert(oox_ins->m_arrItems[i]);
}
odt_context->end_change(id, 1);
}
int DocxConverter::convert(OOX::Logic::CSectPrChange *oox_sect_prop_change)
{
if (!oox_sect_prop_change) return -1;
std::wstring author = oox_sect_prop_change->m_sAuthor.IsInit() ? oox_sect_prop_change->m_sAuthor.get2() : L"";
std::wstring userId = oox_sect_prop_change->m_sUserId.IsInit() ? oox_sect_prop_change->m_sUserId.get2() : L"";
int id = oox_sect_prop_change->m_oId.IsInit() ? oox_sect_prop_change->m_oId->GetValue() : -1;
std::wstring date = oox_sect_prop_change->m_oDate.IsInit() ? oox_sect_prop_change->m_oDate->GetValue() : L"";
odt_context->start_change(id, 3, author, userId, date);
convert(oox_sect_prop_change->m_pSecPr.GetPointer());
//odt_context->end_change(id, 3);
return id;
}
int DocxConverter::convert(OOX::Logic::CPPrChange *oox_para_prop_change)
{
if (!oox_para_prop_change) return -1;
std::wstring author = oox_para_prop_change->m_sAuthor.IsInit() ? oox_para_prop_change->m_sAuthor.get2() : L"";
std::wstring userId = oox_para_prop_change->m_sUserId.IsInit() ? oox_para_prop_change->m_sUserId.get2() : L"";
int id = oox_para_prop_change->m_oId.IsInit() ? oox_para_prop_change->m_oId->GetValue() : -1;
std::wstring date = oox_para_prop_change->m_oDate.IsInit() ? oox_para_prop_change->m_oDate->GetValue() : L"";
odt_context->start_change(id, 3, author, userId, date);
if (oox_para_prop_change->m_pParPr.IsInit())
{
bool list_present = oox_para_prop_change->m_pParPr->m_oNumPr.IsInit();
std::wstring list_style_name;
int list_level = -1;
int list_style_id = -1;
odf_writer::style_text_properties * text_properties = NULL;
odf_writer::style_paragraph_properties * paragraph_properties = NULL;
bool bRunPara = oox_para_prop_change->m_pParPr->m_oRPr.IsInit() ? true : false;
if (list_present)
{
if (oox_para_prop_change->m_pParPr->m_oNumPr->m_oIlvl.IsInit() && oox_para_prop_change->m_pParPr->m_oNumPr->m_oIlvl->m_oVal.IsInit())
list_level = oox_para_prop_change->m_pParPr->m_oNumPr->m_oIlvl->m_oVal->GetValue();
if (oox_para_prop_change->m_pParPr->m_oNumPr->m_oNumID.IsInit() && oox_para_prop_change->m_pParPr->m_oNumPr->m_oNumID->m_oVal.IsInit())
list_style_id = oox_para_prop_change->m_pParPr->m_oNumPr->m_oNumID->m_oVal->GetValue();
}
odt_context->styles_context()->create_style(L"", odf_types::style_family::Paragraph, true, false, -1);
paragraph_properties = odt_context->styles_context()->last_state()->get_paragraph_properties();
if (bRunPara)
text_properties = odt_context->styles_context()->last_state()->get_text_properties();
if(list_present && list_style_id >= 0)
{
list_style_name = odt_context->styles_context()->lists_styles().get_style_name(list_style_id);
odt_context->styles_context()->last_state()->set_list_style_name(list_style_name);
}
convert(oox_para_prop_change->m_pParPr.GetPointer(), paragraph_properties);
if (bRunPara)
convert(oox_para_prop_change->m_pParPr->m_oRPr.GetPointer(), text_properties);
}
//odt_context->end_change(id, 3);
return id;
}
int DocxConverter::convert(OOX::Logic::CRPrChange *oox_run_prop_change)
{
if (!oox_run_prop_change) return -1;
std::wstring author = oox_run_prop_change->m_sAuthor.IsInit() ? oox_run_prop_change->m_sAuthor.get2() : L"";
std::wstring userId = oox_run_prop_change->m_sUserId.IsInit() ? oox_run_prop_change->m_sUserId.get2() : L"";
int id = oox_run_prop_change->m_oId.IsInit() ? oox_run_prop_change->m_oId->GetValue() : -1;
std::wstring date = oox_run_prop_change->m_oDate.IsInit() ? oox_run_prop_change->m_oDate->GetValue() : L"";
odt_context->start_change(id, 3, author, userId, date);
if (oox_run_prop_change->m_pRunPr.IsInit())
{
odt_context->styles_context()->create_style(L"",odf_types::style_family::Text, true, false, -1);
odf_writer::style_text_properties * text_properties = odt_context->styles_context()->last_state()->get_text_properties();
convert(oox_run_prop_change->m_pRunPr.GetPointer(), text_properties);
}
//odt_context->end_change(id, 3);
return id;
}
int DocxConverter::convert(OOX::Logic::CTrPrChange *oox_tr_prop_change)
{
if (!oox_tr_prop_change) return -1;
std::wstring author = oox_tr_prop_change->m_sAuthor.IsInit() ? oox_tr_prop_change->m_sAuthor.get2() : L"";
std::wstring userId = oox_tr_prop_change->m_sUserId.IsInit() ? oox_tr_prop_change->m_sUserId.get2() : L"";
int id = oox_tr_prop_change->m_oId.IsInit() ? oox_tr_prop_change->m_oId->GetValue() : -1;
std::wstring date = oox_tr_prop_change->m_oDate.IsInit() ? oox_tr_prop_change->m_oDate->GetValue() : L"";
odt_context->start_change(id, 3, author, userId, date);
convert(oox_tr_prop_change->m_pTrPr.GetPointer());
//odt_context->end_change(id, 3);
return id;
}
int DocxConverter::convert(OOX::Logic::CTcPrChange *oox_tc_prop_change)
{
if (!oox_tc_prop_change) return -1;
std::wstring author = oox_tc_prop_change->m_sAuthor.IsInit() ? oox_tc_prop_change->m_sAuthor.get2() : L"";
std::wstring userId = oox_tc_prop_change->m_sUserId.IsInit() ? oox_tc_prop_change->m_sUserId.get2() : L"";
int id = oox_tc_prop_change->m_oId.IsInit() ? oox_tc_prop_change->m_oId->GetValue() : -1;
std::wstring date = oox_tc_prop_change->m_oDate.IsInit() ? oox_tc_prop_change->m_oDate->GetValue() : L"";
odt_context->start_change(id, 3, author, userId, date);
convert(oox_tc_prop_change->m_pTcPr.GetPointer());
//odt_context->end_change(id, 3);
return id;
}
int DocxConverter::convert(OOX::Logic::CTblPrChange *oox_table_prop_change)
{
if (!oox_table_prop_change) return -1;
std::wstring author = oox_table_prop_change->m_sAuthor.IsInit() ? oox_table_prop_change->m_sAuthor.get2() : L"";
std::wstring userId = oox_table_prop_change->m_sUserId.IsInit() ? oox_table_prop_change->m_sUserId.get2() : L"";
int id = oox_table_prop_change->m_oId.IsInit() ? oox_table_prop_change->m_oId->GetValue() : -1;
std::wstring date = oox_table_prop_change->m_oDate.IsInit() ? oox_table_prop_change->m_oDate->GetValue() : L"";
odt_context->start_change(id, 3, author, userId, date);
convert(oox_table_prop_change->m_pTblPr.GetPointer());
//odt_context->end_change(id, 3);
return id;
}
void DocxConverter::convert(OOX::Logic::CDel *oox_del)
{
if (oox_del == NULL) return;
std::wstring author = oox_del->m_sAuthor.IsInit() ? oox_del->m_sAuthor.get2() : L"";
std::wstring userId = oox_del->m_sUserId.IsInit() ? oox_del->m_sUserId.get2() : L"";
int id = oox_del->m_oId.IsInit() ? oox_del->m_oId->GetValue() : -1;
std::wstring date = oox_del->m_oDate.IsInit() ? oox_del->m_oDate->GetValue() : L"";
odt_context->start_change(id, 3, author, userId, date);
for (unsigned int i=0; i< oox_del->m_arrItems.size(); i++)
{
convert(oox_del->m_arrItems[i]);
}
odt_context->end_change(id, 3);
}
void DocxConverter::convert(OOX::Logic::CSmartTag *oox_tag)
{
if (oox_tag == NULL) return;
//текст-вставка авторский
//todooo сделать должную организацию text:change-start -> text:change-end c трейсером Abortion.docx
for (unsigned int i=0; i< oox_tag->m_arrItems.size(); i++)
{
......@@ -996,7 +1180,6 @@ void DocxConverter::convert(OOX::Logic::CParagraphProperty *oox_paragraph_pr, cp
}
if (oox_paragraph_pr->m_oTabs.IsInit())
{
paragraph_properties->add_child_element(odf_context()->start_tabs());
......@@ -1758,7 +1941,7 @@ void DocxConverter::convert(ComplexTypes::Word::CTblWidth *oox_size, _CP_OPT(odf
void DocxConverter::convert(OOX::Logic::CRunProperty *oox_run_pr, odf_writer::style_text_properties * text_properties)
{
if (oox_run_pr == NULL) return;
if (text_properties == NULL)return;
if (text_properties == NULL) return;
if (oox_run_pr->m_oRStyle.IsInit() && oox_run_pr->m_oRStyle->m_sVal.IsInit())
{
......@@ -1944,6 +2127,7 @@ void DocxConverter::convert(OOX::Logic::CRunProperty *oox_run_pr, odf_writer::st
if (oox_run_pr->m_oVanish.IsInit())
text_properties->content().text_display_ = odf_types::text_display(odf_types::text_display::None);
}
void DocxConverter::convert(SimpleTypes::CTheme<>* oox_font_theme, _CP_OPT(std::wstring) & odf_font_name)
......@@ -3980,9 +4164,9 @@ bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer
//nullable<ComplexTypes::Word::CTblOverlap > m_oTblOverlap;
//nullable<OOX::Logic::CTblPrChange > m_oTblPrChange;
return true;
}
void DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer::style_table_cell_properties * table_cell_properties)
{
if (oox_table_pr == NULL || oox_table_pr == NULL) return;
......@@ -4088,7 +4272,6 @@ void DocxConverter::convert(OOX::Logic::CTableRowProperties *oox_table_row_pr)
//nullable<OOX::Logic::CTrPrChange > m_oTrPrChange;
//nullable<ComplexTypes::Word::CTblWidth > m_oWAfter;
//nullable<ComplexTypes::Word::CTblWidth > m_oWBefore;
}
bool DocxConverter::convert(OOX::Logic::CTableCellProperties *oox_table_cell_pr,odf_writer::style_table_cell_properties * table_cell_properties)
{
......
......@@ -48,11 +48,18 @@ namespace OOX
namespace Logic
{
class CPTab;
class CSmartTag;
class CIns;
class CDel;
class CPPrChange;
class CRPrChange;
class CSectPrChange;
class CTrPrChange;
class CTcPrChange;
class CTblPrChange;
class CParagraph;
class CParagraphProperty;
class CPTab;
class CSmartTag;
class CRun;
class CSym;
class CRunProperty;
......@@ -69,6 +76,7 @@ namespace OOX
class CFldChar;
class CFldSimple;
class CInstrText;
class CDelText;
class CCommentRangeStart;
class CCommentRangeEnd;
class CCommentReference;
......@@ -176,20 +184,30 @@ namespace Oox2Odf
void convert(OOX::Logic::CSectionProperty *oox_section_pr, bool root = false);
void convert(OOX::Logic::CParagraph *oox_paragraph);
void convert(OOX::Logic::CRun *oox_run);
void convert(OOX::Logic::CParagraphProperty *oox_paragraph_prop, odf_writer::style_paragraph_properties *paragraph_properties);
void convert(OOX::Logic::CParagraphProperty *oox_para_prop, odf_writer::style_paragraph_properties *paragraph_properties);
void convert(ComplexTypes::Word::CFramePr *oox_frame_pr, odf_writer::style_paragraph_properties *paragraph_properties);
void convert(OOX::Logic::CRunProperty *oox_run_prop, odf_writer::style_text_properties *text_properties);
void convert(ComplexTypes::Word::CShading *oox_shading, odf_writer::style_text_properties *text_properties );
void convert(OOX::Logic::CFldSimple *oox_fld);
void convert(OOX::Logic::CFldChar *oox_fld);
void convert(OOX::Logic::CInstrText *oox_instr);
void convert(OOX::Logic::CInstrText *oox_instrText);
void convert(OOX::Logic::CDelText *oox_delText);
void convert(OOX::Logic::CText *oox_text);
void convert(OOX::Logic::CHyperlink *oox_hyperlink);
void convert(OOX::Logic::CSym *oox_sym);
void convert(OOX::Logic::CIns *oox_ins);
void convert(OOX::Logic::CSmartTag *oox_tag);
void convert(OOX::Logic::CPTab *oox_ptab);
void convert(OOX::Logic::CIns *oox_ins);
void convert(OOX::Logic::CDel *oox_del);
int convert(OOX::Logic::CPPrChange *oox_para_prop_change);
int convert(OOX::Logic::CRPrChange *oox_run_prop_change);
int convert(OOX::Logic::CSectPrChange *oox_sect_prop_change);
int convert(OOX::Logic::CTrPrChange *oox_tr_prop_change);
int convert(OOX::Logic::CTcPrChange *oox_tc_prop_change);
int convert(OOX::Logic::CTblPrChange *oox_table_prop_change);
void convert(OOX::Logic::CAlternateContent *oox_alt_content);
void convert(OOX::Logic::CDrawing *oox_drawing);
void convert(OOX::Logic::CGroupShape *oox_group_shape);
......
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