From b8f932e1df1efb230230ab1f1b9c8cfc822a0f4c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 9 Jan 2020 12:01:55 +0200 Subject: convert XMLAutoTextEventImport to FastParser APIs Change-Id: If0249a9987a42c700f994073bc649774ae84f510 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86477 Tested-by: Jenkins Reviewed-by: Noel Grandin --- 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(-) (limited to 'xmloff') 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 & 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 & 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 -#include +#include #include #include #include @@ -84,20 +84,17 @@ void XMLAutoTextEventImport::initialize( } -SvXMLImportContext* XMLAutoTextEventImport::CreateDocumentContext( - sal_uInt16 nPrefix, - const OUString& rLocalName, - const Reference & xAttrList ) +SvXMLImportContext* XMLAutoTextEventImport::CreateFastContext( + sal_Int32 nElement, + const Reference & 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; }; -- cgit