connectivity: Use appropriate OUString functions on string constants

Change-Id: I9ca72364cd57fd2da0c6f5f704a3fe494c0a1df5
This commit is contained in:
Stephan Bergmann 2014-12-18 13:21:30 +01:00
parent acb7ca4283
commit ecf24f3032
14 changed files with 29 additions and 26 deletions

View File

@ -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() )

View File

@ -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();

View File

@ -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();
}

View File

@ -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

View File

@ -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)

View File

@ -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())

View File

@ -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;

View File

@ -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(

View File

@ -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();
}

View File

@ -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";
}

View File

@ -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)

View File

@ -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 ...

View File

@ -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):

View File

@ -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;