xmloff/source/text/XMLIndexTOCStylesContext.cxx | 23 ++++++++--------------- xmloff/source/text/XMLIndexTOCStylesContext.hxx | 7 +++---- 2 files changed, 11 insertions(+), 19 deletions(-)
New commits: commit dba2a0435fb8aa1c5a312261fc10959e824230c6 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Tue Nov 24 20:27:03 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Nov 25 08:56:57 2020 +0100 fastparser in XMLIndexTOCStylesContext Change-Id: I59f6a044da134fe1ce6ffe415df518dce9272b53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106549 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/xmloff/source/text/XMLIndexTOCStylesContext.cxx b/xmloff/source/text/XMLIndexTOCStylesContext.cxx index 36621df0770e..d761027b57af 100644 --- a/xmloff/source/text/XMLIndexTOCStylesContext.cxx +++ b/xmloff/source/text/XMLIndexTOCStylesContext.cxx @@ -106,27 +106,20 @@ void XMLIndexTOCStylesContext::endFastElement(sal_Int32 ) xIndexReplace->replaceByIndex(nOutlineLevel, Any(aStyleNamesSequence)); } -SvXMLImportContextRef XMLIndexTOCStylesContext::CreateChildContext( - sal_uInt16 p_nPrefix, - const OUString& rLocalName, - const Reference<XAttributeList> & xAttrList ) +css::uno::Reference< css::xml::sax::XFastContextHandler > XMLIndexTOCStylesContext::createFastChildContext( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) { // check for index-source-style - if ( (XML_NAMESPACE_TEXT == p_nPrefix) && - IsXMLToken( rLocalName, XML_INDEX_SOURCE_STYLE ) ) + if ( nElement == XML_ELEMENT(TEXT, XML_INDEX_SOURCE_STYLE) ) { // find text:style-name attribute and record in aStyleNames - sal_Int16 nCount = xAttrList->getLength(); - for(sal_Int16 nAttr = 0; nAttr < nCount; nAttr++) + for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) { - OUString sLocalName; - sal_uInt16 nPrefix = GetImport().GetNamespaceMap(). - GetKeyByAttrName( xAttrList->getNameByIndex(nAttr), - &sLocalName ); - if ( (XML_NAMESPACE_TEXT == nPrefix) && - IsXMLToken( sLocalName, XML_STYLE_NAME ) ) + if ( aIter.getToken() == XML_ELEMENT(TEXT, XML_STYLE_NAME) ) { - aStyleNames.push_back(xAttrList->getValueByIndex(nAttr)); + aStyleNames.push_back(aIter.toString()); + break; } } } diff --git a/xmloff/source/text/XMLIndexTOCStylesContext.hxx b/xmloff/source/text/XMLIndexTOCStylesContext.hxx index 6714c828709c..bf18d7e64d71 100644 --- a/xmloff/source/text/XMLIndexTOCStylesContext.hxx +++ b/xmloff/source/text/XMLIndexTOCStylesContext.hxx @@ -65,10 +65,9 @@ protected: virtual void SAL_CALL endFastElement(sal_Int32 nElement) 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 >& xAttrList ) override; }; #endif _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits