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

Noel Grandin noel at peralex.com
Mon Nov 2 05:04:57 PST 2015


 connectivity/source/commontools/TTableHelper.cxx   |    2 +-
 connectivity/source/commontools/dbtools.cxx        |    9 +++------
 connectivity/source/commontools/dbtools2.cxx       |    2 +-
 connectivity/source/drivers/calc/CCatalog.cxx      |    2 +-
 connectivity/source/drivers/calc/CConnection.cxx   |    2 +-
 connectivity/source/drivers/dbase/DCatalog.cxx     |    2 +-
 connectivity/source/drivers/file/FCatalog.cxx      |    2 +-
 connectivity/source/drivers/file/FTable.cxx        |    2 +-
 connectivity/source/drivers/flat/ECatalog.cxx      |    2 +-
 connectivity/source/drivers/hsqldb/HCatalog.cxx    |    6 +++---
 connectivity/source/drivers/hsqldb/HConnection.cxx |    2 +-
 connectivity/source/drivers/hsqldb/HDriver.cxx     |    8 ++++----
 connectivity/source/drivers/hsqldb/HUser.cxx       |    2 +-
 connectivity/source/drivers/mork/MCatalog.cxx      |    2 +-
 connectivity/source/drivers/mysql/YCatalog.cxx     |    6 +++---
 connectivity/source/drivers/mysql/YUser.cxx        |    2 +-
 connectivity/source/manager/mdrivermanager.cxx     |    2 +-
 17 files changed, 26 insertions(+), 29 deletions(-)

New commits:
commit c7e36de2389bc60036160f4c13e5c4f7fd3673c1
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Nov 2 15:04:05 2015 +0200

    loplugin:stringconstant
    
    Change-Id: I736e0d63ed891aee1582844aff25b9bdacab8db9

diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx
index d54dffe..b33f6bf 100644
--- a/connectivity/source/commontools/TTableHelper.cxx
+++ b/connectivity/source/commontools/TTableHelper.cxx
@@ -271,7 +271,7 @@ void OTableHelper::refreshColumns()
             aCatalog,
             m_SchemaName,
             m_Name,
-            OUString("%")
+            "%"
         ) );
 
         // collect the column names, together with their ordinal position
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index 3380879..553d291 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -439,7 +439,7 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R
                 }
                 else
                     xRowSetProps->setPropertyValue(
-                        OUString( "ActiveConnection" ),
+                        "ActiveConnection",
                         makeAny( xConnection.getTyped() )
                     );
             }
@@ -655,7 +655,7 @@ Reference< XNameAccess > getFieldsByCommandDescriptor( const Reference< XConnect
 
                                 // Now set the filter to a dummy restriction which will result in an empty
                                 // result set.
-                                xComposer->setFilter( OUString( "0=1" ) );
+                                xComposer->setFilter( "0=1" );
                                 sStatementToExecute = xComposer->getQuery( );
                             }
                         }
