diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-21 20:44:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-22 12:37:39 +0200 |
commit | 335de1a2216523527f2a6a9aef4f5997f775e648 (patch) | |
tree | 5e6465d90ab11c003e5111d52e093b0281280f0c | |
parent | 21aded1828b1a401a32b0b960f035370843f3771 (diff) |
no need makeStringAndClear() when appending to buffer
it just creates an unnecessary temporary
Change-Id: Ide3cd99b2ac4f2a621e5d55ce4bdc95d05430709
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114467
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/parse/sqlnode.cxx | 2 | ||||
-rw-r--r-- | filter/source/svg/svgexport.cxx | 2 | ||||
-rw-r--r-- | forms/source/xforms/submission/submission_get.cxx | 2 | ||||
-rw-r--r-- | sax/source/tools/converter.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 2 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 2 | ||||
-rw-r--r-- | svx/source/form/formcontroller.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 8 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/databases.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/draw/animationexport.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumfi.cxx | 2 |
13 files changed, 20 insertions, 19 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 6b0451b01a1d..15c5e3778201 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -1898,7 +1898,7 @@ static OUString Impl_DumpProperties(SbUnoObject& rUnoObj) else aPropStr.append( "; " ); - aRet.append( aPropStr.makeStringAndClear() ); + aRet.append( aPropStr ); } } return aRet.makeStringAndClear(); @@ -4811,7 +4811,7 @@ OUString SbUnoStructRefObject::Impl_DumpProperties() { aPropStr.append( "; " ); } - aRet.append( aPropStr.makeStringAndClear() ); + aRet.append( aPropStr ); } } return aRet.makeStringAndClear(); diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 387cc54d92b2..c4c28dc4a822 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -505,7 +505,7 @@ void OSQLParseNode::impl_parseNodeToString_throw(OUStringBuffer& rString, const else i++; } - rString.append(aStringPara.makeStringAndClear()); + rString.append(aStringPara); } bHandled = true; break; diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 6392146c699a..b42cc1c23b5e 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -2755,7 +2755,7 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo, void ) // nothing to do here, we always collect the characters needed for these cases. break; } - aRepresentation.append( sDate.makeStringAndClear() ); + aRepresentation.append( sDate ); } } } diff --git a/forms/source/xforms/submission/submission_get.cxx b/forms/source/xforms/submission/submission_get.cxx index 956876199b3c..22825328b6cd 100644 --- a/forms/source/xforms/submission/submission_get.cxx +++ b/forms/source/xforms/submission/submission_get.cxx @@ -80,7 +80,7 @@ CSubmission::SubmissionResult CSubmissionGet::submit(const css::uno::Reference< if (!aQueryString.isEmpty() && m_aURLObj.GetProtocol() != INetProtocol::File) { aUTF8QueryURL.append('?'); - aUTF8QueryURL.append(aQueryString.makeStringAndClear()); + aUTF8QueryURL.append(aQueryString); } OUString aQueryURL = OStringToOUString(aUTF8QueryURL.makeStringAndClear(), RTL_TEXTENCODING_UTF8); ucbhelper::Content aContent(aQueryURL, aEnvironment, m_xContext); diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index 7a66b89ac22d..3e76e0a5c5e5 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -659,7 +659,7 @@ void Converter::convertDouble( OUStringBuffer& rBuffer, fNumber *= fFactor; ::rtl::math::doubleToUStringBuffer( rBuffer, fNumber, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, '.', true); if(bWriteUnits) - rBuffer.append(sUnit.makeStringAndClear()); + rBuffer.append(sUnit); } } diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 24ac10e9674a..1ee6b9ec9592 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -5339,7 +5339,7 @@ void ScCompiler::CreateStringFromIndex( OUStringBuffer& rBuffer, const FormulaTo ; // nothing } if ( !aBuffer.isEmpty() ) - rBuffer.append(aBuffer.makeStringAndClear()); + rBuffer.append(aBuffer); else rBuffer.append(ScCompiler::GetNativeSymbol(ocErrName)); } diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index b5283a8373ee..9762a124707c 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -3164,7 +3164,7 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 nIndex, { sString.append(';'); } - sString.append(sNegStr.makeStringAndClear()); + sString.append(sNegStr); } else if (eType == SvNumFormatType::FRACTION) { diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 28f8e7eeaf23..a885988abda7 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -815,7 +815,7 @@ void FormController::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) cons aFilter.append( " OR " ); aFilter.append( "( " ); - aFilter.append( aRowFilter.makeStringAndClear() ); + aFilter.append( aRowFilter ); aFilter.append( " )" ); } } diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 1407f3ef0025..63fd05d4d225 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -376,7 +376,7 @@ void RtfAttributeOutput::StartParagraphProperties() if (!m_bBufferSectionHeaders) m_rExport.Strm().WriteOString(aPar.makeStringAndClear()); else - m_aSectionHeaders.append(aPar.makeStringAndClear()); + m_aSectionHeaders.append(aPar); } void RtfAttributeOutput::EndParagraphProperties( @@ -652,7 +652,7 @@ void RtfAttributeOutput::ParagraphStyle(sal_uInt16 nStyle) if (!m_bBufferSectionHeaders) m_rExport.Strm().WriteOString(aStyle.makeStringAndClear()); else - m_aSectionHeaders.append(aStyle.makeStringAndClear()); + m_aSectionHeaders.append(aStyle); } void RtfAttributeOutput::TableInfoCell( @@ -958,7 +958,7 @@ void RtfAttributeOutput::TableOrientation( break; } - m_aRowDefs.append(aTableAdjust.makeStringAndClear()); + m_aRowDefs.append(aTableAdjust); } void RtfAttributeOutput::TableSpacing( @@ -4098,7 +4098,7 @@ bool RtfAttributeOutput::FlyFrameOLEMath(const SwFlyFrameFormat* pFlyFrameFormat OStringBuffer aBuf; if (pBase) pBase->writeFormulaRtf(aBuf, m_rExport.GetCurrentEncoding()); - m_aRunText->append(aBuf.makeStringAndClear()); + m_aRunText->append(aBuf); // Replacement graphic. m_aRunText->append("{" LO_STRING_SVTOOLS_RTF_MMATHPICT " "); FlyFrameOLEReplacement(pFlyFrameFormat, rOLENode, rSize); diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 335820c21d7e..439d45e790f3 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -1455,9 +1455,10 @@ OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension ) switch( m_eState ) { case IteratorState::InitialModule: - aRetFile = OUStringBuffer(m_rDatabases.getInstallPathAsURL()). - append(m_rDatabases.processLang(m_aLanguage)).append('/'). - append(m_aInitialModule).append(".key").makeStringAndClear(); + aRetFile = m_rDatabases.getInstallPathAsURL() + + m_rDatabases.processLang(m_aLanguage) + + "/" + + m_aInitialModule + ".key"; o_rbExtension = false; diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx index 5ad5965dc5b9..339d3b268768 100644 --- a/xmloff/source/draw/animationexport.cxx +++ b/xmloff/source/draw/animationexport.cxx @@ -1470,7 +1470,7 @@ void AnimationsExporterImpl::convertValue( XMLTokenEnum eAttributeName, OUString convertValue( eAttributeName, sTmp, pValuePair->First ); sTmp.append( ',' ); convertValue( eAttributeName, sTmp2, pValuePair->Second ); - sTmp.append( sTmp2.makeStringAndClear() ); + sTmp.append( sTmp2 ); } else if( auto pSequence = o3tl::tryAccess<Sequence<Any>>(rValue) ) { diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 6dea19c1daf6..37e9258f2861 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1365,7 +1365,7 @@ void XMLShapeExport::ImpExportQRCode(const uno::Reference<drawing::XShape>& xSha break; } mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_QRCODE_ERROR_CORRECTION, temp); - mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_QRCODE_BORDER, OUStringBuffer(20).append(aQRCode.Border).makeStringAndClear()); + mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_QRCODE_BORDER, OUString::number(aQRCode.Border)); SvXMLElementExport aQRCodeElement(mrExport, XML_NAMESPACE_LO_EXT, XML_QRCODE, true, true); diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 824a05c68e9a..8bfaf4d35464 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -1767,7 +1767,7 @@ void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo ) } } - aFormatCode.append( aNumStr.makeStringAndClear() ); + aFormatCode.append( aNumStr ); if ( ( rInfo.bDecReplace || rInfo.nMinDecimalDigits < rInfo.nDecimals ) && nPrec ) // add decimal replacement (dashes) { |