[Libreoffice-commits] core.git: include/xmloff xmloff/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 26 09:46:51 UTC 2020


 include/xmloff/XMLShapeStyleContext.hxx         |    7 ----
 include/xmloff/XMLTextShapeStyleContext.hxx     |    4 --
 xmloff/source/draw/XMLShapeStyleContext.cxx     |   12 --------
 xmloff/source/draw/ximpstyl.cxx                 |   35 +++++-------------------
 xmloff/source/draw/ximpstyl.hxx                 |    3 --
 xmloff/source/text/XMLTextShapeStyleContext.cxx |   10 ------
 6 files changed, 8 insertions(+), 63 deletions(-)

New commits:
commit 5f691db859b277fb7f185cddeace981169e1180e
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Aug 26 10:02:56 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Aug 26 11:46:12 2020 +0200

    use more fastparser in SdXMLMasterPageContext
    
    and drop some unused code
    
    Change-Id: I4ed57ab843759e2214ad2b679003fcc329c073ea
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101382
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/xmloff/XMLShapeStyleContext.hxx b/include/xmloff/XMLShapeStyleContext.hxx
index 4a7eef147b36..93e0ffa72031 100644
--- a/include/xmloff/XMLShapeStyleContext.hxx
+++ b/include/xmloff/XMLShapeStyleContext.hxx
@@ -42,13 +42,6 @@ protected:
                                const OUString& rValue ) override;
 public:
 
-    XMLShapeStyleContext(
-        SvXMLImport& rImport,
-        sal_uInt16 nPrfx,
-        const OUString& rLName,
-        const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList,
-        SvXMLStylesContext& rStyles,
-        XmlStyleFamily nFamily);
     XMLShapeStyleContext(
         SvXMLImport& rImport,
         sal_Int32 nElement,
diff --git a/include/xmloff/XMLTextShapeStyleContext.hxx b/include/xmloff/XMLTextShapeStyleContext.hxx
index 2e21c1846309..531e81da0377 100644
--- a/include/xmloff/XMLTextShapeStyleContext.hxx
+++ b/include/xmloff/XMLTextShapeStyleContext.hxx
@@ -36,10 +36,6 @@ class XMLOFF_DLLPUBLIC XMLTextShapeStyleContext final : public XMLShapeStyleCont
 public:
 
 
-    XMLTextShapeStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
-            const OUString& rLName,
-            const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList,
-            SvXMLStylesContext& rStyles, XmlStyleFamily nFamily );
     XMLTextShapeStyleContext( SvXMLImport& rImport, sal_Int32 nElement,
             const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList,
             SvXMLStylesContext& rStyles, XmlStyleFamily nFamily );
diff --git a/xmloff/source/draw/XMLShapeStyleContext.cxx b/xmloff/source/draw/XMLShapeStyleContext.cxx
index beddcb202321..b10ef865ec2d 100644
--- a/xmloff/source/draw/XMLShapeStyleContext.cxx
+++ b/xmloff/source/draw/XMLShapeStyleContext.cxx
@@ -48,18 +48,6 @@ using ::xmloff::token::XML_GRAPHIC_PROPERTIES;
 using ::xmloff::token::XML_PARAGRAPH_PROPERTIES;
 
 
-XMLShapeStyleContext::XMLShapeStyleContext(
-    SvXMLImport& rImport,
-    sal_uInt16 nPrfx,
-    const OUString& rLName,
-    const uno::Reference< xml::sax::XAttributeList >& xAttrList,
-    SvXMLStylesContext& rStyles,
-    XmlStyleFamily nFamily)
-:   XMLPropStyleContext(rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ),
-    m_bIsNumRuleAlreadyConverted( false )
-{
-}
-
 XMLShapeStyleContext::XMLShapeStyleContext(
     SvXMLImport& rImport,
     sal_Int32 nElement,
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index 82eac74740cd..66db57439674 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -825,48 +825,29 @@ void SdXMLMasterPageContext::endFastElement(sal_Int32 nElement)
     GetImport().GetShapeImport()->endPage(GetLocalShapesContext());
 }
 
