diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-06-03 11:46:51 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-06-03 22:39:11 +0200 |
commit | 3d3cb4328ece843b3e31b8411f9d16bbedb57a7b (patch) | |
tree | ccf8a174c02c384de787d0d7f6a1cbcb0c9e4f6c | |
parent | 6d1b19df4e9cd066acf57b57c3a8b68e09a43ff0 (diff) |
Upcoming loplugin:elidestringvar: extensions
Change-Id: I318eebbdc79c503b10570061a298eb76d6555540
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95402
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | extensions/source/bibliography/datman.cxx | 6 | ||||
-rw-r--r-- | extensions/source/config/ldap/ldapuserprofilebe.cxx | 30 | ||||
-rw-r--r-- | extensions/source/dbpilots/controlwizard.cxx | 3 | ||||
-rw-r--r-- | extensions/source/propctrlr/eventhandler.cxx | 6 |
4 files changed, 15 insertions, 30 deletions
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 0b16d3fa05c0..99aeabe4de7d 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -589,11 +589,10 @@ void BibDataManager::InsertFields(const Reference< XFormComponent > & _rxGrid) xFields->getByName( rField ) >>= xField; OUString sCurrentModelType; - const OUString sType("Type"); sal_Int32 nType = 0; bool bIsFormatted = false; bool bFormattedIsNumeric = true; - xField->getPropertyValue(sType) >>= nType; + xField->getPropertyValue("Type") >>= nType; switch(nType) { case DataType::BIT: @@ -1189,9 +1188,8 @@ Reference< awt::XControlModel > BibDataManager::loadControlModel( aElement = xFields->getByName(rName); aElement >>= xField; - const OUString sType("Type"); sal_Int32 nFormatKey = 0; - xField->getPropertyValue(sType) >>= nFormatKey; + xField->getPropertyValue("Type") >>= nFormatKey; OUString aInstanceName("com.sun.star.form.component."); diff --git a/extensions/source/config/ldap/ldapuserprofilebe.cxx b/extensions/source/config/ldap/ldapuserprofilebe.cxx index 897965ab64a9..fdb6ccba9b77 100644 --- a/extensions/source/config/ldap/ldapuserprofilebe.cxx +++ b/extensions/source/config/ldap/ldapuserprofilebe.cxx @@ -87,16 +87,6 @@ bool LdapUserProfileBe::readLdapConfiguration( LdapDefinition * definition, OUString * loggedOnUser) { OSL_ASSERT(context.is() && definition != nullptr && loggedOnUser != nullptr); - const OUString kReadOnlyViewService("com.sun.star.configuration.ConfigurationAccess") ; - const OUString kComponent("org.openoffice.LDAP/UserDirectory"); - const OUString kServerDefinition("ServerDefinition"); - const OUString kServer("Server"); - const OUString kPort("Port"); - const OUString kBaseDN("BaseDN"); - const OUString kUser("SearchUser"); - const OUString kPassword("SearchPassword"); - const OUString kUserObjectClass("UserObjectClass"); - const OUString kUserUniqueAttr("UserUniqueAttribute"); uno::Reference< XInterface > xIface; try @@ -104,35 +94,35 @@ bool LdapUserProfileBe::readLdapConfiguration( uno::Reference< lang::XMultiServiceFactory > xCfgProvider( css::configuration::theDefaultProvider::get(context)); - css::beans::NamedValue aPath("nodepath", uno::makeAny(kComponent) ); + css::beans::NamedValue aPath("nodepath", uno::makeAny(OUString("org.openoffice.LDAP/UserDirectory")) ); uno::Sequence< uno::Any > aArgs(1); aArgs[0] <<= aPath; - xIface = xCfgProvider->createInstanceWithArguments(kReadOnlyViewService, aArgs); + xIface = xCfgProvider->createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", aArgs); uno::Reference<container::XNameAccess > xAccess(xIface, uno::UNO_QUERY_THROW); - xAccess->getByName(kServerDefinition) >>= xIface; + xAccess->getByName("ServerDefinition") >>= xIface; uno::Reference<container::XNameAccess > xChildAccess(xIface, uno::UNO_QUERY_THROW); - if (!getLdapStringParam(xChildAccess, kServer, definition->mServer)) + if (!getLdapStringParam(xChildAccess, "Server", definition->mServer)) return false; - if (!getLdapStringParam(xChildAccess, kBaseDN, definition->mBaseDN)) + if (!getLdapStringParam(xChildAccess, "BaseDN", definition->mBaseDN)) return false; definition->mPort=0; - xChildAccess->getByName(kPort) >>= definition->mPort ; + xChildAccess->getByName("Port") >>= definition->mPort ; if (definition->mPort == 0) return false; - if (!getLdapStringParam(xAccess, kUserObjectClass, definition->mUserObjectClass)) + if (!getLdapStringParam(xAccess, "UserObjectClass", definition->mUserObjectClass)) return false; - if (!getLdapStringParam(xAccess, kUserUniqueAttr, definition->mUserUniqueAttr)) + if (!getLdapStringParam(xAccess, "UserUniqueAttribute", definition->mUserUniqueAttr)) return false; - getLdapStringParam(xAccess, kUser, definition->mAnonUser); - getLdapStringParam(xAccess, kPassword, definition->mAnonCredentials); + getLdapStringParam(xAccess, "SearchUser", definition->mAnonUser); + getLdapStringParam(xAccess, "SearchPassword", definition->mAnonCredentials); } catch (const uno::Exception&) { diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index 18b3c9489f99..f7d189ddee38 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -437,8 +437,7 @@ namespace dbp catch(const Exception&) { } if (!xHandler.is()) { - const OUString sInteractionHandlerServiceName("com.sun.star.task.InteractionHandler"); - ShowServiceNotAvailableError(_pWindow, sInteractionHandlerServiceName, true); + ShowServiceNotAvailableError(_pWindow, "com.sun.star.task.InteractionHandler", true); } return xHandler; } diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index 638ff02a77e8..32d9894dace4 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -619,10 +619,8 @@ namespace pcr aComposeBuffer.append( xScriptUri->getName() ); // location - const OUString sLocationParamName( "location" ); - const OUString sLocation = xScriptUri->getParameter( sLocationParamName ); - const OUString sLangParamName( "language" ); - const OUString sLanguage = xScriptUri->getParameter( sLangParamName ); + const OUString sLocation = xScriptUri->getParameter( "location" ); + const OUString sLanguage = xScriptUri->getParameter( "language" ); if ( !(sLocation.isEmpty() && sLanguage.isEmpty()) ) { |