diff options
author | Noel <noelgrandin@gmail.com> | 2020-12-01 10:30:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-12-01 18:00:29 +0100 |
commit | 22382bd480d40338207d5cb02787a37a72b95299 (patch) | |
tree | 1ce2a41fb9ecd8e74f45cb9f8188beea3b6cfd8a /xmloff/source | |
parent | bb5cf02fd2cdc8a2821361a05b8c96cf34a8be5b (diff) |
fastparser in XMLIndexTOCStylesContext
Change-Id: Ib5cd8684d08fb0a60d66921266fdbc912f3275af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106976
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 | 18 | ||||
-rw-r--r-- | xmloff/source/text/XMLIndexTOCStylesContext.hxx | 5 |
2 files changed, 10 insertions, 13 deletions
diff --git a/xmloff/source/text/XMLIndexTOCStylesContext.cxx b/xmloff/source/text/XMLIndexTOCStylesContext.cxx index d761027b57af..830369240e7c 100644 --- a/xmloff/source/text/XMLIndexTOCStylesContext.cxx +++ b/xmloff/source/text/XMLIndexTOCStylesContext.cxx @@ -54,29 +54,25 @@ XMLIndexTOCStylesContext::~XMLIndexTOCStylesContext() { } -void XMLIndexTOCStylesContext::StartElement( - const Reference<XAttributeList> & xAttrList ) +void XMLIndexTOCStylesContext::startFastElement( + sal_Int32 /*nElement*/, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) { // find text:outline-level attribute - 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_OUTLINE_LEVEL)) ) + if ( aIter.getToken() == XML_ELEMENT(TEXT, XML_OUTLINE_LEVEL) ) { sal_Int32 nTmp; if (::sax::Converter::convertNumber( - nTmp, xAttrList->getValueByIndex(nAttr), 1, + nTmp, aIter.toString(), 1, GetImport().GetTextImport()->GetChapterNumbering()-> getCount())) { // API numbers 0..9, we number 1..10 nOutlineLevel = nTmp-1; } + break; } } } diff --git a/xmloff/source/text/XMLIndexTOCStylesContext.hxx b/xmloff/source/text/XMLIndexTOCStylesContext.hxx index bf18d7e64d71..fe588b933112 100644 --- a/xmloff/source/text/XMLIndexTOCStylesContext.hxx +++ b/xmloff/source/text/XMLIndexTOCStylesContext.hxx @@ -60,8 +60,9 @@ public: protected: - virtual void StartElement( - const css::uno::Reference<css::xml::sax::XAttributeList> & xAttrList) override; + virtual void SAL_CALL startFastElement( + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override; virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; |