-SvXMLImportContextRef SdXMLMasterPageContext::CreateChildContext(
-    sal_uInt16 nPrefix,
-    const OUString& rLocalName,
-    const uno::Reference< xml::sax::XAttributeList>& xAttrList )
+css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLMasterPageContext::createFastChildContext(
+    sal_Int32 nElement,
+    const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
 {
-    SvXMLImportContextRef xContext;
-    const SvXMLTokenMap& rTokenMap = GetSdImport().GetMasterPageElemTokenMap();
-
-    // some special objects inside style:masterpage context
-    switch(rTokenMap.Get(nPrefix, rLocalName))
+    switch (nElement)
     {
-        case XML_TOK_MASTERPAGE_STYLE:
+        // some special objects inside style:masterpage context
+        case XML_ELEMENT(STYLE, XML_STYLE):
         {
             if(GetSdImport().GetShapeImport()->GetStylesContext())
             {
                 // style:style inside master-page context -> presentation style
                 XMLShapeStyleContext* pNew = new XMLShapeStyleContext(
-                    GetSdImport(), nPrefix, rLocalName, xAttrList,
+                    GetSdImport(), nElement, xAttrList,
                     *GetSdImport().GetShapeImport()->GetStylesContext(),
                     XmlStyleFamily::SD_PRESENTATION_ID);
 
                 // add this style to the outer StylesContext class for later processing
-                xContext = pNew;
                 GetSdImport().GetShapeImport()->GetStylesContext()->AddStyle(*pNew);
+                return pNew;
             }
             break;
         }
-    }
-
-    // call base class
-    if (!xContext)
-        xContext = SdXMLGenericPageContext::CreateChildContext(nPrefix, rLocalName, xAttrList);
-
-    return xContext;
-}
-
-css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLMasterPageContext::createFastChildContext(
-    sal_Int32 nElement,
-    const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
-{
-    switch (nElement)
-    {
         case XML_ELEMENT(PRESENTATION, XML_NOTES):
         {
             if( GetSdImport().IsImpress() )
diff --git a/xmloff/source/draw/ximpstyl.hxx b/xmloff/source/draw/ximpstyl.hxx
index 13a11dda6c5b..761927133797 100644
--- a/xmloff/source/draw/ximpstyl.hxx
+++ b/xmloff/source/draw/ximpstyl.hxx
@@ -107,9 +107,6 @@ public:
     virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
         sal_Int32 nElement,
         const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
-    virtual SvXMLImportContextRef CreateChildContext(
-        sal_uInt16 nPrefix, const OUString& rLocalName,
-        const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
 
     virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
 
diff --git a/xmloff/source/text/XMLTextShapeStyleContext.cxx b/xmloff/source/text/XMLTextShapeStyleContext.cxx
index 4825aea63a5f..77363e0eaacf 100644
--- a/xmloff/source/text/XMLTextShapeStyleContext.cxx
+++ b/xmloff/source/text/XMLTextShapeStyleContext.cxx
@@ -142,16 +142,6 @@ void XMLTextShapeStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
 
 const OUStringLiteral gsIsAutoUpdate( "IsAutoUpdate" );
 
-XMLTextShapeStyleContext::XMLTextShapeStyleContext( SvXMLImport& rImport,
-        sal_uInt16 nPrfx, const OUString& rLName,
-        const Reference< XAttributeList > & xAttrList,
-        SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ) :
-    XMLShapeStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles,
-                          nFamily ),
-    bAutoUpdate( false )
-{
-}
-
 XMLTextShapeStyleContext::XMLTextShapeStyleContext( SvXMLImport& rImport,
         sal_Int32 nElement,
         const Reference< XFastAttributeList > & xAttrList,


More information about the Libreoffice-commits mailing list