diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-12-01 11:00:09 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-12-04 09:07:43 +0100 |
commit | 19339e79e41cb9bbbbf0bd9a0e0d4a2cccc1f6a5 (patch) | |
tree | b87544b510d800b0d6f678b5edd5211998d486c2 /writerperfect | |
parent | e83d7993d46b096ecc18c01d92d39e170cce18c1 (diff) |
EPUB export, fixed layout: remove old non-metafile-based page size approach
This was unused code.
Change-Id: I7f728544127dc283cd74e4425e699d598caeae1a
Reviewed-on: https://gerrit.libreoffice.org/45649
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerperfect')
-rw-r--r-- | writerperfect/source/writer/exp/txtparai.cxx | 7 | ||||
-rw-r--r-- | writerperfect/source/writer/exp/txtstyli.cxx | 96 | ||||
-rw-r--r-- | writerperfect/source/writer/exp/txtstyli.hxx | 29 | ||||
-rw-r--r-- | writerperfect/source/writer/exp/xmlfmt.cxx | 13 | ||||
-rw-r--r-- | writerperfect/source/writer/exp/xmlfmt.hxx | 8 | ||||
-rw-r--r-- | writerperfect/source/writer/exp/xmlimp.cxx | 27 | ||||
-rw-r--r-- | writerperfect/source/writer/exp/xmlimp.hxx | 7 |
7 files changed, 3 insertions, 184 deletions
diff --git a/writerperfect/source/writer/exp/txtparai.cxx b/writerperfect/source/writer/exp/txtparai.cxx index 95f85d86f454..309f80ce607a 100644 --- a/writerperfect/source/writer/exp/txtparai.cxx +++ b/writerperfect/source/writer/exp/txtparai.cxx @@ -397,13 +397,6 @@ void XMLParaContext::startElement(const OUString &/*rName*/, const css::uno::Ref } } - if (!mrImport.IsPageSpanOpened()) - { - auto it = mrImport.GetMasterPages().find("Standard"); - if (it != mrImport.GetMasterPages().end()) - mrImport.GetGenerator().openPageSpan(it->second); - mrImport.SetPageSpanOpened(true); - } mrImport.GetGenerator().openParagraph(aPropertyList); } diff --git a/writerperfect/source/writer/exp/txtstyli.cxx b/writerperfect/source/writer/exp/txtstyli.cxx index 38b32768ddf0..e8fe1a43bea0 100644 --- a/writerperfect/source/writer/exp/txtstyli.cxx +++ b/writerperfect/source/writer/exp/txtstyli.cxx @@ -320,102 +320,6 @@ librevenge::RVNGPropertyList &XMLStyleContext::GetGraphicPropertyList() return m_aGraphicPropertyList; } -XMLMasterPageContext::XMLMasterPageContext(XMLImport &rImport, XMLStylesContext &rStyles) - : XMLImportContext(rImport), - m_rStyles(rStyles) -{ - // I'll remove this in a follow-up commit. - (void)m_rStyles; -} - -void XMLMasterPageContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) -{ - OUString aName; - OUString aPageLayoutName; - for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) - { - const OUString &rAttributeName = xAttribs->getNameByIndex(i); - const OUString &rAttributeValue = xAttribs->getValueByIndex(i); - if (rAttributeName == "style:name") - aName = rAttributeValue; - else if (rAttributeName == "style:page-layout-name") - aPageLayoutName = rAttributeValue; - } - auto it = mrImport.GetPageLayouts().find(aPageLayoutName); - if (it == mrImport.GetPageLayouts().end()) - return; - - librevenge::RVNGPropertyList::Iter itProp(it->second); - librevenge::RVNGPropertyList aPropertyList; - for (itProp.rewind(); itProp.next();) - aPropertyList.insert(itProp.key(), itProp()->clone()); - mrImport.GetMasterPages()[aName] = aPropertyList; -} - -/// Handler for <style:page-layout-properties>. -class XMLPageLayoutPropertiesContext : public XMLImportContext -{ -public: - XMLPageLayoutPropertiesContext(XMLImport &rImport, XMLPageLayoutContext &rStyle); - - void SAL_CALL startElement(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override; - -private: - XMLPageLayoutContext &m_rStyle; -}; - -XMLPageLayoutPropertiesContext::XMLPageLayoutPropertiesContext(XMLImport &rImport, XMLPageLayoutContext &rStyle) - : XMLImportContext(rImport) - , m_rStyle(rStyle) -{ -} - -void XMLPageLayoutPropertiesContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) -{ - for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) - { - OString sName = OUStringToOString(xAttribs->getNameByIndex(i), RTL_TEXTENCODING_UTF8); - OString sValue = OUStringToOString(xAttribs->getValueByIndex(i), RTL_TEXTENCODING_UTF8); - m_rStyle.GetPropertyList().insert(sName.getStr(), sValue.getStr()); - } -} - -XMLPageLayoutContext::XMLPageLayoutContext(XMLImport &rImport, XMLStylesContext &rStyles) - : XMLImportContext(rImport), - m_rStyles(rStyles) -{ -} - -void XMLPageLayoutContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) -{ - for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) - { - const OUString &rAttributeName = xAttribs->getNameByIndex(i); - const OUString &rAttributeValue = xAttribs->getValueByIndex(i); - if (rAttributeName == "style:name") - m_aName = rAttributeValue; - } -} - -rtl::Reference<XMLImportContext> XMLPageLayoutContext::CreateChildContext(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/) -{ - if (rName == "style:page-layout-properties") - return new XMLPageLayoutPropertiesContext(mrImport, *this); - return nullptr; -} - -void XMLPageLayoutContext::endElement(const OUString &/*rName*/) -{ - if (m_aName.isEmpty()) - return; - - m_rStyles.GetCurrentPageLayouts()[m_aName] = m_aPropertyList; -} - -librevenge::RVNGPropertyList &XMLPageLayoutContext::GetPropertyList() -{ - return m_aPropertyList; -} } // namespace exp } // namespace writerperfect diff --git a/writerperfect/source/writer/exp/txtstyli.hxx b/writerperfect/source/writer/exp/txtstyli.hxx index 06ae15e503f8..f3b3b6da38c9 100644 --- a/writerperfect/source/writer/exp/txtstyli.hxx +++ b/writerperfect/source/writer/exp/txtstyli.hxx @@ -52,35 +52,6 @@ private: XMLStylesContext &m_rStyles; }; -/// Handler for <style:master-page>. -class XMLMasterPageContext : public XMLImportContext -{ -public: - XMLMasterPageContext(XMLImport &rImport, XMLStylesContext &rStyles); - - void SAL_CALL startElement(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override; - -private: - XMLStylesContext &m_rStyles; -}; - -/// Handler for <style:page-layout>. -class XMLPageLayoutContext : public XMLImportContext -{ -public: - XMLPageLayoutContext(XMLImport &rImport, XMLStylesContext &rStyles); - - rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override; - void SAL_CALL startElement(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override; - void SAL_CALL endElement(const OUString &rName) override; - - librevenge::RVNGPropertyList &GetPropertyList(); -private: - OUString m_aName; - librevenge::RVNGPropertyList m_aPropertyList; - XMLStylesContext &m_rStyles; -}; - } // namespace exp } // namespace writerperfect diff --git a/writerperfect/source/writer/exp/xmlfmt.cxx b/writerperfect/source/writer/exp/xmlfmt.cxx index a4b0781c73f9..e33f299f5c0e 100644 --- a/writerperfect/source/writer/exp/xmlfmt.cxx +++ b/writerperfect/source/writer/exp/xmlfmt.cxx @@ -28,9 +28,7 @@ XMLStylesContext::XMLStylesContext(XMLImport &rImport, StyleType eType) m_rColumnStyles(eType == StyleType_AUTOMATIC ? mrImport.GetAutomaticColumnStyles() : mrImport.GetColumnStyles()), m_rRowStyles(eType == StyleType_AUTOMATIC ? mrImport.GetAutomaticRowStyles() : mrImport.GetRowStyles()), m_rTableStyles(eType == StyleType_AUTOMATIC ? mrImport.GetAutomaticTableStyles() : mrImport.GetTableStyles()), - m_rGraphicStyles(eType == StyleType_AUTOMATIC ? mrImport.GetAutomaticGraphicStyles() : mrImport.GetGraphicStyles()), - m_rPageLayouts(mrImport.GetPageLayouts()), - m_eType(eType) + m_rGraphicStyles(eType == StyleType_AUTOMATIC ? mrImport.GetAutomaticGraphicStyles() : mrImport.GetGraphicStyles()) { } @@ -38,10 +36,6 @@ rtl::Reference<XMLImportContext> XMLStylesContext::CreateChildContext(const OUSt { if (rName == "style:style") return new XMLStyleContext(mrImport, *this); - if (m_eType == StyleType_MASTER && rName == "style:master-page") - return new XMLMasterPageContext(mrImport, *this); - if (m_eType == StyleType_AUTOMATIC && rName == "style:page-layout") - return new XMLPageLayoutContext(mrImport, *this); return nullptr; } @@ -80,11 +74,6 @@ std::map<OUString, librevenge::RVNGPropertyList> &XMLStylesContext::GetCurrentGr return m_rGraphicStyles; } -std::map<OUString, librevenge::RVNGPropertyList> &XMLStylesContext::GetCurrentPageLayouts() -{ - return m_rPageLayouts; -} - /// Handler for <style:font-face>. class XMLFontFaceContext : public XMLImportContext { diff --git a/writerperfect/source/writer/exp/xmlfmt.hxx b/writerperfect/source/writer/exp/xmlfmt.hxx index 24ee493cd660..e66f37dc8846 100644 --- a/writerperfect/source/writer/exp/xmlfmt.hxx +++ b/writerperfect/source/writer/exp/xmlfmt.hxx @@ -21,15 +21,14 @@ namespace writerperfect namespace exp { -/// Handler for <office:automatic-styles>/<office:master-styles>/<office:styles>. +/// Handler for <office:automatic-styles>/<office:styles>. class XMLStylesContext : public XMLImportContext { public: enum StyleType { StyleType_NONE, - StyleType_AUTOMATIC, - StyleType_MASTER + StyleType_AUTOMATIC }; XMLStylesContext(XMLImport &rImport, StyleType eType); @@ -42,7 +41,6 @@ public: std::map<OUString, librevenge::RVNGPropertyList> &GetCurrentRowStyles(); std::map<OUString, librevenge::RVNGPropertyList> &GetCurrentTableStyles(); std::map<OUString, librevenge::RVNGPropertyList> &GetCurrentGraphicStyles(); - std::map<OUString, librevenge::RVNGPropertyList> &GetCurrentPageLayouts(); private: std::map<OUString, librevenge::RVNGPropertyList> &m_rParagraphStyles; std::map<OUString, librevenge::RVNGPropertyList> &m_rTextStyles; @@ -51,8 +49,6 @@ private: std::map<OUString, librevenge::RVNGPropertyList> &m_rRowStyles; std::map<OUString, librevenge::RVNGPropertyList> &m_rTableStyles; std::map<OUString, librevenge::RVNGPropertyList> &m_rGraphicStyles; - std::map<OUString, librevenge::RVNGPropertyList> &m_rPageLayouts; - StyleType m_eType; }; /// Handler for <office:font-face-decls>. diff --git a/writerperfect/source/writer/exp/xmlimp.cxx b/writerperfect/source/writer/exp/xmlimp.cxx index 6750019216e3..f8defce11dc4 100644 --- a/writerperfect/source/writer/exp/xmlimp.cxx +++ b/writerperfect/source/writer/exp/xmlimp.cxx @@ -255,8 +255,6 @@ rtl::Reference<XMLImportContext> XMLOfficeDocContext::CreateChildContext(const O return new XMLStylesContext(mrImport, XMLStylesContext::StyleType_NONE); if (rName == "office:font-face-decls") return new XMLFontFaceDeclsContext(mrImport); - if (rName == "office:master-styles") - return new XMLStylesContext(mrImport, XMLStylesContext::StyleType_MASTER); if (rName == "office:body") { if (mrImport.GetPageMetafiles().empty()) @@ -409,16 +407,6 @@ bool XMLImport::FillPopupData(const OUString &rURL, librevenge::RVNGPropertyList return false; } -void XMLImport::SetPageSpanOpened(bool bPageSpanOpened) -{ - mbPageSpanOpened = bPageSpanOpened; -} - -bool XMLImport::IsPageSpanOpened() const -{ - return mbPageSpanOpened; -} - const std::vector<std::pair<uno::Sequence<sal_Int8>, Size>> &XMLImport::GetPageMetafiles() const { return mrPageMetafiles; @@ -511,16 +499,6 @@ std::map<OUString, librevenge::RVNGPropertyList> &XMLImport::GetGraphicStyles() return maGraphicStyles; } -std::map<OUString, librevenge::RVNGPropertyList> &XMLImport::GetPageLayouts() -{ - return maPageLayouts; -} - -std::map<OUString, librevenge::RVNGPropertyList> &XMLImport::GetMasterPages() -{ - return maMasterPages; -} - void XMLImport::startDocument() { mrGenerator.startDocument(librevenge::RVNGPropertyList()); @@ -528,11 +506,6 @@ void XMLImport::startDocument() void XMLImport::endDocument() { - if (mbPageSpanOpened) - { - mrGenerator.closePageSpan(); - mbPageSpanOpened = false; - } mrGenerator.endDocument(); } diff --git a/writerperfect/source/writer/exp/xmlimp.hxx b/writerperfect/source/writer/exp/xmlimp.hxx index c5a84852603b..a6d2a49f1f59 100644 --- a/writerperfect/source/writer/exp/xmlimp.hxx +++ b/writerperfect/source/writer/exp/xmlimp.hxx @@ -54,15 +54,12 @@ class XMLImport : public cppu::WeakImplHelper std::map<OUString, librevenge::RVNGPropertyList> maTableStyles; std::map<OUString, librevenge::RVNGPropertyList> maAutomaticGraphicStyles; std::map<OUString, librevenge::RVNGPropertyList> maGraphicStyles; - std::map<OUString, librevenge::RVNGPropertyList> maPageLayouts; - std::map<OUString, librevenge::RVNGPropertyList> maMasterPages; librevenge::RVNGPropertyListVector maCoverImages; /// Author, date, etc -- overwrites what would be from the document out of the box. librevenge::RVNGPropertyList maMetaData; const css::uno::Reference<css::uno::XComponentContext> &mxContext; css::uno::Reference<css::uri::XUriReferenceFactory> mxUriReferenceFactory; OUString maMediaDir; - bool mbPageSpanOpened = false; const std::vector<std::pair<css::uno::Sequence<sal_Int8>, Size>> &mrPageMetafiles; public: @@ -85,13 +82,9 @@ public: std::map<OUString, librevenge::RVNGPropertyList> &GetRowStyles(); std::map<OUString, librevenge::RVNGPropertyList> &GetTableStyles(); std::map<OUString, librevenge::RVNGPropertyList> &GetGraphicStyles(); - std::map<OUString, librevenge::RVNGPropertyList> &GetPageLayouts(); - std::map<OUString, librevenge::RVNGPropertyList> &GetMasterPages(); const librevenge::RVNGPropertyListVector &GetCoverImages(); const librevenge::RVNGPropertyList &GetMetaData(); bool FillPopupData(const OUString &rURL, librevenge::RVNGPropertyList &rPropList); - void SetPageSpanOpened(bool bPageSpanOpened); - bool IsPageSpanOpened() const; const std::vector<std::pair<css::uno::Sequence<sal_Int8>, Size>> &GetPageMetafiles() const; const css::uno::Reference<css::uno::XComponentContext> &GetComponentContext() const; |