framework/source/fwe/helper/titlehelper.cxx | 8 ++------ sot/source/sdstor/stgdir.cxx | 3 ++- xmloff/source/core/xmlexp.cxx | 8 ++++---- 3 files changed, 8 insertions(+), 11 deletions(-)
New commits: commit 301b5c0aea7a525c436b0f2f54a8cef8be947c89 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed May 11 13:59:41 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu May 12 11:38:42 2022 +0200 tdf#121740 avoid some temporary OUString construction Change-Id: Id70349e0e8f7d79bad693663ec3dc2963e0834b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134205 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx index 10ae60667659..68b2f547bdd9 100644 --- a/framework/source/fwe/helper/titlehelper.cxx +++ b/framework/source/fwe/helper/titlehelper.cxx @@ -368,14 +368,10 @@ void TitleHelper::impl_updateTitleForModel (const css::uno::Reference< css::fram if (nLeasedNumber == css::frame::UntitledNumbersConst::INVALID_NUMBER) nLeasedNumber = xNumbers->leaseNumber (xOwner); - OUStringBuffer sNewTitle(256); - sNewTitle.append (xNumbers->getUntitledPrefix ()); if (nLeasedNumber != css::frame::UntitledNumbersConst::INVALID_NUMBER) - sNewTitle.append(nLeasedNumber); + sTitle = xNumbers->getUntitledPrefix() + OUString::number(nLeasedNumber); else - sNewTitle.append("?"); - - sTitle = sNewTitle.makeStringAndClear (); + sTitle = xNumbers->getUntitledPrefix() + "?"; } bool bChanged; diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index b12feb594482..892c4e705e1f 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -705,7 +705,8 @@ StgDirStrm::StgDirStrm( StgIo& r ) { StgEntry aRoot; aRoot.Init(); - aRoot.SetName( "Root Entry" ); + static constexpr OUStringLiteral sRootEntry = u"Root Entry"; + aRoot.SetName( sRootEntry ); aRoot.SetType( STG_ROOT ); m_pRoot = new StgDirEntry( aRoot ); m_pRoot->SetDirty(); diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 0e0c22d8ca07..22b55d7565f5 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -538,9 +538,9 @@ SvXMLExport::~SvXMLExport() { if (mpProgressBarHelper) { - OUString sProgressMax(XML_PROGRESSMAX); - OUString sProgressCurrent(XML_PROGRESSCURRENT); - OUString sRepeat(XML_PROGRESSREPEAT); + static constexpr OUStringLiteral sProgressMax(XML_PROGRESSMAX); + static constexpr OUStringLiteral sProgressCurrent(XML_PROGRESSCURRENT); + static constexpr OUStringLiteral sRepeat(XML_PROGRESSREPEAT); if (xPropertySetInfo->hasPropertyByName(sProgressMax) && xPropertySetInfo->hasPropertyByName(sProgressCurrent)) { @@ -554,7 +554,7 @@ SvXMLExport::~SvXMLExport() } if (mpNumExport && (mnExportFlags & (SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::STYLES))) { - OUString sWrittenNumberFormats(XML_WRITTENNUMBERSTYLES); + static constexpr OUStringLiteral sWrittenNumberFormats(XML_WRITTENNUMBERSTYLES); if (xPropertySetInfo->hasPropertyByName(sWrittenNumberFormats)) { mxExportInfo->setPropertyValue(sWrittenNumberFormats, Any(mpNumExport->GetWasUsed()));