summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-30 08:41:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-31 07:02:09 +0100
commitab35d2ded153b0129fed16f9a7e882c8600933e6 (patch)
tree13f1776117f743c34761b6a31ca93f80020e20d3 /xmloff
parent877d0c2c211067e8c1b5fdff0f6d9703c94767e9 (diff)
tdf#125688 speed up load of change-tracking ODS
by 10%, by avoiding an OUString construction in a hot path through XMLTextColumnContext_Impl::XMLTextColumnContext_Impl -> sax::Convert::convertNumber Also changed XMLTextAnimationStepPropertyHdl::importXML to take advantage of the modified convertNumber passing convention. Change-Id: I4e5503dbb094c88a09af8b6dc8c22b6c53f9eb75 Reviewed-on: https://gerrit.libreoffice.org/81726 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/propimp0.cxx2
-rw-r--r--xmloff/source/text/XMLTextColumnsContext.cxx7
2 files changed, 5 insertions, 4 deletions
diff --git a/xmloff/source/draw/propimp0.cxx b/xmloff/source/draw/propimp0.cxx
index cbd909e3c7c9..fe796539b5b5 100644
--- a/xmloff/source/draw/propimp0.cxx
+++ b/xmloff/source/draw/propimp0.cxx
@@ -186,7 +186,7 @@ bool XMLTextAnimationStepPropertyHdl::importXML(
sal_Int32 nPos = rStrImpValue.indexOf( aPX );
if( nPos != -1 )
{
- if (::sax::Converter::convertNumber(nValue, rStrImpValue.copy(0, nPos)))
+ if (::sax::Converter::convertNumber(nValue, std::u16string_view(rStrImpValue).substr(0, nPos)))
{
rValue <<= sal_Int16( -nValue );
bRet = true;
diff --git a/xmloff/source/text/XMLTextColumnsContext.cxx b/xmloff/source/text/XMLTextColumnsContext.cxx
index 66798582b27f..b62b66fde137 100644
--- a/xmloff/source/text/XMLTextColumnsContext.cxx
+++ b/xmloff/source/text/XMLTextColumnsContext.cxx
@@ -137,10 +137,11 @@ XMLTextColumnContext_Impl::XMLTextColumnContext_Impl(
sal_Int32 nPos = rValue.indexOf( '*' );
if( nPos != -1 && nPos+1 == rValue.getLength() )
{
- OUString sTmp( rValue.copy( 0, nPos ) );
if (::sax::Converter::convertNumber(
- nVal, sTmp, 0, USHRT_MAX))
- aColumn.Width = nVal;
+ nVal,
+ std::u16string_view(rValue).substr(0, nPos),
+ 0, USHRT_MAX))
+ aColumn.Width = nVal;
}
}
break;