diff options
author | Noel <noelgrandin@gmail.com> | 2020-11-30 14:58:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-30 17:19:14 +0100 |
commit | 93ab6a682d19bc1cc1b4e5913b6fc16f054ef2d8 (patch) | |
tree | b7a5cdf37fdd6a3ea351bc9150c2c2f988b359e3 /xmloff/source | |
parent | b208621f4ac5dc1ae40cb853f8662e8b10434cdc (diff) |
fastparser in SchXMLDataLabelContext
Change-Id: I373f8cc91e4e8eea470cd81b439de2ef66d8a3b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106864
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/chart/SchXMLPlotAreaContext.cxx | 34 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLPlotAreaContext.hxx | 4 |
2 files changed, 19 insertions, 19 deletions
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 2fe188eab45f..d43e6e2fef91 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -633,38 +633,36 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SchXMLDataLabelContext return nullptr; } -void SchXMLDataLabelContext::StartElement(const uno::Reference<xml::sax::XAttributeList>& xAttrList) +void SchXMLDataLabelContext::startFastElement( + sal_Int32 /*nElement*/, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) { - const SvXMLNamespaceMap& rMap = GetImport().GetNamespaceMap(); - const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; - for (sal_Int16 i = 0; i < nAttrCount; i++) + for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) { - const OUString& rAttrName = xAttrList->getNameByIndex(i); - OUString aLocalName; - sal_uInt16 nPrefix = rMap.GetKeyByAttrName(rAttrName, &aLocalName); - const OUString sValue(xAttrList->getValueByIndex(i)); - - if (nPrefix == XML_NAMESPACE_SVG) + OUString sValue = aIter.toString(); + switch(aIter.getToken()) { - if (IsXMLToken(aLocalName, XML_X)) + case XML_ELEMENT(SVG, XML_X): + case XML_ELEMENT(SVG_COMPAT, XML_X): { sal_Int32 nResultValue; GetImport().GetMM100UnitConverter().convertMeasureToCore(nResultValue, sValue); mrDataLabelStyle.mo_nLabelAbsolutePosX = nResultValue; + break; } - else if (IsXMLToken(aLocalName, XML_Y)) + case XML_ELEMENT(SVG, XML_Y): + case XML_ELEMENT(SVG_COMPAT, XML_Y): { sal_Int32 nResultValue; GetImport().GetMM100UnitConverter().convertMeasureToCore(nResultValue, sValue); mrDataLabelStyle.mo_nLabelAbsolutePosY = nResultValue; + break; } - } - else if (nPrefix == XML_NAMESPACE_CHART) - { - if (IsXMLToken(aLocalName, XML_STYLE_NAME)) - { + case XML_ELEMENT(CHART, XML_STYLE_NAME): mrDataLabelStyle.msStyleName = sValue; - } + break; + default: + XMLOFF_WARN_UNKNOWN("xmloff", aIter); } } } diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.hxx b/xmloff/source/chart/SchXMLPlotAreaContext.hxx index ef5f840cc1a2..aeda126bd33d 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.hxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.hxx @@ -171,7 +171,9 @@ public: SchXMLDataLabelContext(SvXMLImport& rImport, ::std::vector<OUString>& rLabels, DataRowPointStyle& rDataLabel); - 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 css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( sal_Int32 nElement, |