[Libreoffice-commits] core.git: connectivity/qa connectivity/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 3 07:19:11 UTC 2020


 connectivity/qa/connectivity/mork/DriverTest.cxx   |   10 +++-------
 connectivity/source/drivers/firebird/Catalog.cxx   |    4 +---
 connectivity/source/drivers/hsqldb/HConnection.cxx |   13 +++++--------
 3 files changed, 9 insertions(+), 18 deletions(-)

New commits:
commit 4209a4781071e778224c78fda498d09b3580448d
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Jun 2 21:46:59 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Jun 3 09:18:32 2020 +0200

    Upcoming loplugin:elidestringvar: connectivity
    
    Change-Id: I406486e13b822c34cd2329cc3828dd0567be30e5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95385
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

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!" );
         }


More information about the Libreoffice-commits mailing list