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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sun Nov 15 14:46:26 UTC 2020


 xmloff/inc/XMLReplacementImageContext.hxx         |    6 +++---
 xmloff/source/draw/XMLReplacementImageContext.cxx |   20 +++++++++-----------
 2 files changed, 12 insertions(+), 14 deletions(-)

New commits:
commit 0c14e5154c8931d96b2dfe1c1ab00c97d993f094
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sun Nov 15 11:51:57 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Nov 15 15:45:45 2020 +0100

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

diff --git a/xmloff/inc/XMLReplacementImageContext.hxx b/xmloff/inc/XMLReplacementImageContext.hxx
index 357c2c38f821..14a1e58355ee 100644
--- a/xmloff/inc/XMLReplacementImageContext.hxx
+++ b/xmloff/inc/XMLReplacementImageContext.hxx
@@ -47,9 +47,9 @@ public:
 
     virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
 
-    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;
 
 };
 
diff --git a/xmloff/source/draw/XMLReplacementImageContext.cxx b/xmloff/source/draw/XMLReplacementImageContext.cxx
index 6752875113cc..a096a4823d38 100644
--- a/xmloff/source/draw/XMLReplacementImageContext.cxx
+++ b/xmloff/source/draw/XMLReplacementImageContext.cxx
@@ -26,12 +26,14 @@
 #include <xmloff/namespacemap.hxx>
 #include <xmloff/XMLBase64ImportContext.hxx>
 #include <XMLReplacementImageContext.hxx>
+#include <sal/log.hxx>
 
 using ::com::sun::star::uno::Reference;
 using ::com::sun::star::uno::makeAny;
 using namespace ::com::sun::star::xml::sax;
 using namespace ::com::sun::star::beans;
 using namespace css;
+using namespace ::xmloff::token;
 
 XMLReplacementImageContext::XMLReplacementImageContext(
         SvXMLImport& rImport,
@@ -98,25 +100,21 @@ void XMLReplacementImageContext::endFastElement(sal_Int32 )
     }
 }
 
-SvXMLImportContextRef XMLReplacementImageContext::CreateChildContext(
-        sal_uInt16 nPrefix,
-        const OUString& rLocalName,
-        const Reference< XAttributeList > & xAttrList )
+css::uno::Reference< css::xml::sax::XFastContextHandler > XMLReplacementImageContext::createFastChildContext(
+    sal_Int32 nElement,
+    const css::uno::Reference< css::xml::sax::XFastAttributeList >&  )
 {
-    SvXMLImportContext *pContext = nullptr;
-
-    if( XML_NAMESPACE_OFFICE == nPrefix &&
-        IsXMLToken( rLocalName, ::xmloff::token::XML_BINARY_DATA ) &&
+    if( nElement == XML_ELEMENT(OFFICE, XML_BINARY_DATA) &&
         !m_xBase64Stream.is() )
     {
         m_xBase64Stream = GetImport().GetStreamForGraphicObjectURLFromBase64();
         if( m_xBase64Stream.is() )
-            pContext = new XMLBase64ImportContext( GetImport(), nPrefix,
-                                                    rLocalName, xAttrList,
+            return new XMLBase64ImportContext( GetImport(),
                                                     m_xBase64Stream );
     }
 
-    return pContext;
+    XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
+    return nullptr;
 }
 
 


More information about the Libreoffice-commits mailing list