@@ -678,10 +678,7 @@ Reference< XNameAccess > getFieldsByCommandDescriptor( const Reference< XConnect
                     try
                     {
                         if ( xStatementProps.is() )
-                            xStatementProps->setPropertyValue(
-                                OUString( "MaxRows" ),
-                                makeAny( sal_Int32( 0 ) )
-                            );
+                            xStatementProps->setPropertyValue( "MaxRows",  makeAny( sal_Int32( 0 ) ) );
                     }
                     catch( const Exception& )
                     {
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index c59a551..e8fc4fc 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -751,7 +751,7 @@ sal_Int32 getTablePrivileges(const Reference< XDatabaseMetaData>& _xMetaData,
         // Some drivers put a table privilege as soon as any column has the privilege,
         // some drivers only if all columns have the privilege.
         // To unify the situation, collect column privileges here, too.
-        Reference< XResultSet > xColumnPrivileges = _xMetaData->getColumnPrivileges(aVal, _sSchema, _sTable, OUString("%"));
+        Reference< XResultSet > xColumnPrivileges = _xMetaData->getColumnPrivileges(aVal, _sSchema, _sTable, "%");
         Reference< XRow > xColumnCurrentRow(xColumnPrivileges, UNO_QUERY);
         if ( xColumnCurrentRow.is() )
         {
diff --git a/connectivity/source/drivers/calc/CCatalog.cxx b/connectivity/source/drivers/calc/CCatalog.cxx
index 36b3bfc..203e870 100644
--- a/connectivity/source/drivers/calc/CCatalog.cxx
+++ b/connectivity/source/drivers/calc/CCatalog.cxx
@@ -42,7 +42,7 @@ void OCalcCatalog::refreshTables()
     Sequence< OUString > aTypes;
     OCalcConnection::ODocHolder aDocHolder(static_cast<OCalcConnection*>(m_pConnection));
     Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
-        OUString("%"),OUString("%"),aTypes);
+        "%", "%", aTypes);
 
     if(xResult.is())
     {
diff --git a/connectivity/source/drivers/calc/CConnection.cxx b/connectivity/source/drivers/calc/CConnection.cxx
index 71a3c97..245aefc 100644
--- a/connectivity/source/drivers/calc/CConnection.cxx
+++ b/connectivity/source/drivers/calc/CConnection.cxx
@@ -131,7 +131,7 @@ Reference< XSpreadsheetDocument> OCalcConnection::acquireDoc()
     try
     {
         xComponent = xDesktop->loadComponentFromURL(
-            m_aFileName, OUString("_blank"), 0, aArgs );
+            m_aFileName, "_blank", 0, aArgs );
     }
     catch( const Exception& )
     {
diff --git a/connectivity/source/drivers/dbase/DCatalog.cxx b/connectivity/source/drivers/dbase/DCatalog.cxx
index 4ff0d83..0c10788 100644
--- a/connectivity/source/drivers/dbase/DCatalog.cxx
+++ b/connectivity/source/drivers/dbase/DCatalog.cxx
@@ -41,7 +41,7 @@ void ODbaseCatalog::refreshTables()
     TStringVector aVector;
     Sequence< OUString > aTypes;
     Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
-        OUString("%"),OUString("%"),aTypes);
+        "%", "%", aTypes);
 
     if(xResult.is())
     {
diff --git a/connectivity/source/drivers/file/FCatalog.cxx b/connectivity/source/drivers/file/FCatalog.cxx
index 24cc230..9d9564b 100644
--- a/connectivity/source/drivers/file/FCatalog.cxx
+++ b/connectivity/source/drivers/file/FCatalog.cxx
@@ -56,7 +56,7 @@ void OFileCatalog::refreshTables()
     TStringVector aVector;
     Sequence< OUString > aTypes;
     Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
-        OUString("%"),OUString("%"),aTypes);
+        "%", "%", aTypes);
     fillNames(xResult,aVector);
 
     if(m_pTables)
diff --git a/connectivity/source/drivers/file/FTable.cxx b/connectivity/source/drivers/file/FTable.cxx
index 0ef5189..666e902 100644
--- a/connectivity/source/drivers/file/FTable.cxx
+++ b/connectivity/source/drivers/file/FTable.cxx
@@ -80,7 +80,7 @@ void OFileTable::refreshColumns()
 {
     TStringVector aVector;
     Reference< XResultSet > xResult = m_pConnection->getMetaData()->getColumns(Any(),
-                                                                               m_SchemaName,m_Name, OUString("%"));
+                                                                               m_SchemaName,m_Name, "%");
 
     if(xResult.is())
     {
diff --git a/connectivity/source/drivers/flat/ECatalog.cxx b/connectivity/source/drivers/flat/ECatalog.cxx
index b686c40..1b3e227 100644
--- a/connectivity/source/drivers/flat/ECatalog.cxx
+++ b/connectivity/source/drivers/flat/ECatalog.cxx
@@ -42,7 +42,7 @@ void OFlatCatalog::refreshTables()
     TStringVector aVector;
     Sequence< OUString > aTypes;
     Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
-        OUString("%"),OUString("%"),aTypes);
+        "%", "%", aTypes);
 
     if(xResult.is())
     {
diff --git a/connectivity/source/drivers/hsqldb/HCatalog.cxx b/connectivity/source/drivers/hsqldb/HCatalog.cxx
index 09e55a2..d02033e 100644
--- a/connectivity/source/drivers/hsqldb/HCatalog.cxx
+++ b/connectivity/source/drivers/hsqldb/HCatalog.cxx
@@ -44,8 +44,8 @@ OHCatalog::OHCatalog(const Reference< XConnection >& _xConnection) : sdbcx::OCat
 void OHCatalog::refreshObjects(const Sequence< OUString >& _sKindOfObject,TStringVector& _rNames)
 {
     Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
-                                                            OUString("%"),
-                                                            OUString("%"),
+                                                            "%",
+                                                            "%",
                                                             _sKindOfObject);
     fillNames(xResult,_rNames);
 }
