diff options
author | Noel <noelgrandin@gmail.com> | 2020-12-02 11:10:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-12-02 14:42:23 +0100 |
commit | d9e2e148e4fefbd796fd8e9d4d20f6e3fd9ebb29 (patch) | |
tree | 5be26ea69a8f9fac64899f99032202aaf3c691cb /sc | |
parent | 6c905031ed279659edebca24d8929c733c9600b9 (diff) |
fastparser in XMLTableHeaderFooterContext
Change-Id: I739ed833e8a23173561f2f843909a0eedb6b87ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107049
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/XMLTableHeaderFooterContext.cxx | 40 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLTableHeaderFooterContext.hxx | 12 |
2 files changed, 16 insertions, 36 deletions
diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx index 3d3d77d83627..3d2fc8c9ec72 100644 --- a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx +++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx @@ -96,7 +96,7 @@ XMLTableHeaderFooterContext::~XMLTableHeaderFooterContext() css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTableHeaderFooterContext::createFastChildContext( sal_Int32 nElement, - const css::uno::Reference< css::xml::sax::XFastAttributeList >& /*xAttrList*/ ) + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) { if (xHeaderFooterContent.is()) { @@ -124,18 +124,8 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTableHeaderFooterCo return new XMLHeaderFooterRegionContext( GetImport(), xTempTextCursor); } } - return nullptr; -} - -SvXMLImportContextRef XMLTableHeaderFooterContext::CreateChildContext( - sal_uInt16 nPrefix, - const OUString& rLocalName, - const uno::Reference< xml::sax::XAttributeList > & xAttrList ) -{ - SvXMLImportContext *pContext(nullptr); - if ((nPrefix == XML_NAMESPACE_TEXT) && - IsXMLToken(rLocalName, XML_P)) + if ( nElement == XML_ELEMENT(TEXT, XML_P) ) { if (!xTextCursor.is()) { @@ -149,14 +139,14 @@ SvXMLImportContextRef XMLTableHeaderFooterContext::CreateChildContext( bContainsCenter = true; } } - pContext = + return GetImport().GetTextImport()->CreateTextChildContext(GetImport(), - nPrefix, - rLocalName, + nElement, xAttrList); } - return pContext; + XMLOFF_WARN_UNKNOWN_ELEMENT("sc", nElement); + return nullptr; } void XMLTableHeaderFooterContext::endFastElement(sal_Int32 ) @@ -201,23 +191,19 @@ XMLHeaderFooterRegionContext::~XMLHeaderFooterRegionContext() { } -SvXMLImportContextRef XMLHeaderFooterRegionContext::CreateChildContext( - sal_uInt16 nPrefix, - const OUString& rLocalName, - const uno::Reference< xml::sax::XAttributeList > & xAttrList ) +css::uno::Reference< css::xml::sax::XFastContextHandler > XMLHeaderFooterRegionContext::createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) { SvXMLImportContext *pContext(nullptr); - if ((nPrefix == XML_NAMESPACE_TEXT) && - IsXMLToken(rLocalName, XML_P)) + if (nElement == XML_ELEMENT(TEXT, XML_P)) { - pContext = - GetImport().GetTextImport()->CreateTextChildContext(GetImport(), - nPrefix, - rLocalName, + return GetImport().GetTextImport()->CreateTextChildContext(GetImport(), + nElement, xAttrList); } - + XMLOFF_WARN_UNKNOWN_ELEMENT("sc", nElement); return pContext; } diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx b/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx index 2b2138ec0988..84db39a0e2f5 100644 --- a/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx +++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx @@ -50,11 +50,6 @@ public: virtual ~XMLTableHeaderFooterContext() 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; @@ -74,10 +69,9 @@ public: virtual ~XMLHeaderFooterRegionContext() 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 >& ) override; virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; }; |