From f1d83ac45f08270f7f2dd7128056effd0251dc5e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 27 Jan 2017 16:09:54 +0200 Subject: loplugin:stringconstant check for unnecessary OUString constructor.. ..calls when creating exceptions Change-Id: I3bc58a5aa4dc6f0508ecb88b3a843b96b8c7ebfe Reviewed-on: https://gerrit.libreoffice.org/33617 Tested-by: Jenkins Reviewed-by: Noel Grandin --- scripting/source/basprov/basscript.cxx | 5 ++--- scripting/source/provider/MasterScriptProvider.cxx | 3 +-- scripting/source/provider/URIHelper.cxx | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'scripting') diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx index dd098d42b9cd..8cdbbb5b4106 100644 --- a/scripting/source/basprov/basscript.cxx +++ b/scripting/source/basprov/basscript.cxx @@ -187,12 +187,11 @@ namespace basprov if ( nParamsCount < nSbxCount - nSbxOptional ) { throw provider::ScriptFrameworkErrorException( - OUString( - "wrong number of parameters!" ), + "wrong number of parameters!", Reference< XInterface >(), m_funcName, OUString( "Basic" ), - provider::ScriptFrameworkErrorType::NO_SUCH_SCRIPT ); + provider::ScriptFrameworkErrorType::NO_SUCH_SCRIPT ); } } diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx index 9eaca17f0bc9..941cd07dbcb9 100644 --- a/scripting/source/provider/MasterScriptProvider.cxx +++ b/scripting/source/provider/MasterScriptProvider.cxx @@ -141,8 +141,7 @@ void SAL_CALL MasterScriptProvider::initialize( const Sequence < Any >& args ) if ( !xScripts.is() ) { throw lang::IllegalArgumentException( - OUString( "The given document does not support embedding scripts into it, and cannot be associated with such a document." - ), + "The given document does not support embedding scripts into it, and cannot be associated with such a document.", *this, 1 ); diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx index 233f0021ecab..5fcab93a5ecf 100644 --- a/scripting/source/provider/URIHelper.cxx +++ b/scripting/source/provider/URIHelper.cxx @@ -218,8 +218,8 @@ ScriptingFrameworkURIHelper::getStorageURI(const OUString& rScriptURI) catch ( uno::Exception& ) { throw lang::IllegalArgumentException( - OUString("Script URI not valid"), - uno::Reference< uno::XInterface >(), 1 ); + "Script URI not valid", + uno::Reference< uno::XInterface >(), 1 ); } OUStringBuffer buf(120); -- cgit