summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-04-29 12:24:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-04-29 18:25:31 +0200
commit04aafba860f613c20e7078d038cc83eb02de0b54 (patch)
tree8153152b87089419bde17313d9ac7b9de6fcce32 /scripting
parent76c793d2acf66f46e9edcda43d2f4327e8374841 (diff)
loplugin:stringadd simplify some *StringBuffer operations
pulled from a larger patch which I created with a more permissive variant of this plugin Change-Id: I7abf1f3f09e84703b6e0e52fe9587dff691b2187 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114875 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'scripting')
-rw-r--r--scripting/source/provider/MasterScriptProvider.cxx13
-rw-r--r--scripting/source/provider/URIHelper.cxx26
2 files changed, 14 insertions, 25 deletions
diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx
index 282d631a6f21..041f77a65c40 100644
--- a/scripting/source/provider/MasterScriptProvider.cxx
+++ b/scripting/source/provider/MasterScriptProvider.cxx
@@ -141,15 +141,14 @@ void SAL_CALL MasterScriptProvider::initialize( const Sequence < Any >& args )
{
Any aError( ::cppu::getCaughtException() );
- OUStringBuffer buf;
- buf.append( "MasterScriptProvider::initialize: caught " );
- buf.append( aError.getValueTypeName() );
- buf.append( ":" );
-
Exception aException;
aError >>= aException;
- buf.append ( aException.Message );
- throw lang::WrappedTargetException( buf.makeStringAndClear(), *this, aError );
+ OUString buf =
+ "MasterScriptProvider::initialize: caught " +
+ aError.getValueTypeName() +
+ ":" +
+ aException.Message;
+ throw lang::WrappedTargetException( buf, *this, aError );
}
if ( m_xInvocationContext.is() && m_xInvocationContext != m_xModel )
diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx
index 94d0e1fd041c..9247f4b9fa98 100644
--- a/scripting/source/provider/URIHelper.cxx
+++ b/scripting/source/provider/URIHelper.cxx
@@ -190,16 +190,13 @@ ScriptingFrameworkURIHelper::getLanguagePath(const OUString& rLanguagePart)
OUString SAL_CALL
ScriptingFrameworkURIHelper::getScriptURI(const OUString& rStorageURI)
{
- OUStringBuffer buf(120);
-
- buf.append("vnd.sun.star.script:");
- buf.append(getLanguagePart(rStorageURI));
- buf.append("?language=");
- buf.append(m_sLanguage);
- buf.append("&location=");
- buf.append(m_sLocation);
-
- return buf.makeStringAndClear();
+ return
+ "vnd.sun.star.script:" +
+ getLanguagePart(rStorageURI) +
+ "?language=" +
+ m_sLanguage +
+ "&location=" +
+ m_sLocation;
}
OUString SAL_CALL
@@ -219,14 +216,7 @@ ScriptingFrameworkURIHelper::getStorageURI(const OUString& rScriptURI)
uno::Reference< uno::XInterface >(), 1 );
}
- OUStringBuffer buf(120);
- buf.append(m_sBaseURI);
- buf.append("/");
- buf.append(getLanguagePath(sLanguagePart));
-
- OUString result = buf.makeStringAndClear();
-
- return result;
+ return m_sBaseURI + "/" + getLanguagePath(sLanguagePart);
}
OUString SAL_CALL