diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-28 15:09:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-29 09:05:18 +0200 |
commit | 4c91b89d8ce9c34179f31854dc88bd0a9fa84cba (patch) | |
tree | 1fe9cc9db455779d33c24320fedc1e25888b3e5c /xmloff | |
parent | a1f31211920bfae1a21ea375fa5280c9c6595e15 (diff) |
new loplugin:oustringbuffer
look for places where we are appending the temporary result of adding
strings together, to an OUStringBuffer, where we could rather call
append repeatedly and avoid the temporary creation
Change-Id: I481435124291ac7fb54b91a78344a9fe5b379a82
Reviewed-on: https://gerrit.libreoffice.org/59708
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/animationexport.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/style/xmlbahdl.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/style/xmlexppr.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumfi.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/xforms/xformsexport.cxx | 6 |
6 files changed, 12 insertions, 10 deletions
diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx index 6efa20d7b5c5..1229b5f922d0 100644 --- a/xmloff/source/draw/animationexport.cxx +++ b/xmloff/source/draw/animationexport.cxx @@ -1235,7 +1235,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat if( !sTmp.isEmpty() ) sTmp.append( ';' ); - sTmp.append( OUString::number(p->Time) + "," + OUString::number(p->Progress) ); + sTmp.append( OUString::number(p->Time) ).append( "," ).append( OUString::number(p->Progress) ); p++; } diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 36342fb1c66b..9936f974183d 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -3758,7 +3758,7 @@ void ExportParameter( OUStringBuffer& rStrBuffer, const css::drawing::EnhancedCu { case css::drawing::EnhancedCustomShapeParameterType::EQUATION : { - rStrBuffer.append( "?f" + OUString::number( nValue ) ); + rStrBuffer.append( "?f" ).append(OUString::number( nValue ) ); } break; diff --git a/xmloff/source/style/xmlbahdl.cxx b/xmloff/source/style/xmlbahdl.cxx index 6a348b436006..debf07244872 100644 --- a/xmloff/source/style/xmlbahdl.cxx +++ b/xmloff/source/style/xmlbahdl.cxx @@ -488,7 +488,9 @@ bool XMLColorPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, cons Sequence< double > aHSL; if( (rValue >>= aHSL) && (aHSL.getLength() == 3) ) { - aOut.append( "hsl(" + OUString::number(aHSL[0]) + "," + OUString::number(aHSL[1] * 100.0) + "%," + OUString::number(aHSL[2] * 100.0) + "%)" ); + aOut.append( "hsl(" ).append( OUString::number(aHSL[0]) ).append( "," ) + .append( OUString::number(aHSL[1] * 100.0) ).append( "%," ) + .append( OUString::number(aHSL[2] * 100.0) ).append( "%)" ); rStrExpValue = aOut.makeStringAndClear(); bRet = true; diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index 80dd7e979dc9..e86521ca7f4a 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -949,7 +949,7 @@ void SvXMLExportPropertyMapper::_exportXML( pNamespaceMap = pNewNamespaceMap; } pNewNamespaceMap->Add( sPrefix, sNamespace ); - sNameBuffer.append( GetXMLToken(XML_XMLNS) + ":" + sPrefix ); + sNameBuffer.append( GetXMLToken(XML_XMLNS) ).append( ":" ).append( sPrefix ); rAttrList.AddAttribute( sNameBuffer.makeStringAndClear(), sNamespace ); } diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 59b48edf7c70..17a86b0ebfaf 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -2044,7 +2044,7 @@ void SvXMLNumFormatContext::AddCurrency( const OUString& rContent, LanguageType if ( nLang != LANGUAGE_SYSTEM ) { // '-' sign and language code in hex: - aFormatCode.append("-" + OUString::number(sal_uInt16(nLang), 16).toAsciiUpperCase()); + aFormatCode.append("-").append(OUString::number(sal_uInt16(nLang), 16).toAsciiUpperCase()); } aFormatCode.append( ']' ); // end of "new" currency symbol @@ -2075,7 +2075,7 @@ void SvXMLNumFormatContext::AddNfKeyword( sal_uInt16 nIndex ) if ( !bTruncate && !bHasDateTime ) { // with truncate-on-overflow = false, add "[]" to first time part - aFormatCode.append("[" + sKeyword + "]"); + aFormatCode.append("[").append(sKeyword).append("]"); } else { @@ -2200,7 +2200,7 @@ void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex ) sRealCond = sRealCond.replaceAt( nPos, 1, rDecSep ); } } - aConditions.append("[" + sRealCond + "]"); + aConditions.append("[").append(sRealCond).append("]"); } const SvNumberformat* pFormat = pFormatter->GetEntry(l_nKey); diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx index 69a8d703f117..d31ddcc9a1a2 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(OUString::number(static_cast<sal_Int32>( rDate.Year ) ) - + "-" + OUString::number(static_cast<sal_Int32>( rDate.Month )) - + "-" + OUString::number(static_cast<sal_Int32>( rDate.Day )) ); + aBuffer.append(OUString::number(static_cast<sal_Int32>( rDate.Year ) )) + .append("-").append(OUString::number(static_cast<sal_Int32>( rDate.Month ))) + .append("-").append(OUString::number(static_cast<sal_Int32>( rDate.Day ))); } void xforms_formatTime( OUStringBuffer& aBuffer, const css::util::Time& rTime ) |