summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-12-18 13:21:30 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-12-18 14:12:24 +0100
commitecf24f303217f55d1d2efdde7d58d0af083612d5 (patch)
treeea479693416f374f006d020b0e504e82a1e5719f /connectivity
parentacb7ca428382b8db42d7afcd79d72682aae0df8d (diff)
connectivity: Use appropriate OUString functions on string constants
Change-Id: I9ca72364cd57fd2da0c6f5f704a3fe494c0a1df5
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/DriversConfig.cxx2
-rw-r--r--connectivity/source/drivers/calc/CConnection.cxx2
-rw-r--r--connectivity/source/drivers/calc/CDatabaseMetaData.cxx2
-rw-r--r--connectivity/source/drivers/calc/CTable.cxx2
-rw-r--r--connectivity/source/drivers/dbase/DDatabaseMetaData.cxx2
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx2
-rw-r--r--connectivity/source/drivers/firebird/Connection.cxx2
-rw-r--r--connectivity/source/drivers/firebird/Driver.cxx2
-rw-r--r--connectivity/source/drivers/flat/EDatabaseMetaData.cxx2
-rw-r--r--connectivity/source/drivers/hsqldb/HDriver.cxx2
-rw-r--r--connectivity/source/drivers/macab/MacabDriver.cxx2
-rw-r--r--connectivity/source/drivers/mork/MResultSet.cxx6
-rw-r--r--connectivity/source/parse/sqliterator.cxx16
-rw-r--r--connectivity/source/parse/sqlnode.cxx11
14 files changed, 29 insertions, 26 deletions
diff --git a/connectivity/source/commontools/DriversConfig.cxx b/connectivity/source/commontools/DriversConfig.cxx
index 391f6ee4f677..908159d133e8 100644
--- a/connectivity/source/commontools/DriversConfig.cxx
+++ b/connectivity/source/commontools/DriversConfig.cxx
@@ -114,7 +114,7 @@ void DriversConfigImpl::Load(const uno::Reference< uno::XComponentContext >& _rx
lcl_readURLPatternNode(m_aInstalled,*pPatternIter,aInstalledDriver);
if ( !aInstalledDriver.sDriverFactory.isEmpty() &&
( aMiscOptions.IsExperimentalMode() ||
- !aInstalledDriver.sDriverFactory.equals("com.sun.star.comp.sdbc.firebird.Driver") ))
+ aInstalledDriver.sDriverFactory != "com.sun.star.comp.sdbc.firebird.Driver" ))
m_aDrivers.insert(TInstalledDrivers::value_type(*pPatternIter,aInstalledDriver));
}
} // if ( m_aInstalled.isValid() )
diff --git a/connectivity/source/drivers/calc/CConnection.cxx b/connectivity/source/drivers/calc/CConnection.cxx
index c71f345ca40a..35967f25c159 100644
--- a/connectivity/source/drivers/calc/CConnection.cxx
+++ b/connectivity/source/drivers/calc/CConnection.cxx
@@ -85,7 +85,7 @@ void OCalcConnection::construct(const OUString& url,const Sequence< PropertyValu
}
m_aFileName = aURL.GetMainURL(INetURLObject::NO_DECODE);
- m_sPassword = "";
+ m_sPassword.clear();
const char* pPwd = "password";
const PropertyValue *pIter = info.getConstArray();
diff --git a/connectivity/source/drivers/calc/CDatabaseMetaData.cxx b/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
index a689e3bf186a..dc15b2b25948 100644
--- a/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
@@ -240,7 +240,7 @@ OUString SAL_CALL OCalcDatabaseMetaData::getURL( ) throw(SQLException, RuntimeE
{
::osl::MutexGuard aGuard( m_aMutex );
- return OUString("sdbc:calc:") + m_pConnection->getURL();
+ return "sdbc:calc:" + m_pConnection->getURL();
}
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx
index 071df968a244..3e519493abc0 100644
--- a/connectivity/source/drivers/calc/CTable.cxx
+++ b/connectivity/source/drivers/calc/CTable.cxx
@@ -485,7 +485,7 @@ void OCalcTable::fillColumns()
break;
default:
SAL_WARN( "connectivity.drivers","missing type name");
- aTypeName = "";
+ aTypeName.clear();
}
// check if the column name already exists
diff --git a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
index d353c360f022..9daa41c42a5e 100644
--- a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
@@ -331,7 +331,7 @@ Reference< XResultSet > SAL_CALL ODbaseDatabaseMetaData::getIndexInfo(
OUString SAL_CALL ODbaseDatabaseMetaData::getURL( ) throw(SQLException, RuntimeException, std::exception)
{
::osl::MutexGuard aGuard( m_aMutex );
- return OUString("sdbc:dbase:") + m_pConnection->getURL();
+ return "sdbc:dbase:" + m_pConnection->getURL();
}
sal_Int32 SAL_CALL ODbaseDatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException, std::exception)
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index 8f102141c641..3abfc03090ee 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -2517,7 +2517,7 @@ OUString ODbaseTable::createTempFile()
aIdent += "/";
OUString sTempName(aIdent);
- OUString sExt(OUString(".") + m_pConnection->getExtension());
+ OUString sExt("." + m_pConnection->getExtension());
OUString sName(m_Name);
TempFile aTempFile(sName, true, &sExt, &sTempName);
if(!aTempFile.IsValid())
diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx
index 137f4825df9f..1c8a26a849ed 100644
--- a/connectivity/source/drivers/firebird/Connection.cxx
+++ b/connectivity/source/drivers/firebird/Connection.cxx
@@ -134,7 +134,7 @@ void Connection::construct(const ::rtl::OUString& url, const Sequence< PropertyV
bool bIsNewDatabase = false;
OUString aStorageURL;
- if (url.equals("sdbc:embedded:firebird"))
+ if (url == "sdbc:embedded:firebird")
{
m_bIsEmbedded = true;
diff --git a/connectivity/source/drivers/firebird/Driver.cxx b/connectivity/source/drivers/firebird/Driver.cxx
index 5c9c88be5e9d..767feee28c4f 100644
--- a/connectivity/source/drivers/firebird/Driver.cxx
+++ b/connectivity/source/drivers/firebird/Driver.cxx
@@ -186,7 +186,7 @@ sal_Bool SAL_CALL FirebirdDriver::acceptsURL( const OUString& url )
SvtMiscOptions aMiscOptions;
return aMiscOptions.IsExperimentalMode() &&
- (url.equals("sdbc:embedded:firebird") || url.startsWith("sdbc:firebird:"));
+ (url == "sdbc:embedded:firebird" || url.startsWith("sdbc:firebird:"));
}
Sequence< DriverPropertyInfo > SAL_CALL FirebirdDriver::getPropertyInfo(
diff --git a/connectivity/source/drivers/flat/EDatabaseMetaData.cxx b/connectivity/source/drivers/flat/EDatabaseMetaData.cxx
index 7383ca64a3a0..090d4f6f3f17 100644
--- a/connectivity/source/drivers/flat/EDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/flat/EDatabaseMetaData.cxx
@@ -240,7 +240,7 @@ Reference< XResultSet > SAL_CALL OFlatDatabaseMetaData::getColumns(
OUString SAL_CALL OFlatDatabaseMetaData::getURL( ) throw(SQLException, RuntimeException, std::exception)
{
::osl::MutexGuard aGuard( m_aMutex );
- return OUString("sdbc:flat:") + m_pConnection->getURL();
+ return "sdbc:flat:" + m_pConnection->getURL();
}
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index 1c8b443e371d..04de49efa442 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -411,7 +411,7 @@ namespace connectivity
"connectivity.hsqldb", "jfw_getEnabled: error code " << +e);
break;
}
- return bEnabled && url.equals("sdbc:embedded:hsqldb");
+ return bEnabled && url == "sdbc:embedded:hsqldb";
}
diff --git a/connectivity/source/drivers/macab/MacabDriver.cxx b/connectivity/source/drivers/macab/MacabDriver.cxx
index 2567a57fde19..1c2881a2bac4 100644
--- a/connectivity/source/drivers/macab/MacabDriver.cxx
+++ b/connectivity/source/drivers/macab/MacabDriver.cxx
@@ -271,7 +271,7 @@ sal_Bool SAL_CALL MacabDriver::acceptsURL( const OUString& url )
return sal_False;
// here we have to look whether we support this URL format
- return url.equals("sdbc:address:macab");
+ return url == "sdbc:address:macab";
}
Sequence< DriverPropertyInfo > SAL_CALL MacabDriver::getPropertyInfo( const OUString&, const Sequence< PropertyValue >& ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx
index 0021fe378292..e9817f0ec1d9 100644
--- a/connectivity/source/drivers/mork/MResultSet.cxx
+++ b/connectivity/source/drivers/mork/MResultSet.cxx
@@ -739,7 +739,7 @@ void OResultSet::parseParameter( const OSQLParseNode* pNode, OUString& rMatchStr
OSQLParseNode *pMark = pNode->getChild(0);
// Initialize to empty string
- rMatchString = "";
+ rMatchString.clear();
OUString aParameterName;
if (SQL_ISPUNCTUATION(pMark,"?")) {
@@ -944,7 +944,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
// String containing only a '%' and nothing else
op = MQueryOp::Exists;
// Will be ignored for Exists case, but clear anyway.
- matchString = "";
+ matchString.clear();
}
else if ( matchString.indexOf ( WILDCARD ) == -1 &&
matchString.indexOf ( MATCHCHAR ) == -1 )
@@ -1370,7 +1370,7 @@ void OResultSet::setBoundedColumns(const OValueRow& _rRow,
if (xTableColumn.is())
xTableColumn->getPropertyValue(sName) >>= sTableColumnName;
else
- sTableColumnName = "";
+ sTableColumnName.clear();
// look if we have such a select column
// TODO: would like to have a O(log n) search here ...
diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx
index 12846c9bf687..2e668e19b0a2 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -252,7 +252,7 @@ namespace
{
_out_rString = _rxRow->getString( _nColumnIndex );
if ( _rxRow->wasNull() )
- _out_rString = "";
+ _out_rString.clear();
}
@@ -274,7 +274,7 @@ namespace
if ( _rxDBMeta.is() )
{
- sComposedName = "";
+ sComposedName.clear();
Reference< XResultSet> xRes = _rxDBMeta->getTables(
!_rCatalog.isEmpty() ? makeAny( _rCatalog ) : Any(), !_rSchema.isEmpty() ? _rSchema : s_sWildcard, _rTableName, sTableTypes );
@@ -502,7 +502,7 @@ void OSQLParseTreeIterator::getQualified_join( OSQLTables& _rTables, const OSQLP
OSL_PRECOND( SQL_ISRULE( pTableRef, cross_union ) || SQL_ISRULE( pTableRef, qualified_join ) ,
"OSQLParseTreeIterator::getQualified_join: illegal node!" );
- aTableRange = "";
+ aTableRange.clear();
const OSQLParseNode* pNode = getTableNode(_rTables,pTableRef->getChild(0),aTableRange);
if ( isTableNode( pNode ) )
@@ -620,7 +620,7 @@ void OSQLParseTreeIterator::getSelect_statement(OSQLTables& _rTables,const OSQLP
OUString aTableRange;
for (sal_uInt32 i = 0; i < pTableRefCommalist->count(); i++)
{ // Process FROM clause
- aTableRange = "";
+ aTableRange.clear();
const OSQLParseNode* pTableListElement = pTableRefCommalist->getChild(i);
if ( isTableNode( pTableListElement ) )
@@ -711,7 +711,9 @@ namespace
OUString& _out_rColumnName, OUString& _out_rTableRange,
const OSQLColumns* _pSelectColumns, OUString& _out_rColumnAliasIfPresent )
{
- _out_rColumnName = _out_rTableRange = _out_rColumnAliasIfPresent = "";
+ _out_rColumnName.clear();
+ _out_rTableRange.clear();
+ _out_rColumnAliasIfPresent.clear();
if ( SQL_ISRULE( _pColumnRef, column_ref ) )
{
if( _pColumnRef->count() > 1 )
@@ -1081,8 +1083,8 @@ void OSQLParseTreeIterator::traverseByColumnNames(const OSQLParseNode* pSelectNo
pColumnRef = pColumnRef->getChild(0);
}
OSL_ENSURE(pColumnRef != NULL,"OSQLParseTreeIterator: error in parse tree!");
- aTableRange = "";
- sColumnName = "";
+ aTableRange.clear();
+ sColumnName.clear();
if ( SQL_ISRULE(pColumnRef,column_ref) )
{
// Column name (and TableRange):
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index 37bfbdeda2a6..aaedf70b30b7 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -361,7 +361,7 @@ bool OSQLParseNode::parseNodeToExecutableStatement( OUString& _out_rString, cons
aParseParam.pParser = &_rParser;
- _out_rString = "";
+ _out_rString.clear();
OUStringBuffer sBuffer;
bool bSuccess = false;
try
@@ -777,7 +777,8 @@ bool OSQLParseNode::getTableComponents(const OSQLParseNode* _pTableNode,
const OSQLParseNode* pTableNode = _pTableNode;
// clear the parameter given
_rCatalog = Any();
- _rSchema = _rTable = "";
+ _rSchema.clear();
+ _rTable.clear();
// see rule catalog_name: in sqlbison.y
if (SQL_ISRULE(pTableNode,catalog_name))
{
@@ -1269,12 +1270,12 @@ OSQLParseNode* OSQLParser::predicateTree(OUString& rErrorMessage, const OUString
SQLyylval.pParseNode = NULL;
// SQLyypvt = NULL;
m_pParseTree = NULL;
- m_sErrorMessage = "";
+ m_sErrorMessage.clear();
// Start the parser
if (SQLyyparse() != 0)
{
- m_sFieldName = "";
+ m_sFieldName.clear();
m_xField.clear();
m_xFormatter.clear();
m_nFormatKey = 0;
@@ -1295,7 +1296,7 @@ OSQLParseNode* OSQLParser::predicateTree(OUString& rErrorMessage, const OUString
{
(*s_pGarbageCollector)->clear();
- m_sFieldName = "";
+ m_sFieldName.clear();
m_xField.clear();
m_xFormatter.clear();
m_nFormatKey = 0;