summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-06-02 21:46:59 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-06-03 09:18:32 +0200
commit4209a4781071e778224c78fda498d09b3580448d (patch)
tree3b144281eac20d741bbd806610344557e996a1b9 /connectivity
parent1c5d8e0e772972f07e135a1c242eda70052bce27 (diff)
Upcoming loplugin:elidestringvar: connectivity
Change-Id: I406486e13b822c34cd2329cc3828dd0567be30e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95385 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/qa/connectivity/mork/DriverTest.cxx10
-rw-r--r--connectivity/source/drivers/firebird/Catalog.cxx4
-rw-r--r--connectivity/source/drivers/hsqldb/HConnection.cxx13
3 files changed, 9 insertions, 18 deletions
diff --git a/connectivity/qa/connectivity/mork/DriverTest.cxx b/connectivity/qa/connectivity/mork/DriverTest.cxx
index e2f2849ffff4..bea76fd028dc 100644
--- a/connectivity/qa/connectivity/mork/DriverTest.cxx
+++ b/connectivity/qa/connectivity/mork/DriverTest.cxx
@@ -107,12 +107,10 @@ void MorkDriverTest::test_metadata()
}
const Any catalog;
- const OUString schemaPattern = "%";
- const OUString tableNamePattern = "%";
const Sequence< OUString > types;
Reference< XResultSet > xResultSet =
- xDatabaseMetaData->getTables(catalog, schemaPattern, tableNamePattern, types);
+ xDatabaseMetaData->getTables(catalog, "%", "%", types);
if (!xResultSet.is())
{
CPPUNIT_ASSERT_MESSAGE("cannot retrieve tables!", xResultSet.is());
@@ -124,8 +122,7 @@ void MorkDriverTest::test_metadata()
void MorkDriverTest::test_select_default_all()
{
- const OUString sql = "select \"E-mail\" from \"AddressBook\" ORDER BY \"E-mail\"";
- Reference< XPreparedStatement > xStatement = m_xConnection->prepareStatement(sql);
+ Reference< XPreparedStatement > xStatement = m_xConnection->prepareStatement("select \"E-mail\" from \"AddressBook\" ORDER BY \"E-mail\"");
if (!xStatement.is())
{
CPPUNIT_ASSERT_MESSAGE("cannot create prepared statement!", xStatement.is());
@@ -164,8 +161,7 @@ void MorkDriverTest::test_select_default_all()
void MorkDriverTest::test_select_list_table_joe_doe_5()
{
- const OUString sql = "select \"E-mail\" from \"does_5\" where \"E-mail\" LIKE '%doe5.org' ";
- Reference< XPreparedStatement > xStatement = m_xConnection->prepareStatement(sql);
+ Reference< XPreparedStatement > xStatement = m_xConnection->prepareStatement("select \"E-mail\" from \"does_5\" where \"E-mail\" LIKE '%doe5.org' ");
if (!xStatement.is())
{
CPPUNIT_ASSERT_MESSAGE("cannot create prepared statement!", xStatement.is());
diff --git a/connectivity/source/drivers/firebird/Catalog.cxx b/connectivity/source/drivers/firebird/Catalog.cxx
index f5969f31ce63..47fedab60d59 100644
--- a/connectivity/source/drivers/firebird/Catalog.cxx
+++ b/connectivity/source/drivers/firebird/Catalog.cxx
@@ -68,10 +68,8 @@ void Catalog::refreshGroups()
//----- IRefreshableUsers ----------------------------------------------------
void Catalog::refreshUsers()
{
- OUString const sSql("SELECT DISTINCT RDB$USER FROM RDB$USER_PRIVILEGES");
-
Reference<XStatement> xStmt= m_xMetaData->getConnection()->createStatement();
- uno::Reference< XResultSet > xUsers = xStmt->executeQuery(sSql);
+ uno::Reference< XResultSet > xUsers = xStmt->executeQuery("SELECT DISTINCT RDB$USER FROM RDB$USER_PRIVILEGES");
if (!xUsers.is())
return;
diff --git a/connectivity/source/drivers/hsqldb/HConnection.cxx b/connectivity/source/drivers/hsqldb/HConnection.cxx
index b6cbc1e4879c..c3ff0169cea7 100644
--- a/connectivity/source/drivers/hsqldb/HConnection.cxx
+++ b/connectivity/source/drivers/hsqldb/HConnection.cxx
@@ -314,17 +314,14 @@ namespace connectivity::hsqldb
if ( m_xContext.is() )
xProvider.set( GraphicProvider::create(m_xContext) );
- // assemble the image URL
- OUString sImageURL =
- // load the graphic from the global graphic repository
- "private:graphicrepository/"
- // the relative path within the images.zip
- LINKED_TEXT_TABLE_IMAGE_RESOURCE;
-
// ask the provider to obtain a graphic
Sequence< PropertyValue > aMediaProperties( 1 );
aMediaProperties[0].Name = "URL";
- aMediaProperties[0].Value <<= sImageURL;
+ aMediaProperties[0].Value <<= OUString(
+ // load the graphic from the global graphic repository
+ "private:graphicrepository/"
+ // the relative path within the images.zip
+ LINKED_TEXT_TABLE_IMAGE_RESOURCE);
xGraphic = xProvider->queryGraphic( aMediaProperties );
OSL_ENSURE( xGraphic.is(), "OHsqlConnection::impl_getTextTableIcon_nothrow: the provider did not give us a graphic object!" );
}