@@ -108,7 +108,7 @@ void OHCatalog::refreshUsers()
 {
     TStringVector aVector;
     Reference< XStatement > xStmt = m_xConnection->createStatement(  );
-    Reference< XResultSet >  xResult = xStmt->executeQuery(OUString("select User from hsqldb.user group by User"));
+    Reference< XResultSet >  xResult = xStmt->executeQuery("select User from hsqldb.user group by User");
     if ( xResult.is() )
     {
         Reference< XRow > xRow(xResult,UNO_QUERY);
diff --git a/connectivity/source/drivers/hsqldb/HConnection.cxx b/connectivity/source/drivers/hsqldb/HConnection.cxx
index 89bf6b5..2a3c68a 100644
--- a/connectivity/source/drivers/hsqldb/HConnection.cxx
+++ b/connectivity/source/drivers/hsqldb/HConnection.cxx
@@ -155,7 +155,7 @@ namespace connectivity { namespace hsqldb
                     if ( !m_bReadOnly )
                     {
                         Reference< XStatement > xStmt( m_xConnection->createStatement(), UNO_QUERY_THROW );
-                        xStmt->execute( OUString( "CHECKPOINT DEFRAG" ) );
+                        xStmt->execute( "CHECKPOINT DEFRAG" );
                     }
                 }
                 catch(const Exception& )
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index 2e4c756..ade5ae0 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -536,12 +536,12 @@ namespace connectivity
                 Reference<XStatement> xStmt = _xConnection->createStatement();
                 if ( xStmt.is() )
                 {
-                    Reference<XResultSet> xRes(xStmt->executeQuery(OUString("SELECT COUNT(*) FROM INFORMATION_SCHEMA.SYSTEM_SESSIONS WHERE USER_NAME ='SA'")),UNO_QUERY);
+                    Reference<XResultSet> xRes(xStmt->executeQuery("SELECT COUNT(*) FROM INFORMATION_SCHEMA.SYSTEM_SESSIONS WHERE USER_NAME ='SA'"), UNO_QUERY);
                     Reference<XRow> xRow(xRes,UNO_QUERY);
                     if ( xRow.is() && xRes->next() )
                         bLastOne = xRow->getInt(1) == 1;
                     if ( bLastOne )
-                        xStmt->execute(OUString("SHUTDOWN"));
+                        xStmt->execute("SHUTDOWN");
                 }
             }
         }
@@ -652,7 +652,7 @@ namespace connectivity
                         Reference< XStatement> xStmt = xConnection->createStatement();
                         OSL_ENSURE( xStmt.is(), "ODriverDelegator::preCommit: no statement!" );
                         if ( xStmt.is() )
-                            xStmt->execute( OUString(  "SET WRITE_DELAY 0"  ) );
+                            xStmt->execute( "SET WRITE_DELAY 0" );
 
                         bool bPreviousAutoCommit = xConnection->getAutoCommit();
                         xConnection->setAutoCommit( sal_False );
@@ -660,7 +660,7 @@ namespace connectivity
                         xConnection->setAutoCommit( bPreviousAutoCommit );
 
                         if ( xStmt.is() )
-                            xStmt->execute( OUString(  "SET WRITE_DELAY 60"  ) );
+                            xStmt->execute( "SET WRITE_DELAY 60" );
                     }
                 }
                 catch(Exception&)
