summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-14 14:27:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-15 14:33:57 +0200
commitf13c6ad5f020a196a0e3aa6f28bda3dc185d465b (patch)
treef9aaab122974d36c134fb1723ec3c1c8df51eeef /sfx2/source
parent9270f74466d0eb841babaa24997f608631c70341 (diff)
new loplugin:bufferadd
look for OUStringBuffer append sequences that can be turned into creating an OUString with + operations Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6 Reviewed-on: https://gerrit.libreoffice.org/80809 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/appl/appserv.cxx7
-rw-r--r--sfx2/source/appl/appuno.cxx3
-rw-r--r--sfx2/source/control/thumbnailviewacc.cxx4
-rw-r--r--sfx2/source/doc/Metadatable.cxx6
-rw-r--r--sfx2/source/notebookbar/SfxNotebookBar.cxx10
-rw-r--r--sfx2/source/sidebar/ResourceManager.cxx8
6 files changed, 12 insertions, 26 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 64977135ba3a..30495736f821 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -1377,17 +1377,14 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
if ( xSystemShell.is() && !sTemplRepoURL.isEmpty() )
{
- OUStringBuffer aURLBuf( sTemplRepoURL );
- aURLBuf.append("?lang=");
-
// read locale from configuration
OUString sLocale(officecfg::Setup::L10N::ooLocale::get());
if (sLocale.isEmpty())
sLocale = "en-US";
- aURLBuf.append( sLocale );
+ OUString aURLBuf = sTemplRepoURL + "?lang=" + sLocale;
xSystemShell->execute(
- aURLBuf.makeStringAndClear(),
+ aURLBuf,
OUString(),
css::system::SystemShellExecuteFlags::URIS_ONLY );
}
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 6c70975db7a1..069d1b1fe47c 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -1230,8 +1230,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
continue;
}
- OStringBuffer aDbg("Unknown item detected: ");
- aDbg.append(static_cast<sal_Int32>(nId));
+ OString aDbg = "Unknown item detected: " + OString::number(static_cast<sal_Int32>(nId));
DBG_ASSERT(nArg<nFormalArgs, aDbg.getStr());
}
}
diff --git a/sfx2/source/control/thumbnailviewacc.cxx b/sfx2/source/control/thumbnailviewacc.cxx
index bc1b3b711592..ccebccacbf81 100644
--- a/sfx2/source/control/thumbnailviewacc.cxx
+++ b/sfx2/source/control/thumbnailviewacc.cxx
@@ -1134,9 +1134,7 @@ OUString SAL_CALL ThumbnailViewItemAcc::getAccessibleName()
if( aRet.isEmpty() )
{
- OUStringBuffer aBuffer("Item ");
- aBuffer.append(static_cast<sal_Int32>(mpParent->mnId));
- aRet = aBuffer.makeStringAndClear();
+ aRet = "Item " + OUString::number(static_cast<sal_Int32>(mpParent->mnId));
}
}
diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx
index ea221535863c..13d3021bc95f 100644
--- a/sfx2/source/doc/Metadatable.cxx
+++ b/sfx2/source/doc/Metadatable.cxx
@@ -1527,11 +1527,7 @@ OUString SAL_CALL MetadatableMixin::getLocalName()
ensureMetadataReference(); // N.B.: side effect!
mdref = getMetadataReference();
}
- OUStringBuffer buf;
- buf.append(mdref.First);
- buf.append('#');
- buf.append(mdref.Second);
- return buf.makeStringAndClear();
+ return mdref.First + "#" + mdref.Second;
}
OUString SAL_CALL MetadatableMixin::getNamespace()
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index 0b47a818ef11..5b9dd2018ae7 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -279,12 +279,11 @@ bool SfxNotebookBar::IsActive()
return false;
- OUStringBuffer aPath("org.openoffice.Office.UI.ToolbarMode/Applications/");
- aPath.append( appName );
+ OUString aPath = "org.openoffice.Office.UI.ToolbarMode/Applications/" + appName;
const utl::OConfigurationTreeRoot aAppNode(
::comphelper::getProcessComponentContext(),
- aPath.makeStringAndClear(),
+ aPath,
false);
if ( !aAppNode.isValid() )
return false;
@@ -378,8 +377,7 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
{
RemoveListeners(pSysWindow);
- OUStringBuffer aBuf(rUIFile);
- aBuf.append( sFile );
+ OUString aBuf = rUIFile + sFile;
//Addons For Notebookbar
std::vector<Image> aImageValues;
@@ -390,7 +388,7 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
aNotebookBarAddonsItem.aImageValues = aImageValues;
// setup if necessary
- pSysWindow->SetNotebookBar(aBuf.makeStringAndClear(), xFrame, aNotebookBarAddonsItem , bReloadNotebookbar);
+ pSysWindow->SetNotebookBar(aBuf, xFrame, aNotebookBarAddonsItem , bReloadNotebookbar);
pNotebookBar = pSysWindow->GetNotebookBar();
pNotebookBar->Show();
pNotebookBar->GetParent()->Resize();
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx
index eb169ee43c0f..e1e011422da7 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -714,12 +714,10 @@ utl::OConfigurationTreeRoot ResourceManager::GetLegacyAddonRootNode (const OUStr
"ooSetupFactoryWindowStateConfigRef",
OUString()));
- OUStringBuffer aPathComposer;
- aPathComposer.append("org.openoffice.Office.UI.");
- aPathComposer.append(sWindowStateRef);
- aPathComposer.append("/UIElements/States");
+ OUString aPathComposer = "org.openoffice.Office.UI." + sWindowStateRef +
+ "/UIElements/States";
- return utl::OConfigurationTreeRoot(xContext, aPathComposer.makeStringAndClear(), false);
+ return utl::OConfigurationTreeRoot(xContext, aPathComposer, false);
}
catch (const Exception&)
{