From 4302f08281bb03a7cdb8b9e60f85d6da50005533 Mon Sep 17 00:00:00 2001 From: "Elen.Subbotina" Date: Fri, 14 Mar 2014 10:12:03 +0000 Subject: [PATCH] git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@54933 954022d7-b5bf-4e40-9824-e11837661b57 --- .../source/OdfFormat/abstract_xml.cpp | 2 +- .../source/OdfFormat/abstract_xml.h | 2 +- .../source/OdfFormat/header_footer.cpp | 4 +- .../source/OdfFormat/header_footer.h | 4 +- .../OdfFormat/odf_conversion_context.cpp | 2 +- .../source/OdfFormat/office_body.cpp | 2 +- .../source/OdfFormat/office_body.h | 2 +- .../source/OdfFormat/office_spreadsheet.cpp | 2 +- .../source/OdfFormat/office_spreadsheet.h | 2 +- .../source/OdfFormat/style_map.cpp | 2 +- .../source/OdfFormat/style_map.h | 2 +- .../OdfFormat/style_table_properties.cpp | 12 +- .../source/OdfFormat/style_table_properties.h | 10 +- ASCOfficeOdfFileW/source/OdfFormat/styles.cpp | 183 +++++++++++++----- ASCOfficeOdfFileW/source/OdfFormat/styles.h | 84 ++++---- .../source/OdfFormat/styles_list.cpp | 10 +- .../source/OdfFormat/styles_list.h | 13 +- ASCOfficeOdfFileW/source/OdfFormat/table.cpp | 64 +++--- ASCOfficeOdfFileW/source/OdfFormat/table.h | 40 ++-- .../source/Oox2OdfConverter/XlsxConverter.cpp | 2 +- .../source/Oox2OdfConverter/XlsxConverter.h | 2 +- 21 files changed, 272 insertions(+), 174 deletions(-) diff --git a/ASCOfficeOdfFileW/source/OdfFormat/abstract_xml.cpp b/ASCOfficeOdfFileW/source/OdfFormat/abstract_xml.cpp index f8e169bdd8..a50ad4d057 100644 --- a/ASCOfficeOdfFileW/source/OdfFormat/abstract_xml.cpp +++ b/ASCOfficeOdfFileW/source/OdfFormat/abstract_xml.cpp @@ -19,7 +19,7 @@ void abstract_xml::serialize(std::wostream & strm) { } -//void abstract_xml::add_child_element( const ::std::wstring & Ns, const ::std::wstring & Name) +//void abstract_xml::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name) //{ // CP_CREATE_ELEMENT(xml_content_); //} diff --git a/ASCOfficeOdfFileW/source/OdfFormat/abstract_xml.h b/ASCOfficeOdfFileW/source/OdfFormat/abstract_xml.h index f1a306ee1d..2065cf8ca9 100644 --- a/ASCOfficeOdfFileW/source/OdfFormat/abstract_xml.h +++ b/ASCOfficeOdfFileW/source/OdfFormat/abstract_xml.h @@ -19,7 +19,7 @@ public: abstract_xml() {}; private: - virtual void add_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( office_element_ptr & child_element); virtual void serialize(std::wostream & strm); diff --git a/ASCOfficeOdfFileW/source/OdfFormat/header_footer.cpp b/ASCOfficeOdfFileW/source/OdfFormat/header_footer.cpp index 086e057ff3..dd5b82044b 100644 --- a/ASCOfficeOdfFileW/source/OdfFormat/header_footer.cpp +++ b/ASCOfficeOdfFileW/source/OdfFormat/header_footer.cpp @@ -13,7 +13,7 @@ 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::add_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) { @@ -25,7 +25,7 @@ void style_header_footer_properties::add_child_element( const ::std::wstring & } } -void header_footer_content::add_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) { CP_CREATE_ELEMENT_SIMPLE(content_); } diff --git a/ASCOfficeOdfFileW/source/OdfFormat/header_footer.h b/ASCOfficeOdfFileW/source/OdfFormat/header_footer.h index 411c432fd3..7d8d49c16b 100644 --- a/ASCOfficeOdfFileW/source/OdfFormat/header_footer.h +++ b/ASCOfficeOdfFileW/source/OdfFormat/header_footer.h @@ -44,7 +44,7 @@ public: static const ElementType type = typeStyleHeaderFooterProperties; CPDOCCORE_DEFINE_VISITABLE(); - virtual void add_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(office_element_ptr & child) {std::wstringstream str; str <serialize(strm); + } + BOOST_FOREACH(office_element_ptr & elm, style_style_) + { + elm->serialize(strm); + } + BOOST_FOREACH(office_element_ptr & elm, text_list_style_) + { + elm->serialize(strm); + } +} +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") { @@ -299,7 +313,7 @@ void templates::add_child_element(office_element_ptr & child) table_templates_.push_back(child); } } -void draw_styles::add_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") { @@ -347,6 +361,34 @@ void draw_styles::add_child_element(office_element_ptr & child, odf_conversion_c case typeStyleDrawStrokeDash: draw_stroke_dash_.push_back(child); break; } } + +void draw_styles::serialize(std::wostream & strm) +{ + BOOST_FOREACH(office_element_ptr & elm, draw_fill_image_) + { + elm->serialize(strm); + } + BOOST_FOREACH(office_element_ptr & elm, draw_hatch_) + { + elm->serialize(strm); + } + BOOST_FOREACH(office_element_ptr & elm, draw_gradient_) + { + elm->serialize(strm); + } + BOOST_FOREACH(office_element_ptr & elm, draw_opacity_) + { + elm->serialize(strm); + } + BOOST_FOREACH(office_element_ptr & elm, draw_marker_) + { + elm->serialize(strm); + } + BOOST_FOREACH(office_element_ptr & elm, draw_stroke_dash_) + { + elm->serialize(strm); + } +} // office:automatic-styles ////////////////////////////////////////////////////////////////////////////////////////////////// const wchar_t * office_automatic_styles::ns = L"office"; @@ -354,7 +396,7 @@ const wchar_t * office_automatic_styles::name = L"automatic-styles"; -void office_automatic_styles::add_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) { @@ -362,7 +404,7 @@ void office_automatic_styles::add_child_element( const ::std::wstring & Ns, cons } else { - styles_.add_child_element(Ns, Name, getContext()); + styles_.create_child_element(Ns, Name, getContext()); } } @@ -382,13 +424,28 @@ void office_automatic_styles::add_child_element(office_element_ptr & child) break; } } +void office_automatic_styles::serialize(std::wostream & strm) +{ + CP_XML_WRITER(strm) + { + CP_XML_NODE_SIMPLE() + { + BOOST_FOREACH(office_element_ptr elm, style_page_layout_) + { + elm->serialize(CP_XML_STREAM()); + } + + styles_.serialize(CP_XML_STREAM()); + } + } +} // office:master-styles ////////////////////////////////////////////////////////////////////////////////////////////////// const wchar_t * office_master_styles::ns = L"office"; const wchar_t * office_master_styles::name = L"master-styles"; -void office_master_styles::add_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_); @@ -421,7 +478,22 @@ void office_master_styles::add_child_element(office_element_ptr & child) break; } } +void office_master_styles::serialize(std::wostream & strm) +{ + CP_XML_WRITER(strm) + { + CP_XML_NODE_SIMPLE() + { + draw_layer_set_->serialize(CP_XML_STREAM()); + BOOST_FOREACH(office_element_ptr elm, style_master_page_) + { + elm->serialize(CP_XML_STREAM()); + } + style_handout_master_->serialize(CP_XML_STREAM()); + } + } +} // office:styles ////////////////////////////////////////////////////////////////////////////////////////////////// @@ -429,7 +501,7 @@ const wchar_t * office_styles::ns = L"office"; const wchar_t * office_styles::name = L"styles"; -void office_styles::add_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") || @@ -441,7 +513,7 @@ void office_styles::add_child_element( const ::std::wstring & Ns, const ::std::w CP_CHECK_NAME(L"number", L"boolean-style") ) { - styles_.add_child_element( Ns, Name, getContext()); + styles_.create_child_element( Ns, Name, getContext()); } else if (L"style" == Ns && L"default-style" == Name) CP_CREATE_ELEMENT(style_default_style_); @@ -459,11 +531,11 @@ void office_styles::add_child_element( const ::std::wstring & Ns, const ::std::w CP_CHECK_NAME(L"svg", L"radialGradient") ) { - draw_styles_.add_child_element( Ns, Name, getContext()); + draw_styles_.create_child_element( Ns, Name, getContext()); } else if(CP_CHECK_NAME(L"table", L"table-template")) { - templates_.add_child_element( Ns, Name, getContext()); + templates_.create_child_element( Ns, Name, getContext()); } else if (L"text" == Ns && L"outline-style" == Name) CP_CREATE_ELEMENT(text_outline_style_); @@ -516,6 +588,25 @@ void office_styles::add_child_element(office_element_ptr & child) //.... } } +void office_styles::serialize(std::wostream & strm) +{ + CP_XML_WRITER(strm) + { + CP_XML_NODE_SIMPLE() + { + BOOST_FOREACH(office_element_ptr & elm, style_default_style_) + { + elm->serialize(CP_XML_STREAM()); + } + + draw_styles_.serialize(CP_XML_STREAM()); + + templates_.serialize(CP_XML_STREAM()); + + styles_.serialize(CP_XML_STREAM()); + } + } +} // style:header ////////////////////////////////////////////////////////////////////////////////////////////////// @@ -523,9 +614,9 @@ const wchar_t * style_header::ns = L"style"; const wchar_t * style_header::name = L"header"; -void style_header::add_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_.add_child_element( Ns, Name, getContext()); + content().header_footer_content_.create_child_element( Ns, Name, getContext()); } void style_header::add_child_element(office_element_ptr & child) { @@ -536,9 +627,9 @@ const wchar_t * style_footer::ns = L"style"; const wchar_t * style_footer::name = L"footer"; -void style_footer::add_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_.add_child_element(Ns, Name, getContext()); + content().header_footer_content_.create_child_element(Ns, Name, getContext()); } void style_footer::add_child_element(office_element_ptr & child) { @@ -548,9 +639,9 @@ void style_footer::add_child_element(office_element_ptr & child) const wchar_t * style_header_first::ns = L"style"; const wchar_t * style_header_first::name = L"header-first"; -void style_header_first::add_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_.add_child_element(Ns, Name, getContext()); + content().header_footer_content_.create_child_element(Ns, Name, getContext()); } void style_header_first::add_child_element(office_element_ptr & child) { @@ -562,9 +653,9 @@ const wchar_t * style_footer_first::ns = L"style"; const wchar_t * style_footer_first::name = L"footer-first"; -void style_footer_first::add_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_.add_child_element( Ns, Name, getContext()); + content().header_footer_content_.create_child_element( Ns, Name, getContext()); } void style_footer_first::add_child_element( office_element_ptr & child) { @@ -575,9 +666,9 @@ const wchar_t * style_header_left::ns = L"style"; const wchar_t * style_header_left::name = L"header-left"; -void style_header_left::add_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_.add_child_element( Ns, Name, getContext()); + content().header_footer_content_.create_child_element( Ns, Name, getContext()); } void style_header_left::add_child_element(office_element_ptr & child) { @@ -587,9 +678,9 @@ void style_header_left::add_child_element(office_element_ptr & child) const wchar_t * style_footer_left::ns = L"style"; const wchar_t * style_footer_left::name = L"footer-left"; -void style_footer_left::add_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_.add_child_element( Ns, Name, getContext()); + content().header_footer_content_.create_child_element( Ns, Name, getContext()); } void style_footer_left::add_child_element(office_element_ptr & child) { @@ -601,7 +692,7 @@ void style_footer_left::add_child_element(office_element_ptr & child) const wchar_t * style_columns::ns = L"style"; const wchar_t * style_columns::name = L"columns"; -void style_columns::add_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_); @@ -634,7 +725,7 @@ const wchar_t * style_column::ns = L"style"; const wchar_t * style_column::name = L"column"; -void style_column::add_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(); } @@ -645,7 +736,7 @@ const wchar_t * style_column_sep::ns = L"style"; const wchar_t * style_column_sep::name = L"column-sep"; -void style_column_sep::add_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(); } @@ -655,7 +746,7 @@ void style_column_sep::add_child_element( const ::std::wstring & Ns, const ::std const wchar_t * style_section_properties::ns = L"style"; const wchar_t * style_section_properties::name = L"section-properties"; -void style_section_properties::add_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_); @@ -687,7 +778,7 @@ void style_section_properties::add_child_element(office_element_ptr & child) const wchar_t * style_header_style::ns = L"style"; const wchar_t * style_header_style::name = L"header-style"; -void style_header_style::add_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) { @@ -713,7 +804,7 @@ void style_header_style::add_child_element(office_element_ptr & child) const wchar_t * style_footer_style::ns = L"style"; const wchar_t * style_footer_style::name = L"footer-style"; -void style_footer_style::add_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) { @@ -739,7 +830,7 @@ void style_footer_style::add_child_element(office_element_ptr & child) const wchar_t * style_page_layout::ns = L"style"; const wchar_t * style_page_layout::name = L"page-layout"; -void style_page_layout::add_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) { @@ -782,7 +873,7 @@ void style_page_layout::add_child_element( office_element_ptr & child) const wchar_t * style_footnote_sep::ns = L"style"; const wchar_t * style_footnote_sep::name = L"footnote-sep"; -void style_footnote_sep::add_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(); } @@ -792,9 +883,9 @@ void style_footnote_sep::add_child_element( const ::std::wstring & Ns, const ::s 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::add_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_.add_child_element( Ns, Name, getContext()); + style_page_layout_properties_elements_.create_child_element( Ns, Name, getContext()); } void style_page_layout_properties::add_child_element( office_element_ptr & child) @@ -803,7 +894,7 @@ void style_page_layout_properties::add_child_element( office_element_ptr & child } // style-page-layout-properties-elements ////////////////////////////////////////////////////////////////////////////////////////////////// -void style_page_layout_properties_elements::add_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) { @@ -846,7 +937,7 @@ void style_page_layout_properties_elements::add_child_element( office_element_pt const wchar_t * style_master_page::ns = L"style"; const wchar_t * style_master_page::name = L"master-page"; -void style_master_page::add_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_); @@ -948,7 +1039,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::add_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_); @@ -963,7 +1054,7 @@ void text_notes_configuration::add_child_element(const ::std::wstring & Ns, cons 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::add_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) { diff --git a/ASCOfficeOdfFileW/source/OdfFormat/styles.h b/ASCOfficeOdfFileW/source/OdfFormat/styles.h index 28a150367b..0a858d3acd 100644 --- a/ASCOfficeOdfFileW/source/OdfFormat/styles.h +++ b/ASCOfficeOdfFileW/source/OdfFormat/styles.h @@ -56,7 +56,7 @@ class style_drawing_page_properties; class style_content : noncopyable { public: - void add_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(office_element_ptr & child, odf_conversion_context * Context); style_text_properties * get_style_text_properties() const; @@ -101,7 +101,7 @@ public: public: default_style() {}; - virtual void add_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(office_element_ptr & child); virtual void serialize(std::wostream & strm){} @@ -145,7 +145,7 @@ public: _CP_OPT(std::wstring) draw_name_; _CP_OPT(std::wstring) draw_display_name_; - virtual void add_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(office_element_ptr & child) {std::wstringstream str; str <add_child_element(Ns, Name, Context); + elm->create_child_element(Ns, Name, Context); content_.push_back(elm); } else @@ -215,7 +215,7 @@ void table_columns_and_groups::add_child_element(const ::std::wstring & Ns, cons // table-table-cell-content ////////////////////////////////////////////////////////////////////////////////////////////////// -void table_table_cell_content::add_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_); } @@ -226,9 +226,9 @@ void table_table_cell_content::add_child_element( const ::std::wstring & Ns, co const wchar_t * table_table_cell::ns = L"table"; const wchar_t * table_table_cell::name = L"table-cell"; -void table_table_cell::add_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_.add_child_element(Ns, Name, getContext()); + table_table_cell_content_.create_child_element(Ns, Name, getContext()); } @@ -238,10 +238,10 @@ void table_table_cell::add_child_element( const ::std::wstring & Ns, const ::std 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::add_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_.add_child_element( Ns, Name, getContext()); + table_table_cell_content_.create_child_element( Ns, Name, getContext()); } @@ -251,7 +251,7 @@ void table_covered_table_cell::add_child_element( const ::std::wstring & Ns, co const wchar_t * table_table_row::ns = L"table"; const wchar_t * table_table_row::name = L"table-row"; -void table_table_row::add_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"covered-table-cell") ) @@ -268,7 +268,7 @@ void table_table_row::add_child_element( const ::std::wstring & Ns, const ::std: const wchar_t * table_table_rows::ns = L"table"; const wchar_t * table_table_rows::name = L"table-rows"; -void table_table_rows::add_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_); } @@ -279,7 +279,7 @@ void table_table_rows::add_child_element( const ::std::wstring & Ns, const ::st 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::add_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") { @@ -292,7 +292,7 @@ void table_table_header_rows::add_child_element( const ::std::wstring & Ns, cons // table-rows ////////////////////////////////////////////////////////////////////////////////////////////////// -void table_rows::add_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") { @@ -322,14 +322,14 @@ table_rows_no_group::table_rows_no_group() : was_header_(false) { }; -void table_rows_no_group::add_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context) +void table_rows_no_group::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context) { if (CP_CHECK_NAME(L"table", L"table-rows") || CP_CHECK_NAME(L"table", L"table-row")) { if (!was_header_) - table_rows_1_.add_child_element(Ns, Name, Context); + table_rows_1_.create_child_element(Ns, Name, Context); else - table_rows_2_.add_child_element(Ns, Name, Context); + table_rows_2_.create_child_element(Ns, Name, Context); } else if CP_CHECK_NAME(L"table", L"table-header-rows") { @@ -347,7 +347,7 @@ table_rows_and_groups::table_rows_and_groups() { } -void table_rows_and_groups::add_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) { @@ -356,7 +356,7 @@ void table_rows_and_groups::add_child_element( const ::std::wstring & Ns, const else if (L"table" == Ns && (L"table-rows" == Name || L"table-row" == Name || L"table-header-rows" == Name) ) { _CP_PTR(table_rows_no_group) elm = table_rows_no_group::create(); - elm->add_child_element(Ns, Name, Context); + elm->create_child_element(Ns, Name, Context); content_.push_back(elm); } else @@ -370,9 +370,9 @@ 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::add_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_.add_child_element(Ns, Name, getContext()); + table_rows_and_groups_.create_child_element(Ns, Name, getContext()); } @@ -385,7 +385,7 @@ void table_table_row_group::add_child_element(const ::std::wstring & Ns, const : const wchar_t * table_shapes::ns = L"table"; const wchar_t * table_shapes::name = L"shapes"; -void table_shapes::add_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()); } diff --git a/ASCOfficeOdfFileW/source/OdfFormat/table.h b/ASCOfficeOdfFileW/source/OdfFormat/table.h index f58e148708..74d52419f1 100644 --- a/ASCOfficeOdfFileW/source/OdfFormat/table.h +++ b/ASCOfficeOdfFileW/source/OdfFormat/table.h @@ -112,7 +112,7 @@ public: table_table_source_attlist table_table_source_attlist_; table_linked_source_attlist table_linked_source_attlist_; - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -125,7 +125,7 @@ CP_REGISTER_OFFICE_ELEMENT2(table_table_source); class table_columns { public: - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -151,7 +151,7 @@ public: public: table_columns_no_group(); - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -174,7 +174,7 @@ class table_columns_and_groups public: table_columns_and_groups(); - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -210,7 +210,7 @@ public: CPDOCCORE_DEFINE_VISITABLE(); - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -235,7 +235,7 @@ public: CPDOCCORE_DEFINE_VISITABLE(); - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -259,7 +259,7 @@ public: CPDOCCORE_DEFINE_VISITABLE(); - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -290,7 +290,7 @@ public: CPDOCCORE_DEFINE_VISITABLE(); - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -319,7 +319,7 @@ public: CPDOCCORE_DEFINE_VISITABLE(); - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -336,7 +336,7 @@ CP_REGISTER_OFFICE_ELEMENT2(table_table_row); class table_table_cell_content { public: - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -362,7 +362,7 @@ public: table_table_cell() { } - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -390,7 +390,7 @@ public: table_covered_table_cell() {empty_ = true; } - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -416,7 +416,7 @@ public: CPDOCCORE_DEFINE_VISITABLE(); - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -444,7 +444,7 @@ public: CPDOCCORE_DEFINE_VISITABLE(); - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -460,7 +460,7 @@ CP_REGISTER_OFFICE_ELEMENT2(table_table_header_rows); class table_rows { public: - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -487,7 +487,7 @@ public: public: table_rows_no_group(); - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -508,7 +508,7 @@ class table_rows_and_groups public: table_rows_and_groups(); - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -545,7 +545,7 @@ public: table_table_row_group() { } - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} @@ -570,7 +570,7 @@ public: CPDOCCORE_DEFINE_VISITABLE(); - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream); @@ -601,7 +601,7 @@ public: CPDOCCORE_DEFINE_VISITABLE(); - virtual void add_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( office_element_ptr & child_element){} virtual void serialize(std::wostream & _Wostream){} diff --git a/ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp b/ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp index f9202fb94d..9d159d9332 100644 --- a/ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp +++ b/ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp @@ -150,7 +150,7 @@ void XlsxConverter::convert_styles() } -odf::office_element_ptr & XlsxConverter::convert(OOX::Spreadsheet::CFont * font) +odf::office_element_ptr XlsxConverter::convert(OOX::Spreadsheet::CFont * font) { odf::office_element_ptr element; return element; diff --git a/ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.h b/ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.h index 906446ff67..707dbc39a2 100644 --- a/ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.h +++ b/ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.h @@ -46,6 +46,6 @@ namespace Oox2Odf void convert(OOX::Spreadsheet::CWorksheet *oox_sheet); - cpdoccore::odf::office_element_ptr & convert(OOX::Spreadsheet::CFont * font); + cpdoccore::odf::office_element_ptr convert(OOX::Spreadsheet::CFont * font); }; } \ No newline at end of file