summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-03 14:09:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-03 15:32:53 +0200
commitc5a0b7af847a71fd50f713934b29305f8ce96c6b (patch)
treed7c0193bc183250c36e467f830a4327ab94dc24e /xmloff
parentd19dbcc139d18771e5e20e82a694f1512476e41c (diff)
loplugin:stringadd improvement for appending numbers
I was wrong, the Concat framework already optimised appending numbers by stack-allocating small buffers, so include them in the plugin Change-Id: I922edbdde273c89abfe21d51c5d25dc01c97db25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115037 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/animationexport.cxx2
-rw-r--r--xmloff/source/draw/shapeexport.cxx2
-rw-r--r--xmloff/source/style/xmlbahdl.cxx7
-rw-r--r--xmloff/source/xforms/xformsexport.cxx6
4 files changed, 8 insertions, 9 deletions
diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx
index f003717193a2..62781694e28f 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -1207,7 +1207,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat
if( !sTmp.isEmpty() )
sTmp.append( ';' );
- sTmp.append(rPair.Time).append( "," ).append(rPair.Progress);
+ sTmp.append(OUString::number(rPair.Time) + "," + OUString::number(rPair.Progress));
}
mxExport->AddAttribute( XML_NAMESPACE_SMIL, XML_KEYSPLINES, sTmp.makeStringAndClear() );
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index cd334405d030..96971ab4c555 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -3799,7 +3799,7 @@ static void ExportParameter( OUStringBuffer& rStrBuffer, const css::drawing::Enh
{
case css::drawing::EnhancedCustomShapeParameterType::EQUATION :
{
- rStrBuffer.append( "?f" ).append( nValue );
+ rStrBuffer.append( "?f" + OUString::number( nValue ) );
}
break;
diff --git a/xmloff/source/style/xmlbahdl.cxx b/xmloff/source/style/xmlbahdl.cxx
index 8bb6352408b1..7f928dfbf499 100644
--- a/xmloff/source/style/xmlbahdl.cxx
+++ b/xmloff/source/style/xmlbahdl.cxx
@@ -482,10 +482,9 @@ bool XMLColorPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, cons
Sequence< double > aHSL;
if( (rValue >>= aHSL) && (aHSL.getLength() == 3) )
{
- aOut.append( "hsl(" ).append(aHSL[0]).append( "," )
- .append(aHSL[1] * 100.0).append( "%," )
- .append(aHSL[2] * 100.0).append( "%)" );
- rStrExpValue = aOut.makeStringAndClear();
+ rStrExpValue = "hsl(" + OUString::number(aHSL[0]) + "," +
+ OUString::number(aHSL[1] * 100.0) + "%," +
+ OUString::number(aHSL[2] * 100.0) + "%)";
bRet = true;
}
diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx
index d875d6545f7f..8ff457fcf289 100644
--- a/xmloff/source/xforms/xformsexport.cxx
+++ b/xmloff/source/xforms/xformsexport.cxx
@@ -659,9 +659,9 @@ OUString xforms_bool( const Any& rAny )
void xforms_formatDate( OUStringBuffer& aBuffer, const util::Date& rDate )
{
- aBuffer.append(static_cast<sal_Int32>( rDate.Year ))
- .append("-").append(static_cast<sal_Int32>( rDate.Month ))
- .append("-").append(static_cast<sal_Int32>( rDate.Day ));
+ aBuffer.append( OUString::number( rDate.Year ) +
+ "-" + OUString::number( rDate.Month ) +
+ "-" + OUString::number( rDate.Day ) );
}
void xforms_formatTime( OUStringBuffer& aBuffer, const css::util::Time& rTime )