From a79e6a7cf1ce3be46e4339a54b013ddaa534dd39 Mon Sep 17 00:00:00 2001 From: Noel Date: Tue, 15 Dec 2020 09:38:19 +0200 Subject: use views to parse rather than allocating OUString Change-Id: If0a848c64ce8077d1681661873629c83307cf8b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107736 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmloff/source/text/XMLTextShapeImportHelper.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'xmloff/source/text/XMLTextShapeImportHelper.cxx') diff --git a/xmloff/source/text/XMLTextShapeImportHelper.cxx b/xmloff/source/text/XMLTextShapeImportHelper.cxx index 3c64ffd58e0a..74f8a7a49b26 100644 --- a/xmloff/source/text/XMLTextShapeImportHelper.cxx +++ b/xmloff/source/text/XMLTextShapeImportHelper.cxx @@ -88,14 +88,13 @@ void XMLTextShapeImportHelper::addShape( for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) { - const OUString sValue = aIter.toString(); switch( aIter.getToken() ) { case XML_ELEMENT(TEXT, XML_ANCHOR_TYPE): { TextContentAnchorType eNew; // OD 2004-06-01 #i26791# - allow all anchor types - if ( XMLAnchorTypePropHdl::convert( sValue, eNew ) ) + if ( XMLAnchorTypePropHdl::convert( aIter.toString(), eNew ) ) { eAnchorType = eNew; } @@ -104,13 +103,13 @@ void XMLTextShapeImportHelper::addShape( case XML_ELEMENT(TEXT, XML_ANCHOR_PAGE_NUMBER): { sal_Int32 nTmp; - if (::sax::Converter::convertNumber(nTmp, sValue, 1, SHRT_MAX)) + if (::sax::Converter::convertNumber(nTmp, aIter.toView(), 1, SHRT_MAX)) nPage = static_cast(nTmp); } break; case XML_ELEMENT(SVG, XML_Y): case XML_ELEMENT(SVG_COMPAT, XML_Y): - rImport.GetMM100UnitConverter().convertMeasureToCore( nY, sValue ); + rImport.GetMM100UnitConverter().convertMeasureToCore( nY, aIter.toString() ); break; } } -- cgit