diff --git a/connectivity/source/drivers/hsqldb/HUser.cxx b/connectivity/source/drivers/hsqldb/HUser.cxx
index 25e0ccd..7a45a51 100644
--- a/connectivity/source/drivers/hsqldb/HUser.cxx
+++ b/connectivity/source/drivers/hsqldb/HUser.cxx
@@ -112,7 +112,7 @@ void OHSQLUser::findPrivilegesAndGrantPrivileges(const OUString& objName, sal_In
                 Any aCatalog;
                 if ( !sCatalog.isEmpty() )
                     aCatalog <<= sCatalog;
-                xRes = xMeta->getColumnPrivileges(aCatalog,sSchema,sTable,OUString("%"));
+                xRes = xMeta->getColumnPrivileges(aCatalog,sSchema,sTable,"%");
             }
             break;
     }
diff --git a/connectivity/source/drivers/mork/MCatalog.cxx b/connectivity/source/drivers/mork/MCatalog.cxx
index 88d4c20..9a4e935 100644
--- a/connectivity/source/drivers/mork/MCatalog.cxx
+++ b/connectivity/source/drivers/mork/MCatalog.cxx
@@ -53,7 +53,7 @@ void OCatalog::refreshTables()
     Sequence< OUString > aTypes(1);
     aTypes[0] = "%";
     Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
-        OUString("%"),OUString("%"),aTypes);
+        "%", "%", aTypes);
 
     if(xResult.is())
     {
diff --git a/connectivity/source/drivers/mysql/YCatalog.cxx b/connectivity/source/drivers/mysql/YCatalog.cxx
index 7801643..ab79da8 100644
--- a/connectivity/source/drivers/mysql/YCatalog.cxx
+++ b/connectivity/source/drivers/mysql/YCatalog.cxx
@@ -45,8 +45,8 @@ OMySQLCatalog::OMySQLCatalog(const Reference< XConnection >& _xConnection) : OCa
 void OMySQLCatalog::refreshObjects(const Sequence< OUString >& _sKindOfObject,TStringVector& _rNames)
 {
     Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
-                                                            OUString("%"),
-                                                            OUString("%"),
+                                                            "%",
+                                                            "%",
                                                             _sKindOfObject);
     fillNames(xResult,_rNames);
 }
@@ -100,7 +100,7 @@ void OMySQLCatalog::refreshUsers()
 {
     TStringVector aVector;
     Reference< XStatement > xStmt = m_xConnection->createStatement(  );
-    Reference< XResultSet >  xResult = xStmt->executeQuery(OUString("SELECT grantee FROM information_schema.user_privileges GROUP BY grantee"));
+    Reference< XResultSet >  xResult = xStmt->executeQuery("SELECT grantee FROM information_schema.user_privileges GROUP BY grantee");
     if ( xResult.is() )
     {
         Reference< XRow > xRow(xResult,UNO_QUERY);
diff --git a/connectivity/source/drivers/mysql/YUser.cxx b/connectivity/source/drivers/mysql/YUser.cxx
index 6c9a466..2e57ff2 100644
--- a/connectivity/source/drivers/mysql/YUser.cxx
+++ b/connectivity/source/drivers/mysql/YUser.cxx
@@ -112,7 +112,7 @@ void OMySQLUser::findPrivilegesAndGrantPrivileges(const OUString& objName, sal_I
                 Any aCatalog;
                 if ( !sCatalog.isEmpty() )
                     aCatalog <<= sCatalog;
-                xRes = xMeta->getColumnPrivileges(aCatalog,sSchema,sTable,OUString("%"));
+                xRes = xMeta->getColumnPrivileges(aCatalog,sSchema,sTable, "%");
             }
             break;
     }
diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx
index a9fec05..cddcf29 100644
--- a/connectivity/source/manager/mdrivermanager.cxx
+++ b/connectivity/source/manager/mdrivermanager.cxx
@@ -47,7 +47,7 @@ using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::logging;
 using namespace ::osl;
 
-#define SERVICE_SDBC_DRIVER     OUString("com.sun.star.sdbc.Driver")
+#define SERVICE_SDBC_DRIVER     "com.sun.star.sdbc.Driver"
 
 void throwNoSuchElementException() throw(NoSuchElementException)
 {


More information about the Libreoffice-commits mailing list