diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 13:49:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 21:42:16 +0200 |
commit | f9b104abc1185d4f9f3af66f49ec9e39f85a1c36 (patch) | |
tree | 972b288a471d03dded89e7d55040eef0ac65d2ee /scripting | |
parent | 36e92f38c98e5cb21aecf07434df34b3ad75272a (diff) |
simplify some OUString::concat usage
Change-Id: Ifa150dc9d694981ffe03c254ea8c3fd820c99795
Reviewed-on: https://gerrit.libreoffice.org/39812
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/source/basprov/basprov.cxx | 5 | ||||
-rw-r--r-- | scripting/source/provider/MasterScriptProvider.cxx | 23 | ||||
-rw-r--r-- | scripting/source/provider/URIHelper.cxx | 3 | ||||
-rw-r--r-- | scripting/source/stringresource/stringresource.cxx | 8 | ||||
-rw-r--r-- | scripting/source/vbaevents/eventhelper.cxx | 4 |
5 files changed, 14 insertions, 29 deletions
diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx index 4fac2f9cbb51..28cc4a48714a 100644 --- a/scripting/source/basprov/basprov.cxx +++ b/scripting/source/basprov/basprov.cxx @@ -293,10 +293,9 @@ namespace basprov if ( !uriRef.is() || !sfUri.is() ) { - OUString errorMsg("BasicProviderImpl::getScript: failed to parse URI: "); - errorMsg = errorMsg.concat( scriptURI ); throw provider::ScriptFrameworkErrorException( - errorMsg, Reference< XInterface >(), + "BasicProviderImpl::getScript: failed to parse URI: " + scriptURI, + Reference< XInterface >(), scriptURI, "Basic", provider::ScriptFrameworkErrorType::MALFORMED_URL ); } diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx index 63a2685c48ee..972097da4fb1 100644 --- a/scripting/source/provider/MasterScriptProvider.cxx +++ b/scripting/source/provider/MasterScriptProvider.cxx @@ -197,8 +197,7 @@ void MasterScriptProvider::createPkgProvider() try { Any location; - OUString sPkgCtx = m_sCtxString.concat( ":uno_packages" ); - location <<= sPkgCtx; + location <<= m_sCtxString + ":uno_packages"; Reference< provider::XScriptProviderFactory > xFac = provider::theMasterScriptProviderFactory::get( m_xContext ); @@ -237,10 +236,9 @@ MasterScriptProvider::getScript( const OUString& scriptURI ) if ( !uriRef.is() || !sfUri.is() ) { - OUString errorMsg = "Incorrect format for Script URI: "; - errorMsg = errorMsg.concat( scriptURI ); throw provider::ScriptFrameworkErrorException( - errorMsg, Reference< XInterface >(), + "Incorrect format for Script URI: " + scriptURI, + Reference< XInterface >(), scriptURI, "", provider::ScriptFrameworkErrorType::UNKNOWN ); } @@ -252,10 +250,9 @@ MasterScriptProvider::getScript( const OUString& scriptURI ) !sfUri->hasParameter( locKey ) || ( sfUri->getName().isEmpty() ) ) { - OUString errorMsg = "Incorrect format for Script URI: "; - errorMsg = errorMsg.concat( scriptURI ); throw provider::ScriptFrameworkErrorException( - errorMsg, Reference< XInterface >(), + "Incorrect format for Script URI: " + scriptURI, + Reference< XInterface >(), scriptURI, "", provider::ScriptFrameworkErrorType::UNKNOWN ); } @@ -519,9 +516,7 @@ MasterScriptProvider::insertByName( const OUString& aName, const Any& aElement ) if ( index == xSProviders.getLength() ) { // No script providers could process the package - OUString message = "Failed to register package for "; - message = message.concat( aName ); - throw lang::IllegalArgumentException( message, + throw lang::IllegalArgumentException( "Failed to register package for " + aName, Reference < XInterface > (), 2 ); } } @@ -585,10 +580,8 @@ MasterScriptProvider::removeByName( const OUString& Name ) if ( index == xSProviders.getLength() ) { // No script providers could process the package - OUString message = "Failed to revoke package for "; - message = message.concat( Name ); - throw lang::IllegalArgumentException( message, - Reference < XInterface > (), 1 ); + throw lang::IllegalArgumentException( "Failed to revoke package for " + Name, + Reference < XInterface > (), 1 ); } } diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx index d043d3f0b5de..fb74cba6ab6b 100644 --- a/scripting/source/provider/URIHelper.cxx +++ b/scripting/source/provider/URIHelper.cxx @@ -88,8 +88,7 @@ ScriptingFrameworkURIHelper::initialize( throw uno::RuntimeException( "ScriptingFrameworkURIHelper error parsing args" ); } - SCRIPTS_PART = "/Scripts/"; - SCRIPTS_PART = SCRIPTS_PART.concat( m_sLanguage.toAsciiLowerCase() ); + SCRIPTS_PART = "/Scripts/" + m_sLanguage.toAsciiLowerCase(); if ( !initBaseURI() ) { diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index 7b27a5751a35..4d328e22d716 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -183,9 +183,7 @@ OUString StringResourceImpl::implResolveString } if( !bSuccess ) { - OUString errorMsg("StringResourceImpl: No entry for ResourceID: "); - errorMsg = errorMsg.concat( ResourceID ); - throw css::resource::MissingResourceException( errorMsg ); + throw css::resource::MissingResourceException( "StringResourceImpl: No entry for ResourceID: " + ResourceID ); } return aRetStr; } @@ -413,9 +411,7 @@ void StringResourceImpl::implRemoveId( const OUString& ResourceID, LocaleItem* p IdToStringMap::iterator it = rHashMap.find( ResourceID ); if( it == rHashMap.end() ) { - OUString errorMsg("StringResourceImpl: No entries for ResourceID: "); - errorMsg = errorMsg.concat( ResourceID ); - throw css::resource::MissingResourceException( errorMsg ); + throw css::resource::MissingResourceException( "StringResourceImpl: No entries for ResourceID: " + ResourceID ); } rHashMap.erase( it ); pLocaleItem->m_bModified = true; diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx index e60161a9ea87..e85455f90bb1 100644 --- a/scripting/source/vbaevents/eventhelper.cxx +++ b/scripting/source/vbaevents/eventhelper.cxx @@ -872,9 +872,7 @@ EventListener::firing_Impl(const ScriptEvent& evt, Any* pRet ) sProject = sScriptCode.copy( 0, nIndex ); sScriptCode = sScriptCode.copy( nIndex + 1 ); } - OUString sMacroLoc = sProject; - sMacroLoc = sMacroLoc.concat( "." ); - sMacroLoc = sMacroLoc.concat( sScriptCode ).concat( "." ); + OUString sMacroLoc = sProject + "." + sScriptCode + "."; for ( ; txInfo != txInfo_end; ++txInfo ) { |