diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-06 09:23:33 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-11-09 08:34:40 +0000 |
commit | 6c80a8fe89fadf9a2c7260a09c037a09462f53d1 (patch) | |
tree | d36da9ee2a5fdc579d2a57ff6ba02deaddfa785a /connectivity/source/manager | |
parent | e1fc599eb764186e5d511ace9785463eebbc7028 (diff) |
new loplugin: oncevar
Change-Id: If57390510dde4d166be3141b9f658a7453755d3f
Reviewed-on: https://gerrit.libreoffice.org/19815
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'connectivity/source/manager')
-rw-r--r-- | connectivity/source/manager/mdrivermanager.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx index cddcf29630d8..686fdf6ee1a4 100644 --- a/connectivity/source/manager/mdrivermanager.cxx +++ b/connectivity/source/manager/mdrivermanager.cxx @@ -180,28 +180,24 @@ Any SAL_CALL ODriverEnumeration::nextElement( ) throw(NoSuchElementException, W _rPrecedence.realloc( 0 ); try { - // some strings we need - const OUString sDriverManagerConfigLocation( "org.openoffice.Office.DataAccess/DriverManager" ); - const OUString sDriverPreferenceLocation( "DriverPrecedence" ); - const OUString sNodePathArgumentName( "nodepath" ); - const OUString sNodeAccessServiceName( "com.sun.star.configuration.ConfigurationAccess" ); - // create a configuration provider Reference< XMultiServiceFactory > xConfigurationProvider( com::sun::star::configuration::theDefaultProvider::get( _rContext ) ); // one argument for creating the node access: the path to the configuration node Sequence< Any > aCreationArgs(1); - aCreationArgs[0] <<= NamedValue( sNodePathArgumentName, makeAny( sDriverManagerConfigLocation ) ); + aCreationArgs[0] <<= NamedValue( "nodepath", makeAny( OUString("org.openoffice.Office.DataAccess/DriverManager") ) ); // create the node access - Reference< XNameAccess > xDriverManagerNode(xConfigurationProvider->createInstanceWithArguments(sNodeAccessServiceName, aCreationArgs), UNO_QUERY); + Reference< XNameAccess > xDriverManagerNode( + xConfigurationProvider->createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", aCreationArgs), + UNO_QUERY); OSL_ENSURE(xDriverManagerNode.is(), "lcl_getDriverPrecedence: could not open my configuration node!"); if (xDriverManagerNode.is()) { // obtain the preference list - Any aPreferences = xDriverManagerNode->getByName(sDriverPreferenceLocation); + Any aPreferences = xDriverManagerNode->getByName("DriverPrecedence"); bool bSuccess = aPreferences >>= _rPrecedence; OSL_ENSURE(bSuccess || !aPreferences.hasValue(), "lcl_getDriverPrecedence: invalid value for the preferences node (no string sequence but not NULL)!"); } |