summaryrefslogtreecommitdiff
path: root/scripting/source/provider
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-30 12:16:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-31 08:25:07 +0200
commitc9253818ec8252169c20450b41878be459568d95 (patch)
tree1f271151725042f33c3c8aa3988343bcd7f89e12 /scripting/source/provider
parent242a796a71e29a1d8cdc4dd71d2465b898db32ab (diff)
loplugin:oncevar
extend oncevar to any POD type Change-Id: Ia98ee0a67f183e40fb0c38477760124b2c411dc0 Reviewed-on: https://gerrit.libreoffice.org/40564 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'scripting/source/provider')
-rw-r--r--scripting/source/provider/ActiveMSPList.cxx3
-rw-r--r--scripting/source/provider/ProviderCache.cxx10
2 files changed, 5 insertions, 8 deletions
diff --git a/scripting/source/provider/ActiveMSPList.cxx b/scripting/source/provider/ActiveMSPList.cxx
index b5d083353f0f..3699af968a8f 100644
--- a/scripting/source/provider/ActiveMSPList.cxx
+++ b/scripting/source/provider/ActiveMSPList.cxx
@@ -53,12 +53,11 @@ ActiveMSPList::~ActiveMSPList()
Reference< provider::XScriptProvider >
ActiveMSPList::createNewMSP( const uno::Any& context )
{
- OUString serviceName("com.sun.star.script.provider.MasterScriptProvider");
Sequence< Any > args( &context, 1 );
Reference< provider::XScriptProvider > msp(
m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
- serviceName, args, m_xContext ), UNO_QUERY );
+ "com.sun.star.script.provider.MasterScriptProvider", args, m_xContext ), UNO_QUERY );
return msp;
}
diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx
index 65b4fa4f5f02..f4ad90358785 100644
--- a/scripting/source/provider/ProviderCache.cxx
+++ b/scripting/source/provider/ProviderCache.cxx
@@ -136,7 +136,7 @@ ProviderCache::populateCache()
::osl::Guard< osl::Mutex > aGuard( m_mutex );
try
{
- OUString languageProviderName( "com.sun.star.script.provider.LanguageScriptProvider" );
+ OUString const languageProviderName( "com.sun.star.script.provider.LanguageScriptProvider" );
Reference< container::XContentEnumerationAccess > xEnumAccess( m_xMgr, UNO_QUERY_THROW );
Reference< container::XEnumeration > xEnum = xEnumAccess->createContentEnumeration ( languageProviderName );
@@ -151,11 +151,10 @@ ProviderCache::populateCache()
if ( serviceNames.getLength() > 0 )
{
- OUString searchString( "com.sun.star.script.provider.ScriptProviderFor" );
-
for ( sal_Int32 index = 0; index < serviceNames.getLength(); index++ )
{
- if ( serviceNames[ index ].startsWith( searchString ) && !isInBlackList( serviceNames[ index ] ) )
+ if ( serviceNames[ index ].startsWith( "com.sun.star.script.provider.ScriptProviderFor" )
+ && !isInBlackList( serviceNames[ index ] ) )
{
serviceName = serviceNames[ index ];
ProviderDetails details;
@@ -186,8 +185,7 @@ ProviderCache::createProvider( ProviderDetails& details )
}
catch ( const Exception& e )
{
- OUString temp("ProviderCache::createProvider() Error creating provider from factory!!!\n");
- throw RuntimeException( temp.concat( e.Message ) );
+ throw RuntimeException( "ProviderCache::createProvider() Error creating provider from factory. " + e.Message );
}
return details.provider;