diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-11-24 20:27:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-25 08:56:57 +0100 |
commit | dba2a0435fb8aa1c5a312261fc10959e824230c6 (patch) | |
tree | 51ecbe4bbc762537b4cae5cffec937ffb285aee4 /xmloff/source | |
parent | b563b61af9a8d9917845f52d2058b7d18ec6cdce (diff) |
fastparser in XMLIndexTOCStylesContext
Change-Id: I59f6a044da134fe1ce6ffe415df518dce9272b53
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106549
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/text/XMLIndexTOCStylesContext.cxx | 23 | ||||
-rw-r--r-- | xmloff/source/text/XMLIndexTOCStylesContext.hxx | 7 |
2 files changed, 11 insertions, 19 deletions
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 |