diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-06-04 21:23:21 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-06-05 08:53:18 +0200 |
commit | 9e07acf3a9b0c9f82734c7bb23e82f7684522f13 (patch) | |
tree | e56546d13c88eb40e213d259c1b39e8aca4d0bf0 /scripting | |
parent | 91f13f44f26e817b6211c48ca38dcffee4f8fa37 (diff) |
Upcoming loplugin:elidestringvar: scripting
Change-Id: Ib900f42b41bf6a3b8f65132dd4c6eb46fb1e5171
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95539
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/source/basprov/basprov.cxx | 3 | ||||
-rw-r--r-- | scripting/source/inc/util/MiscUtils.hxx | 3 | ||||
-rw-r--r-- | scripting/source/protocolhandler/scripthandler.cxx | 3 | ||||
-rw-r--r-- | scripting/source/provider/MasterScriptProvider.cxx | 3 | ||||
-rw-r--r-- | scripting/source/provider/ProviderCache.cxx | 4 |
5 files changed, 5 insertions, 11 deletions
diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx index ad990dbd4863..0d247130ff9f 100644 --- a/scripting/source/basprov/basprov.cxx +++ b/scripting/source/basprov/basprov.cxx @@ -232,8 +232,7 @@ namespace basprov ); } - OUString sDoc = "vnd.sun.star.tdoc"; - if ( m_sScriptingContext.startsWith( sDoc ) ) + if ( m_sScriptingContext.startsWith( "vnd.sun.star.tdoc" ) ) { xModel = MiscUtils::tDocUrlToModel( m_sScriptingContext ); // TODO: use ScriptingContantsPool for SCRIPTING_DOC_REF diff --git a/scripting/source/inc/util/MiscUtils.hxx b/scripting/source/inc/util/MiscUtils.hxx index f40a51499834..e7b5bd920a58 100644 --- a/scripting/source/inc/util/MiscUtils.hxx +++ b/scripting/source/inc/util/MiscUtils.hxx @@ -108,8 +108,7 @@ static css::uno::Reference< css::frame::XModel > tDocUrlToModel( const OUString& try { ::ucbhelper::Content root( url, nullptr, comphelper::getProcessComponentContext() ); - OUString propName = "DocumentModel"; - result = getUCBProperty( root, propName ); + result = getUCBProperty( root, "DocumentModel" ); } catch ( css::ucb::ContentCreationException& ) { diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx index ea29661a489a..74aecbeb1e5c 100644 --- a/scripting/source/protocolhandler/scripthandler.cxx +++ b/scripting/source/protocolhandler/scripthandler.cxx @@ -80,8 +80,7 @@ void SAL_CALL ScriptProtocolHandler::initialize( // but usually it's a "real" frame) if ( aArguments.hasElements() && !( aArguments[ 0 ] >>= m_xFrame ) ) { - OUString temp = "ScriptProtocolHandler::initialize: could not extract reference to the frame"; - throw RuntimeException( temp ); + throw RuntimeException( "ScriptProtocolHandler::initialize: could not extract reference to the frame" ); } ENSURE_OR_THROW( m_xContext.is(), "ScriptProtocolHandler::initialize: No Service Manager available" ); diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx index 2a12c21fb604..d6e64eb92da8 100644 --- a/scripting/source/provider/MasterScriptProvider.cxx +++ b/scripting/source/provider/MasterScriptProvider.cxx @@ -345,8 +345,7 @@ MasterScriptProvider::providerCache() ::osl::MutexGuard aGuard( m_mutex ); if ( !m_pPCache ) { - OUString serviceName1 = "com.sun.star.script.provider.ScriptProviderForBasic"; - Sequence<OUString> blacklist { serviceName1 }; + Sequence<OUString> blacklist { "com.sun.star.script.provider.ScriptProviderForBasic" }; if ( !m_bIsPkgMSP ) { diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx index e97be35acb6f..4bcbd67f9260 100644 --- a/scripting/source/provider/ProviderCache.cxx +++ b/scripting/source/provider/ProviderCache.cxx @@ -136,10 +136,8 @@ ProviderCache::populateCache() ::osl::Guard< osl::Mutex > aGuard( m_mutex ); try { - 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 ); + Reference< container::XEnumeration > xEnum = xEnumAccess->createContentEnumeration ( "com.sun.star.script.provider.LanguageScriptProvider" ); while ( xEnum->hasMoreElements() ) { |