From 4583911575edf98ccd5b15af8eafa6a3a7b64034 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 21 Jun 2019 12:14:08 +0200 Subject: improve loplugin:simplifyconstruct Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin --- scripting/source/provider/ActiveMSPList.cxx | 3 +-- scripting/source/provider/MasterScriptProvider.cxx | 9 +-------- scripting/source/provider/URIHelper.cxx | 9 +-------- 3 files changed, 3 insertions(+), 18 deletions(-) (limited to 'scripting') diff --git a/scripting/source/provider/ActiveMSPList.cxx b/scripting/source/provider/ActiveMSPList.cxx index 5411b5a474ef..3cf34551d52c 100644 --- a/scripting/source/provider/ActiveMSPList.cxx +++ b/scripting/source/provider/ActiveMSPList.cxx @@ -242,8 +242,7 @@ ActiveMSPList::addActiveMSP( const Reference< uno::XInterface >& xComponent, // should probably throw from this method!!, reexamine try { - Reference< lang::XComponent > xBroadcaster = - Reference< lang::XComponent >( xComponent, UNO_QUERY_THROW ); + Reference< lang::XComponent > xBroadcaster( xComponent, UNO_QUERY_THROW ); xBroadcaster->addEventListener( this ); } catch ( const Exception& ) diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx index 57f66b1e0995..1e933df231f7 100644 --- a/scripting/source/provider/MasterScriptProvider.cxx +++ b/scripting/source/provider/MasterScriptProvider.cxx @@ -714,14 +714,7 @@ static Reference< XInterface > urihelper_create( static Sequence< OUString > urihelper_getSupportedServiceNames( ) { - OUString serviceNameList[] = { - OUString( - "com.sun.star.script.provider.ScriptURIHelper" ) }; - - Sequence< OUString > serviceNames = Sequence < - OUString > ( serviceNameList, 1 ); - - return serviceNames; + return { "com.sun.star.script.provider.ScriptURIHelper" }; } static OUString urihelper_getImplementationName( ) diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx index 2a09e8dbe5ae..172f0ac0ae66 100644 --- a/scripting/source/provider/URIHelper.cxx +++ b/scripting/source/provider/URIHelper.cxx @@ -252,14 +252,7 @@ ScriptingFrameworkURIHelper::supportsService( const OUString& serviceName ) uno::Sequence< OUString > SAL_CALL ScriptingFrameworkURIHelper::getSupportedServiceNames() { - OUString serviceNameList[] = { - OUString( - "com.sun.star.script.provider.ScriptURIHelper" ) }; - - uno::Sequence< OUString > serviceNames = uno::Sequence < - OUString > ( serviceNameList, 1 ); - - return serviceNames; + return { "com.sun.star.script.provider.ScriptURIHelper" }; } } -- cgit