summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-11 13:59:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-12 11:38:42 +0200
commit301b5c0aea7a525c436b0f2f54a8cef8be947c89 (patch)
tree0ff9a6aa2fe16826e94ad8ba5b5f19cae375bd8b
parent2c4330b3570f16d6668936fd05e1ab2ade597bae (diff)
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.grandin@collabora.co.uk>
-rw-r--r--framework/source/fwe/helper/titlehelper.cxx8
-rw-r--r--sot/source/sdstor/stgdir.cxx3
-rw-r--r--xmloff/source/core/xmlexp.cxx8
3 files changed, 8 insertions, 11 deletions
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()));