summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/postgresql
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-06 09:23:33 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-11-09 08:34:40 +0000
commit6c80a8fe89fadf9a2c7260a09c037a09462f53d1 (patch)
treed36da9ee2a5fdc579d2a57ff6ba02deaddfa785a /connectivity/source/drivers/postgresql
parente1fc599eb764186e5d511ace9785463eebbc7028 (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/drivers/postgresql')
-rw-r--r--connectivity/source/drivers/postgresql/pq_connection.cxx3
-rw-r--r--connectivity/source/drivers/postgresql/pq_driver.cxx10
2 files changed, 2 insertions, 11 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx
index d93d7baa0f68..9df93ea8c05f 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.cxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.cxx
@@ -137,8 +137,7 @@ OUString ConnectionGetImplementationName()
}
com::sun::star::uno::Sequence<OUString> ConnectionGetSupportedServiceNames()
{
- OUString serv( "com.sun.star.sdbc.Connection" );
- return Sequence< OUString> (&serv,1);
+ return Sequence< OUString > { "com.sun.star.sdbc.Connection" };
}
static sal_Int32 readLogLevelFromConfiguration()
diff --git a/connectivity/source/drivers/postgresql/pq_driver.cxx b/connectivity/source/drivers/postgresql/pq_driver.cxx
index 8ff522348834..d67d14a1777b 100644
--- a/connectivity/source/drivers/postgresql/pq_driver.cxx
+++ b/connectivity/source/drivers/postgresql/pq_driver.cxx
@@ -76,15 +76,7 @@ OUString DriverGetImplementationName()
Sequence< OUString > DriverGetSupportedServiceNames()
{
- static Sequence< OUString > *p;
- if( ! p )
- {
- MutexGuard guard( osl::Mutex::getGlobalMutex() );
- OUString tmp( "com.sun.star.sdbc.Driver" );
- static Sequence< OUString > instance( &tmp,1 );
- p = &instance;
- }
- return *p;
+ return Sequence< OUString > { "com.sun.star.sdbc.Driver" };
}
Reference< XConnection > Driver::connect(