diff options
author | Noel Grandin <noel@peralex.com> | 2013-11-05 11:32:52 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-11-11 12:58:12 +0200 |
commit | ef90021abe3735fba57145598fd7c3d359d2718e (patch) | |
tree | 9da3ef32700774f56e0225ea28f3bc4ceaffe80c /connectivity/source | |
parent | 0a9ef5a18e148c7a5c9a088e153a7873d1564841 (diff) |
convert OUString !compareToAscii to equalsAscii
Convert code like
if( ! aStr.compareToAscii("XXX") )
to
if( aStr.equalsAscii("XXX") )
which is both clearer and faster.
Change-Id: I267511bccab52f5225b291acbfa4e388b5a5302b
Diffstat (limited to 'connectivity/source')
6 files changed, 16 insertions, 16 deletions
diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx index c70f9256df12..3c39006d413b 100644 --- a/connectivity/source/drivers/ado/AConnection.cxx +++ b/connectivity/source/drivers/ado/AConnection.cxx @@ -115,13 +115,13 @@ void OConnection::construct(const OUString& url,const Sequence< PropertyValue >& const PropertyValue *pEnd = pIter + info.getLength(); for(;pIter != pEnd;++pIter) { - if(!pIter->Name.compareToAscii("Timeout")) + if(pIter->Name.equalsAscii("Timeout")) pIter->Value >>= nTimeout; - else if(!pIter->Name.compareToAscii("Silent")) + else if(pIter->Name.equalsAscii("Silent")) pIter->Value >>= bSilent; - else if(!pIter->Name.compareToAscii("user")) + else if(pIter->Name.equalsAscii("user")) pIter->Value >>= aUID; - else if(!pIter->Name.compareToAscii("password")) + else if(pIter->Name.equalsAscii("password")) pIter->Value >>= aPWD; } try diff --git a/connectivity/source/drivers/calc/CConnection.cxx b/connectivity/source/drivers/calc/CConnection.cxx index 39ada1a70ac5..dc2f25b7fdea 100644 --- a/connectivity/source/drivers/calc/CConnection.cxx +++ b/connectivity/source/drivers/calc/CConnection.cxx @@ -94,7 +94,7 @@ void OCalcConnection::construct(const OUString& url,const Sequence< PropertyValu const PropertyValue *pEnd = pIter + info.getLength(); for(;pIter != pEnd;++pIter) { - if(!pIter->Name.compareToAscii(pPwd)) + if(pIter->Name.equalsAscii(pPwd)) { pIter->Value >>= m_sPassword; break; diff --git a/connectivity/source/drivers/evoab2/NConnection.cxx b/connectivity/source/drivers/evoab2/NConnection.cxx index 2f3309ec9378..d06613304489 100644 --- a/connectivity/source/drivers/evoab2/NConnection.cxx +++ b/connectivity/source/drivers/evoab2/NConnection.cxx @@ -105,7 +105,7 @@ void OEvoabConnection::construct(const OUString& url, const Sequence< PropertyVa const PropertyValue *pEnd = pIter + info.getLength(); for(;pIter != pEnd;++pIter) { - if(!pIter->Name.compareToAscii(pPwd)) + if(pIter->Name.equalsAscii(pPwd)) { pIter->Value >>= sPassword; break; diff --git a/connectivity/source/drivers/flat/EConnection.cxx b/connectivity/source/drivers/flat/EConnection.cxx index c76d2d6751ae..3ed139065eca 100644 --- a/connectivity/source/drivers/flat/EConnection.cxx +++ b/connectivity/source/drivers/flat/EConnection.cxx @@ -67,33 +67,33 @@ void OFlatConnection::construct(const OUString& url,const Sequence< PropertyValu const PropertyValue *pEnd = pBegin + info.getLength(); for(;pBegin != pEnd;++pBegin) { - if(!pBegin->Name.compareToAscii("HeaderLine")) + if(pBegin->Name.equalsAscii("HeaderLine")) OSL_VERIFY( pBegin->Value >>= m_bHeaderLine ); - else if(!pBegin->Name.compareToAscii("FieldDelimiter")) + else if(pBegin->Name.equalsAscii("FieldDelimiter")) { OUString aVal; OSL_VERIFY( pBegin->Value >>= aVal ); m_cFieldDelimiter = aVal.toChar(); } - else if(!pBegin->Name.compareToAscii("StringDelimiter")) + else if(pBegin->Name.equalsAscii("StringDelimiter")) { OUString aVal; OSL_VERIFY( pBegin->Value >>= aVal ); m_cStringDelimiter = aVal.toChar(); } - else if(!pBegin->Name.compareToAscii("DecimalDelimiter")) + else if(pBegin->Name.equalsAscii("DecimalDelimiter")) { OUString aVal; OSL_VERIFY( pBegin->Value >>= aVal ); m_cDecimalDelimiter = aVal.toChar(); } - else if(!pBegin->Name.compareToAscii("ThousandDelimiter")) + else if(pBegin->Name.equalsAscii("ThousandDelimiter")) { OUString aVal; OSL_VERIFY( pBegin->Value >>= aVal ); m_cThousandDelimiter = aVal.toChar(); } - else if ( !pBegin->Name.compareToAscii("MaxRowScan") ) + else if ( pBegin->Name.equalsAscii("MaxRowScan") ) { pBegin->Value >>= m_nMaxRowsToScan; } diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx index cd9e06ac810e..79edbf500078 100644 --- a/connectivity/source/drivers/hsqldb/HTable.cxx +++ b/connectivity/source/drivers/hsqldb/HTable.cxx @@ -342,7 +342,7 @@ void OHSQLTable::executeStatement(const OUString& _rStatement ) // ----------------------------------------------------------------------------- Sequence< Type > SAL_CALL OHSQLTable::getTypes( ) throw(RuntimeException) { - if ( ! m_Type.compareToAscii("VIEW") ) + if ( m_Type.equalsAscii("VIEW") ) { Sequence< Type > aTypes = OTableHelper::getTypes(); ::std::vector<Type> aOwnTypes; @@ -401,7 +401,7 @@ void SAL_CALL OHSQLTable::rename( const OUString& newName ) throw(SQLException, // ------------------------------------------------------------------------- Any SAL_CALL OHSQLTable::queryInterface( const Type & rType ) throw(RuntimeException) { - if( !m_Type.compareToAscii("VIEW") && rType == ::getCppuType((const Reference<XRename>*)0) ) + if( m_Type.equalsAscii("VIEW") && rType == ::getCppuType((const Reference<XRename>*)0) ) return Any(); return OTableHelper::queryInterface(rType); diff --git a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx index fec93c5b8955..2e772fc17f00 100644 --- a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx +++ b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx @@ -1205,13 +1205,13 @@ void ODatabaseMetaDataResultSet::openImportedKeys(const Any& catalog, const OUSt const OUString& table) throw(SQLException, RuntimeException) { - openForeignKeys(Any(),NULL,NULL,catalog,!schema.compareToAscii("%") ? &schema : NULL,&table); + openForeignKeys(Any(),NULL,NULL,catalog, schema.equalsAscii("%") ? &schema : NULL, &table); } // ------------------------------------------------------------------------- void ODatabaseMetaDataResultSet::openExportedKeys(const Any& catalog, const OUString& schema, const OUString& table) throw(SQLException, RuntimeException) { - openForeignKeys(catalog,!schema.compareToAscii("%") ? &schema : NULL,&table,Any(),NULL,NULL); + openForeignKeys(catalog, schema.equalsAscii("%") ? &schema : NULL, &table,Any(),NULL,NULL); } // ------------------------------------------------------------------------- void ODatabaseMetaDataResultSet::openPrimaryKeys(const Any& catalog, const OUString& schema, |