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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 19 09:03:12 UTC 2020


 xmloff/source/chart/SchXMLParagraphContext.cxx |   24 +++++++++++-------------
 xmloff/source/chart/SchXMLParagraphContext.hxx |    7 +++----
 2 files changed, 14 insertions(+), 17 deletions(-)

New commits:
commit 2cf83fe6051ba7e1b6cb66a4bd71a15f0bd0ad27
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Wed Nov 18 19:41:24 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Nov 19 10:02:36 2020 +0100

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

diff --git a/xmloff/source/chart/SchXMLParagraphContext.cxx b/xmloff/source/chart/SchXMLParagraphContext.cxx
index 85c360d17d84..84e22c5a5c71 100644
--- a/xmloff/source/chart/SchXMLParagraphContext.cxx
+++ b/xmloff/source/chart/SchXMLParagraphContext.cxx
@@ -81,22 +81,20 @@ void SchXMLParagraphContext::endFastElement(sal_Int32 )
     mrText = maBuffer.makeStringAndClear();
 }
 
-SvXMLImportContextRef SchXMLParagraphContext::CreateChildContext(
-    sal_uInt16 nPrefix,
-    const OUString& rLocalName,
-    const uno::Reference< xml::sax::XAttributeList >& )
+css::uno::Reference< css::xml::sax::XFastContextHandler > SchXMLParagraphContext::createFastChildContext(
+    sal_Int32 nElement,
+    const css::uno::Reference< css::xml::sax::XFastAttributeList >&  )
 {
-    if( nPrefix == XML_NAMESPACE_TEXT )
+    if( nElement == XML_ELEMENT(TEXT, XML_TAB_STOP) )
     {
-        if( rLocalName == ::xmloff::token::GetXMLToken( ::xmloff::token::XML_TAB_STOP ))
-        {
-            maBuffer.append( u'\x0009');  // tabulator
-        }
-        else if( rLocalName == ::xmloff::token::GetXMLToken( ::xmloff::token::XML_LINE_BREAK ))
-        {
-            maBuffer.append( u'\x000A');  // linefeed
-        }
+        maBuffer.append( u'\x0009');  // tabulator
+    }
+    else if( nElement == XML_ELEMENT(TEXT, XML_LINE_BREAK) )
+    {
+        maBuffer.append( u'\x000A');  // linefeed
     }
+    else
+        XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
 
     return nullptr;
 }
diff --git a/xmloff/source/chart/SchXMLParagraphContext.hxx b/xmloff/source/chart/SchXMLParagraphContext.hxx
index d9db36a916fc..9ae5d5a42264 100644
--- a/xmloff/source/chart/SchXMLParagraphContext.hxx
+++ b/xmloff/source/chart/SchXMLParagraphContext.hxx
@@ -46,10 +46,9 @@ public:
     virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
     virtual void SAL_CALL characters( const OUString& rChars ) 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;
 };
 
 #endif // INCLUDED_XMLOFF_SOURCE_CHART_SCHXMLPARAGRAPHCONTEXT_HXX


More information about the Libreoffice-commits mailing list