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

Noel (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 19 18:32:46 UTC 2020


 xmloff/source/text/XMLChangedRegionImportContext.cxx  |    7 +-----
 xmloff/source/text/XMLChangedRegionImportContext.hxx  |    5 ----
 xmloff/source/text/XMLTrackedChangesImportContext.cxx |   20 +++++++-----------
 xmloff/source/text/XMLTrackedChangesImportContext.hxx |    6 +----
 4 files changed, 13 insertions(+), 25 deletions(-)

New commits:
commit d242a68868efcacbbcb733a1f9fbfd5854e7724e
Author:     Noel <noelgrandin at gmail.com>
AuthorDate: Thu Nov 19 15:46:22 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Nov 19 19:32:04 2020 +0100

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

diff --git a/xmloff/source/text/XMLChangedRegionImportContext.cxx b/xmloff/source/text/XMLChangedRegionImportContext.cxx
index 9b4723b3d4df..8f815c3a7f75 100644
--- a/xmloff/source/text/XMLChangedRegionImportContext.cxx
+++ b/xmloff/source/text/XMLChangedRegionImportContext.cxx
@@ -39,11 +39,8 @@ using namespace ::com::sun::star;
 using ::com::sun::star::xml::sax::XAttributeList;
 
 
-XMLChangedRegionImportContext::XMLChangedRegionImportContext(
-    SvXMLImport& rImport,
-    sal_uInt16 nPrefix,
-    const OUString& rLocalName) :
-        SvXMLImportContext(rImport, nPrefix, rLocalName),
+XMLChangedRegionImportContext::XMLChangedRegionImportContext(SvXMLImport& rImport) :
+        SvXMLImportContext(rImport),
         bMergeLastPara(true)
 {
 }
diff --git a/xmloff/source/text/XMLChangedRegionImportContext.hxx b/xmloff/source/text/XMLChangedRegionImportContext.hxx
index 24501e9508d1..2ef452b2b201 100644
--- a/xmloff/source/text/XMLChangedRegionImportContext.hxx
+++ b/xmloff/source/text/XMLChangedRegionImportContext.hxx
@@ -53,10 +53,7 @@ class XMLChangedRegionImportContext : public SvXMLImportContext
 public:
 
 
-    XMLChangedRegionImportContext(
-        SvXMLImport& rImport,
-        sal_uInt16 nPrefix,
-        const OUString& rLocalName);
+    XMLChangedRegionImportContext(SvXMLImport& rImport);
 
     virtual ~XMLChangedRegionImportContext() override;
 
diff --git a/xmloff/source/text/XMLTrackedChangesImportContext.cxx b/xmloff/source/text/XMLTrackedChangesImportContext.cxx
index aef86064486e..fa29ed331d84 100644
--- a/xmloff/source/text/XMLTrackedChangesImportContext.cxx
+++ b/xmloff/source/text/XMLTrackedChangesImportContext.cxx
@@ -25,6 +25,7 @@
 #include <xmloff/xmlnamespace.hxx>
 #include <xmloff/namespacemap.hxx>
 #include <xmloff/xmltoken.hxx>
+#include <sal/log.hxx>
 
 
 using ::com::sun::star::uno::Reference;
@@ -76,21 +77,16 @@ void XMLTrackedChangesImportContext::StartElement(
 }
 
 
-SvXMLImportContextRef XMLTrackedChangesImportContext::CreateChildContext(
-    sal_uInt16 nPrefix,
-    const OUString& rLocalName,
-    const Reference<XAttributeList> & /*xAttrList*/)
+css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTrackedChangesImportContext::createFastChildContext(
+    sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >&  )
 {
-    SvXMLImportContextRef xContext;
-
-    if ( (XML_NAMESPACE_TEXT == nPrefix) &&
-         IsXMLToken( rLocalName, XML_CHANGED_REGION ) )
+    if ( nElement == XML_ELEMENT(TEXT, XML_CHANGED_REGION) )
     {
-        xContext = new XMLChangedRegionImportContext(GetImport(),
-                                                     nPrefix, rLocalName);
+        return new XMLChangedRegionImportContext(GetImport());
     }
-
-    return xContext;
+    else
+        XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
+    return nullptr;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/text/XMLTrackedChangesImportContext.hxx b/xmloff/source/text/XMLTrackedChangesImportContext.hxx
index 5e2af606b644..8a07d788cbed 100644
--- a/xmloff/source/text/XMLTrackedChangesImportContext.hxx
+++ b/xmloff/source/text/XMLTrackedChangesImportContext.hxx
@@ -46,10 +46,8 @@ public:
     virtual void StartElement(
         const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) 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


More information about the Libreoffice-commits mailing list