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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Jan 9 13:04:10 UTC 2020


 xmloff/source/text/XMLAutoTextContainerEventImport.cxx |    4 +---
 xmloff/source/text/XMLAutoTextContainerEventImport.hxx |    7 +++++--
 xmloff/source/text/XMLAutoTextEventImport.cxx          |   17 +++++++----------
 xmloff/source/text/XMLAutoTextEventImport.hxx          |    6 ++----
 4 files changed, 15 insertions(+), 19 deletions(-)

New commits:
commit b8f932e1df1efb230230ab1f1b9c8cfc822a0f4c
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jan 9 12:01:55 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Jan 9 14:03:33 2020 +0100

    convert XMLAutoTextEventImport to FastParser APIs
    
    Change-Id: If0249a9987a42c700f994073bc649774ae84f510
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86477
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/xmloff/source/text/XMLAutoTextContainerEventImport.cxx b/xmloff/source/text/XMLAutoTextContainerEventImport.cxx
index 39164f5960b7..657a7bdbe158 100644
--- a/xmloff/source/text/XMLAutoTextContainerEventImport.cxx
+++ b/xmloff/source/text/XMLAutoTextContainerEventImport.cxx
@@ -38,10 +38,8 @@ using ::xmloff::token::XML_EVENT_LISTENERS;
 
 XMLAutoTextContainerEventImport::XMLAutoTextContainerEventImport(
     SvXMLImport& rImport,
-    sal_uInt16 nPrfx,
-    const OUString& rLName,
     const Reference<XNameReplace> & rEvnts ) :
-        SvXMLImportContext(rImport, nPrfx, rLName),
+        SvXMLImportContext(rImport),
         rEvents(rEvnts)
 {
 }
diff --git a/xmloff/source/text/XMLAutoTextContainerEventImport.hxx b/xmloff/source/text/XMLAutoTextContainerEventImport.hxx
index 4ddfecd301ff..69923aded3ba 100644
--- a/xmloff/source/text/XMLAutoTextContainerEventImport.hxx
+++ b/xmloff/source/text/XMLAutoTextContainerEventImport.hxx
@@ -44,8 +44,6 @@ public:
 
     XMLAutoTextContainerEventImport(
         SvXMLImport& rImport,
-        sal_uInt16 nPrfx,
-        const OUString& rLName,
         const css::uno::Reference<css::container::XNameReplace > & rEvents );
 
     virtual ~XMLAutoTextContainerEventImport() override;
@@ -53,6 +51,11 @@ public:
 
 protected:
 
+    virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL
+        createFastChildContext(sal_Int32 /*nElement*/,
+            const css::uno::Reference< css::xml::sax::XFastAttributeList > & /*rxAttribs*/) override
+    { return nullptr; }
+
     virtual SvXMLImportContextRef CreateChildContext(
         sal_uInt16 nPrefix,
         const OUString& rLocalName,
diff --git a/xmloff/source/text/XMLAutoTextEventImport.cxx b/xmloff/source/text/XMLAutoTextEventImport.cxx
index 818f52ef4818..f12921c8a28e 100644
--- a/xmloff/source/text/XMLAutoTextEventImport.cxx
+++ b/xmloff/source/text/XMLAutoTextEventImport.cxx
@@ -19,7 +19,7 @@
 
 #include "XMLAutoTextEventImport.hxx"
 #include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
 #include <com/sun/star/document/XEventsSupplier.hpp>
 #include <com/sun/star/uno/XInterface.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -84,20 +84,17 @@ void XMLAutoTextEventImport::initialize(
 }
 
 
-SvXMLImportContext* XMLAutoTextEventImport::CreateDocumentContext(
-    sal_uInt16 nPrefix,
-    const OUString& rLocalName,
-    const Reference<XAttributeList > & xAttrList )
+SvXMLImportContext* XMLAutoTextEventImport::CreateFastContext(
+    sal_Int32 nElement,
+    const Reference<css::xml::sax::XFastAttributeList> & xAttrList )
 {
-    if ( xEvents.is() && (XML_NAMESPACE_OOO == nPrefix) &&
-         IsXMLToken( rLocalName, XML_AUTO_TEXT_EVENTS) )
+    if ( xEvents.is() && nElement == XML_ELEMENT(OOO, XML_AUTO_TEXT_EVENTS) )
     {
-        return new XMLAutoTextContainerEventImport(
-            *this, nPrefix, rLocalName, xEvents);
+        return new XMLAutoTextContainerEventImport(*this, xEvents);
     }
     else
     {
-        return SvXMLImport::CreateDocumentContext(nPrefix, rLocalName, xAttrList);
+        return SvXMLImport::CreateFastContext(nElement, xAttrList);
     }
 }
 
diff --git a/xmloff/source/text/XMLAutoTextEventImport.hxx b/xmloff/source/text/XMLAutoTextEventImport.hxx
index c5ad2fb1467c..bc612eaae234 100644
--- a/xmloff/source/text/XMLAutoTextEventImport.hxx
+++ b/xmloff/source/text/XMLAutoTextEventImport.hxx
@@ -52,10 +52,8 @@ public:
 
 protected:
 
-    virtual SvXMLImportContext* CreateDocumentContext(
-        sal_uInt16 nPrefix,
-        const OUString& rLocalName,
-        const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override;
+    virtual SvXMLImportContext *CreateFastContext( sal_Int32 Element,
+        const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList >& xAttrList ) override;
 
 };
 


More information about the Libreoffice-commits mailing list