diff --git a/ASCOfficeOdfFile/include/odf/odf_elements_type.h b/ASCOfficeOdfFile/include/odf/odf_elements_type.h index b40671eb25..b8ae99f797 100644 --- a/ASCOfficeOdfFile/include/odf/odf_elements_type.h +++ b/ASCOfficeOdfFile/include/odf/odf_elements_type.h @@ -260,6 +260,9 @@ enum ElementType typeStyleFooterLeft, typeStyleFootnoteSep, + typeLoextHeaderFirst, + typeLoextFooterFirst, + typeStyleSectionProperties, typeStyleHeaderStyle, typeStyleFooterStyle, diff --git a/ASCOfficeOdfFile/src/odf/styles.cpp b/ASCOfficeOdfFile/src/odf/styles.cpp index 0aece13656..623ec7d257 100644 --- a/ASCOfficeOdfFile/src/odf/styles.cpp +++ b/ASCOfficeOdfFile/src/odf/styles.cpp @@ -1501,24 +1501,19 @@ void style_master_page::add_attributes( const xml::attributes_wc_ptr & Attribute void style_master_page::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name) { - if (L"style" == Ns && L"header" == Name) - CP_CREATE_ELEMENT(style_header_); - else if (L"style" == Ns && L"header-first" == Name) - CP_CREATE_ELEMENT(style_header_first_); - else if (L"style" == Ns && L"header-left" == Name) - CP_CREATE_ELEMENT(style_header_left_); - - else if (L"style" == Ns && L"footer" == Name) - CP_CREATE_ELEMENT(style_footer_); - else if (L"style" == Ns && L"footer-first" == Name) - CP_CREATE_ELEMENT(style_footer_first_); - else if (L"style" == Ns && L"footer-left" == Name) - CP_CREATE_ELEMENT(style_footer_left_); - - else if (L"office" == Ns && L"forms" == Name) - CP_CREATE_ELEMENT(office_forms_); - else if (L"style" == Ns && L"style" == Name) - CP_CREATE_ELEMENT(style_style_); + if (L"style" == Ns || L"loext" == Ns) + { + if (L"header" == Name) CP_CREATE_ELEMENT(style_header_); + else if (L"header-first" == Name) CP_CREATE_ELEMENT(style_header_first_); + else if (L"header-left" == Name) CP_CREATE_ELEMENT(style_header_left_); + else if (L"footer" == Name) CP_CREATE_ELEMENT(style_footer_); + else if (L"footer-first" == Name) CP_CREATE_ELEMENT(style_footer_first_); + else if (L"footer-left" == Name) CP_CREATE_ELEMENT(style_footer_left_); + } + else if (L"style" == Ns && L"style" == Name) + CP_CREATE_ELEMENT(style_style_); + else if (L"office" == Ns && L"forms" == Name) + CP_CREATE_ELEMENT(office_forms_); else if (L"presentation" == Ns && L"notes" == Name) CP_CREATE_ELEMENT(presentation_notes_); else @@ -1686,6 +1681,9 @@ void style_footer::xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_con const wchar_t * style_header_first::ns = L"style"; const wchar_t * style_header_first::name = L"header-first"; +const wchar_t * loext_header_first::ns = L"loext"; +const wchar_t * loext_header_first::name = L"header-first"; + void style_header_first::docx_convert(oox::docx_conversion_context & Context) { std::wostream & strm = Context.output_stream(); @@ -1710,6 +1708,9 @@ void style_header_first::xlsx_serialize(std::wostream & strm, oox::xlsx_conversi const wchar_t * style_footer_first::ns = L"style"; const wchar_t * style_footer_first::name = L"footer-first"; +const wchar_t * loext_footer_first::ns = L"loext"; +const wchar_t * loext_footer_first::name = L"footer-first"; + void style_footer_first::docx_convert(oox::docx_conversion_context & Context) { std::wostream & strm = Context.output_stream(); diff --git a/ASCOfficeOdfFile/src/odf/styles.h b/ASCOfficeOdfFile/src/odf/styles.h index d1a18f2dfc..320fdac1ae 100644 --- a/ASCOfficeOdfFile/src/odf/styles.h +++ b/ASCOfficeOdfFile/src/odf/styles.h @@ -649,6 +649,17 @@ public: CP_REGISTER_OFFICE_ELEMENT2(style_header_first); +// loext:header-first +class loext_header_first : public style_header_first +{ +public: + static const wchar_t * ns; + static const wchar_t * name; + static const xml::NodeType xml_type = xml::typeElement; + static const ElementType type = typeLoextHeaderFirst; +}; +CP_REGISTER_OFFICE_ELEMENT2(loext_header_first); + // style:footer_first class style_footer_first : public header_footer_impl { @@ -663,6 +674,17 @@ public: }; CP_REGISTER_OFFICE_ELEMENT2(style_footer_first); +// loext:footer_first +class loext_footer_first : public style_footer_first +{ +public: + static const wchar_t * ns; + static const wchar_t * name; + static const xml::NodeType xml_type = xml::typeElement; + static const ElementType type = typeLoextFooterFirst; +}; +CP_REGISTER_OFFICE_ELEMENT2(loext_footer_first); + // style:header-left class style_header_left : public header_footer_impl {