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

Noel (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 2 13:43:06 UTC 2020


 sc/source/filter/xml/XMLTableHeaderFooterContext.cxx |   40 ++++++-------------
 sc/source/filter/xml/XMLTableHeaderFooterContext.hxx |   12 +----
 2 files changed, 16 insertions(+), 36 deletions(-)

New commits:
commit d9e2e148e4fefbd796fd8e9d4d20f6e3fd9ebb29
Author:     Noel <noelgrandin at gmail.com>
AuthorDate: Wed Dec 2 11:10:31 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Dec 2 14:42:23 2020 +0100

    fastparser in XMLTableHeaderFooterContext
    
    Change-Id: I739ed833e8a23173561f2f843909a0eedb6b87ef
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107049
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
index 3d3d77d83627..3d2fc8c9ec72 100644
--- a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
+++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
@@ -96,7 +96,7 @@ XMLTableHeaderFooterContext::~XMLTableHeaderFooterContext()
 
 css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTableHeaderFooterContext::createFastChildContext(
     sal_Int32 nElement,
-    const css::uno::Reference< css::xml::sax::XFastAttributeList >& /*xAttrList*/ )
+    const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
 {
     if (xHeaderFooterContent.is())
     {
@@ -124,18 +124,8 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTableHeaderFooterCo
             return new XMLHeaderFooterRegionContext( GetImport(), xTempTextCursor);
         }
     }
-    return nullptr;
-}
-
-SvXMLImportContextRef XMLTableHeaderFooterContext::CreateChildContext(
-    sal_uInt16 nPrefix,
-    const OUString& rLocalName,
-    const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-{
-    SvXMLImportContext *pContext(nullptr);
 
-    if ((nPrefix == XML_NAMESPACE_TEXT) &&
-        IsXMLToken(rLocalName, XML_P))
+    if ( nElement == XML_ELEMENT(TEXT, XML_P) )
     {
         if (!xTextCursor.is())
         {
@@ -149,14 +139,14 @@ SvXMLImportContextRef XMLTableHeaderFooterContext::CreateChildContext(
                 bContainsCenter = true;
             }
         }
-        pContext =
+        return
             GetImport().GetTextImport()->CreateTextChildContext(GetImport(),
-                                                                    nPrefix,
-                                                                    rLocalName,
+                                                                    nElement,
                                                                     xAttrList);
     }
 
-    return pContext;
+    XMLOFF_WARN_UNKNOWN_ELEMENT("sc", nElement);
+    return nullptr;
 }
 
 void XMLTableHeaderFooterContext::endFastElement(sal_Int32 )
@@ -201,23 +191,19 @@ XMLHeaderFooterRegionContext::~XMLHeaderFooterRegionContext()
 {
 }
 
-SvXMLImportContextRef XMLHeaderFooterRegionContext::CreateChildContext(
-    sal_uInt16 nPrefix,
-    const OUString& rLocalName,
-    const uno::Reference< xml::sax::XAttributeList > & xAttrList )
+css::uno::Reference< css::xml::sax::XFastContextHandler > XMLHeaderFooterRegionContext::createFastChildContext(
+    sal_Int32 nElement,
+    const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
 {
     SvXMLImportContext *pContext(nullptr);
 
-    if ((nPrefix == XML_NAMESPACE_TEXT) &&
-        IsXMLToken(rLocalName, XML_P))
+    if (nElement == XML_ELEMENT(TEXT, XML_P))
     {
-        pContext =
-            GetImport().GetTextImport()->CreateTextChildContext(GetImport(),
-                                                                    nPrefix,
-                                                                    rLocalName,
+        return GetImport().GetTextImport()->CreateTextChildContext(GetImport(),
+                                                                    nElement,
                                                                     xAttrList);
     }
-
+    XMLOFF_WARN_UNKNOWN_ELEMENT("sc", nElement);
     return pContext;
 }
 
diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx b/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx
index 2b2138ec0988..84db39a0e2f5 100644
--- a/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx
+++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx
@@ -50,11 +50,6 @@ public:
 
     virtual ~XMLTableHeaderFooterContext() override;
 
-    virtual SvXMLImportContextRef CreateChildContext(
-            sal_uInt16 nPrefix,
-            const OUString& rLocalName,
-            const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override;
-
     virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
         sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
 
@@ -74,10 +69,9 @@ public:
 
     virtual ~XMLHeaderFooterRegionContext() override;
 
-    virtual SvXMLImportContextRef CreateChildContext(
-            sal_uInt16 nPrefix,
-            const OUString& rLocalName,
-            const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override;
+    virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
+        sal_Int32 nElement,
+        const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override;
 
     virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
 };


More information about the Libreoffice-commits mailing list