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>
This commit is contained in:
Stephan Bergmann 2020-06-03 11:46:51 +02:00
parent 6d1b19df4e
commit 3d3cb4328e
4 changed files with 15 additions and 30 deletions

View file

@ -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.");

View file

@ -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&)
{

View file

@ -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;
}

View file

@ -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()) )
{