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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 25 07:07:30 UTC 2020


 xmloff/source/draw/ximpstyl.cxx |   32 +++++++-------------------------
 xmloff/source/draw/ximpstyl.hxx |    4 ----
 2 files changed, 7 insertions(+), 29 deletions(-)

New commits:
commit ef6d80e85748f090d02e396148462594a93cabc3
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Aug 24 22:44:31 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Aug 25 09:06:44 2020 +0200

    use more fastparser in SdXMLStylesContext
    
    Change-Id: I251833e14b96729ce754912fd4bfc68fe2e57299
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101294
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index 4d3f25ae173a..6e9bdeb94e29 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -925,34 +925,16 @@ SvXMLStyleContext* SdXMLStylesContext::CreateStyleChildContext(
         case XML_ELEMENT(NUMBER, XML_TEXT_STYLE):
             return new SvXMLNumFormatContext( GetSdImport(), nElement,
                                             mpNumFmtHelper->getData(), SvXMLStylesTokens::TEXT_STYLE, xAttrList, *this );
-     }
-
-    // call base class
-    return SvXMLStylesContext::CreateStyleChildContext(nElement, xAttrList);
-}
-
-SvXMLStyleContext* SdXMLStylesContext::CreateStyleChildContext(
-    sal_uInt16 nPrefix,
-    const OUString& rLocalName,
-    const uno::Reference< xml::sax::XAttributeList >& xAttrList)
-{
-    SvXMLStyleContext* pContext = nullptr;
-
-    if(nPrefix == XML_NAMESPACE_PRESENTATION )
-    {
-        if( IsXMLToken( rLocalName, XML_HEADER_DECL ) ||
-            IsXMLToken( rLocalName, XML_FOOTER_DECL ) ||
-            IsXMLToken( rLocalName, XML_DATE_TIME_DECL ) )
-        {
-            pContext = new SdXMLHeaderFooterDeclContext( GetImport(), nPrefix, rLocalName, xAttrList );
-        }
+        case XML_ELEMENT(PRESENTATION, XML_HEADER_DECL):
+        case XML_ELEMENT(PRESENTATION, XML_FOOTER_DECL):
+        case XML_ELEMENT(PRESENTATION, XML_DATE_TIME_DECL):
+            return new SdXMLHeaderFooterDeclContext( GetImport(), xAttrList );
+        default:
+            SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
     }
 
     // call base class
-    if(!pContext)
-        pContext = SvXMLStylesContext::CreateStyleChildContext(nPrefix, rLocalName, xAttrList);
-
-    return pContext;
+    return SvXMLStylesContext::CreateStyleChildContext(nElement, xAttrList);
 }
 
 SvXMLStyleContext* SdXMLStylesContext::CreateStyleStyleChildContext(
diff --git a/xmloff/source/draw/ximpstyl.hxx b/xmloff/source/draw/ximpstyl.hxx
index 818a9e043594..cd8c9f225910 100644
--- a/xmloff/source/draw/ximpstyl.hxx
+++ b/xmloff/source/draw/ximpstyl.hxx
@@ -183,10 +183,6 @@ class SdXMLStylesContext : public SvXMLStylesContext
 
 protected:
     using SvXMLStylesContext::CreateStyleChildContext;
-    virtual SvXMLStyleContext* CreateStyleChildContext(
-        sal_uInt16 nPrefix,
-        const OUString& rLocalName,
-        const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList) override;
     virtual SvXMLStyleContext* CreateStyleChildContext(
         sal_Int32 nElement,
         const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList) override;


More information about the Libreoffice-commits mailing list