Kaydet (Commit) c7e36de2 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:stringconstant

Change-Id: I736e0d63ed891aee1582844aff25b9bdacab8db9
üst 7408498d
...@@ -271,7 +271,7 @@ void OTableHelper::refreshColumns() ...@@ -271,7 +271,7 @@ void OTableHelper::refreshColumns()
aCatalog, aCatalog,
m_SchemaName, m_SchemaName,
m_Name, m_Name,
OUString("%") "%"
) ); ) );
// collect the column names, together with their ordinal position // collect the column names, together with their ordinal position
......
...@@ -439,7 +439,7 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R ...@@ -439,7 +439,7 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R
} }
else else
xRowSetProps->setPropertyValue( xRowSetProps->setPropertyValue(
OUString( "ActiveConnection" ), "ActiveConnection",
makeAny( xConnection.getTyped() ) makeAny( xConnection.getTyped() )
); );
} }
...@@ -655,7 +655,7 @@ Reference< XNameAccess > getFieldsByCommandDescriptor( const Reference< XConnect ...@@ -655,7 +655,7 @@ Reference< XNameAccess > getFieldsByCommandDescriptor( const Reference< XConnect
// Now set the filter to a dummy restriction which will result in an empty // Now set the filter to a dummy restriction which will result in an empty
// result set. // result set.
xComposer->setFilter( OUString( "0=1" ) ); xComposer->setFilter( "0=1" );
sStatementToExecute = xComposer->getQuery( ); sStatementToExecute = xComposer->getQuery( );
} }
} }
...@@ -678,10 +678,7 @@ Reference< XNameAccess > getFieldsByCommandDescriptor( const Reference< XConnect ...@@ -678,10 +678,7 @@ Reference< XNameAccess > getFieldsByCommandDescriptor( const Reference< XConnect
try try
{ {
if ( xStatementProps.is() ) if ( xStatementProps.is() )
xStatementProps->setPropertyValue( xStatementProps->setPropertyValue( "MaxRows", makeAny( sal_Int32( 0 ) ) );
OUString( "MaxRows" ),
makeAny( sal_Int32( 0 ) )
);
} }
catch( const Exception& ) catch( const Exception& )
{ {
......
...@@ -751,7 +751,7 @@ sal_Int32 getTablePrivileges(const Reference< XDatabaseMetaData>& _xMetaData, ...@@ -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 put a table privilege as soon as any column has the privilege,
// some drivers only if all columns have the privilege. // some drivers only if all columns have the privilege.
// To unify the situation, collect column privileges here, too. // 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); Reference< XRow > xColumnCurrentRow(xColumnPrivileges, UNO_QUERY);
if ( xColumnCurrentRow.is() ) if ( xColumnCurrentRow.is() )
{ {
......
...@@ -42,7 +42,7 @@ void OCalcCatalog::refreshTables() ...@@ -42,7 +42,7 @@ void OCalcCatalog::refreshTables()
Sequence< OUString > aTypes; Sequence< OUString > aTypes;
OCalcConnection::ODocHolder aDocHolder(static_cast<OCalcConnection*>(m_pConnection)); OCalcConnection::ODocHolder aDocHolder(static_cast<OCalcConnection*>(m_pConnection));
Reference< XResultSet > xResult = m_xMetaData->getTables(Any(), Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
OUString("%"),OUString("%"),aTypes); "%", "%", aTypes);
if(xResult.is()) if(xResult.is())
{ {
......
...@@ -131,7 +131,7 @@ Reference< XSpreadsheetDocument> OCalcConnection::acquireDoc() ...@@ -131,7 +131,7 @@ Reference< XSpreadsheetDocument> OCalcConnection::acquireDoc()
try try
{ {
xComponent = xDesktop->loadComponentFromURL( xComponent = xDesktop->loadComponentFromURL(
m_aFileName, OUString("_blank"), 0, aArgs ); m_aFileName, "_blank", 0, aArgs );
} }
catch( const Exception& ) catch( const Exception& )
{ {
......
...@@ -41,7 +41,7 @@ void ODbaseCatalog::refreshTables() ...@@ -41,7 +41,7 @@ void ODbaseCatalog::refreshTables()
TStringVector aVector; TStringVector aVector;
Sequence< OUString > aTypes; Sequence< OUString > aTypes;
Reference< XResultSet > xResult = m_xMetaData->getTables(Any(), Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
OUString("%"),OUString("%"),aTypes); "%", "%", aTypes);
if(xResult.is()) if(xResult.is())
{ {
......
...@@ -56,7 +56,7 @@ void OFileCatalog::refreshTables() ...@@ -56,7 +56,7 @@ void OFileCatalog::refreshTables()
TStringVector aVector; TStringVector aVector;
Sequence< OUString > aTypes; Sequence< OUString > aTypes;
Reference< XResultSet > xResult = m_xMetaData->getTables(Any(), Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
OUString("%"),OUString("%"),aTypes); "%", "%", aTypes);
fillNames(xResult,aVector); fillNames(xResult,aVector);
if(m_pTables) if(m_pTables)
......
...@@ -80,7 +80,7 @@ void OFileTable::refreshColumns() ...@@ -80,7 +80,7 @@ void OFileTable::refreshColumns()
{ {
TStringVector aVector; TStringVector aVector;
Reference< XResultSet > xResult = m_pConnection->getMetaData()->getColumns(Any(), Reference< XResultSet > xResult = m_pConnection->getMetaData()->getColumns(Any(),
m_SchemaName,m_Name, OUString("%")); m_SchemaName,m_Name, "%");
if(xResult.is()) if(xResult.is())
{ {
......
...@@ -42,7 +42,7 @@ void OFlatCatalog::refreshTables() ...@@ -42,7 +42,7 @@ void OFlatCatalog::refreshTables()
TStringVector aVector; TStringVector aVector;
Sequence< OUString > aTypes; Sequence< OUString > aTypes;
Reference< XResultSet > xResult = m_xMetaData->getTables(Any(), Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
OUString("%"),OUString("%"),aTypes); "%", "%", aTypes);
if(xResult.is()) if(xResult.is())
{ {
......
...@@ -44,8 +44,8 @@ OHCatalog::OHCatalog(const Reference< XConnection >& _xConnection) : sdbcx::OCat ...@@ -44,8 +44,8 @@ OHCatalog::OHCatalog(const Reference< XConnection >& _xConnection) : sdbcx::OCat
void OHCatalog::refreshObjects(const Sequence< OUString >& _sKindOfObject,TStringVector& _rNames) void OHCatalog::refreshObjects(const Sequence< OUString >& _sKindOfObject,TStringVector& _rNames)
{ {
Reference< XResultSet > xResult = m_xMetaData->getTables(Any(), Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
OUString("%"), "%",
OUString("%"), "%",
_sKindOfObject); _sKindOfObject);
fillNames(xResult,_rNames); fillNames(xResult,_rNames);
} }
...@@ -108,7 +108,7 @@ void OHCatalog::refreshUsers() ...@@ -108,7 +108,7 @@ void OHCatalog::refreshUsers()
{ {
TStringVector aVector; TStringVector aVector;
Reference< XStatement > xStmt = m_xConnection->createStatement( ); 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() ) if ( xResult.is() )
{ {
Reference< XRow > xRow(xResult,UNO_QUERY); Reference< XRow > xRow(xResult,UNO_QUERY);
......
...@@ -155,7 +155,7 @@ namespace connectivity { namespace hsqldb ...@@ -155,7 +155,7 @@ namespace connectivity { namespace hsqldb
if ( !m_bReadOnly ) if ( !m_bReadOnly )
{ {
Reference< XStatement > xStmt( m_xConnection->createStatement(), UNO_QUERY_THROW ); Reference< XStatement > xStmt( m_xConnection->createStatement(), UNO_QUERY_THROW );
xStmt->execute( OUString( "CHECKPOINT DEFRAG" ) ); xStmt->execute( "CHECKPOINT DEFRAG" );
} }
} }
catch(const Exception& ) catch(const Exception& )
......
...@@ -536,12 +536,12 @@ namespace connectivity ...@@ -536,12 +536,12 @@ namespace connectivity
Reference<XStatement> xStmt = _xConnection->createStatement(); Reference<XStatement> xStmt = _xConnection->createStatement();
if ( xStmt.is() ) 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); Reference<XRow> xRow(xRes,UNO_QUERY);
if ( xRow.is() && xRes->next() ) if ( xRow.is() && xRes->next() )
bLastOne = xRow->getInt(1) == 1; bLastOne = xRow->getInt(1) == 1;
if ( bLastOne ) if ( bLastOne )
xStmt->execute(OUString("SHUTDOWN")); xStmt->execute("SHUTDOWN");
} }
} }
} }
...@@ -652,7 +652,7 @@ namespace connectivity ...@@ -652,7 +652,7 @@ namespace connectivity
Reference< XStatement> xStmt = xConnection->createStatement(); Reference< XStatement> xStmt = xConnection->createStatement();
OSL_ENSURE( xStmt.is(), "ODriverDelegator::preCommit: no statement!" ); OSL_ENSURE( xStmt.is(), "ODriverDelegator::preCommit: no statement!" );
if ( xStmt.is() ) if ( xStmt.is() )
xStmt->execute( OUString( "SET WRITE_DELAY 0" ) ); xStmt->execute( "SET WRITE_DELAY 0" );
bool bPreviousAutoCommit = xConnection->getAutoCommit(); bool bPreviousAutoCommit = xConnection->getAutoCommit();
xConnection->setAutoCommit( sal_False ); xConnection->setAutoCommit( sal_False );
...@@ -660,7 +660,7 @@ namespace connectivity ...@@ -660,7 +660,7 @@ namespace connectivity
xConnection->setAutoCommit( bPreviousAutoCommit ); xConnection->setAutoCommit( bPreviousAutoCommit );
if ( xStmt.is() ) if ( xStmt.is() )
xStmt->execute( OUString( "SET WRITE_DELAY 60" ) ); xStmt->execute( "SET WRITE_DELAY 60" );
} }
} }
catch(Exception&) catch(Exception&)
......
...@@ -112,7 +112,7 @@ void OHSQLUser::findPrivilegesAndGrantPrivileges(const OUString& objName, sal_In ...@@ -112,7 +112,7 @@ void OHSQLUser::findPrivilegesAndGrantPrivileges(const OUString& objName, sal_In
Any aCatalog; Any aCatalog;
if ( !sCatalog.isEmpty() ) if ( !sCatalog.isEmpty() )
aCatalog <<= sCatalog; aCatalog <<= sCatalog;
xRes = xMeta->getColumnPrivileges(aCatalog,sSchema,sTable,OUString("%")); xRes = xMeta->getColumnPrivileges(aCatalog,sSchema,sTable,"%");
} }
break; break;
} }
......
...@@ -53,7 +53,7 @@ void OCatalog::refreshTables() ...@@ -53,7 +53,7 @@ void OCatalog::refreshTables()
Sequence< OUString > aTypes(1); Sequence< OUString > aTypes(1);
aTypes[0] = "%"; aTypes[0] = "%";
Reference< XResultSet > xResult = m_xMetaData->getTables(Any(), Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
OUString("%"),OUString("%"),aTypes); "%", "%", aTypes);
if(xResult.is()) if(xResult.is())
{ {
......
...@@ -45,8 +45,8 @@ OMySQLCatalog::OMySQLCatalog(const Reference< XConnection >& _xConnection) : OCa ...@@ -45,8 +45,8 @@ OMySQLCatalog::OMySQLCatalog(const Reference< XConnection >& _xConnection) : OCa
void OMySQLCatalog::refreshObjects(const Sequence< OUString >& _sKindOfObject,TStringVector& _rNames) void OMySQLCatalog::refreshObjects(const Sequence< OUString >& _sKindOfObject,TStringVector& _rNames)
{ {
Reference< XResultSet > xResult = m_xMetaData->getTables(Any(), Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
OUString("%"), "%",
OUString("%"), "%",
_sKindOfObject); _sKindOfObject);
fillNames(xResult,_rNames); fillNames(xResult,_rNames);
} }
...@@ -100,7 +100,7 @@ void OMySQLCatalog::refreshUsers() ...@@ -100,7 +100,7 @@ void OMySQLCatalog::refreshUsers()
{ {
TStringVector aVector; TStringVector aVector;
Reference< XStatement > xStmt = m_xConnection->createStatement( ); 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() ) if ( xResult.is() )
{ {
Reference< XRow > xRow(xResult,UNO_QUERY); Reference< XRow > xRow(xResult,UNO_QUERY);
......
...@@ -112,7 +112,7 @@ void OMySQLUser::findPrivilegesAndGrantPrivileges(const OUString& objName, sal_I ...@@ -112,7 +112,7 @@ void OMySQLUser::findPrivilegesAndGrantPrivileges(const OUString& objName, sal_I
Any aCatalog; Any aCatalog;
if ( !sCatalog.isEmpty() ) if ( !sCatalog.isEmpty() )
aCatalog <<= sCatalog; aCatalog <<= sCatalog;
xRes = xMeta->getColumnPrivileges(aCatalog,sSchema,sTable,OUString("%")); xRes = xMeta->getColumnPrivileges(aCatalog,sSchema,sTable, "%");
} }
break; break;
} }
......
...@@ -47,7 +47,7 @@ using namespace ::com::sun::star::container; ...@@ -47,7 +47,7 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::logging; using namespace ::com::sun::star::logging;
using namespace ::osl; 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) void throwNoSuchElementException() throw(NoSuchElementException)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment