diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-12-12 17:51:11 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-12-12 17:51:11 +0100 |
commit | bca00da68640bb052c1628270ce3924b7228d7b8 (patch) | |
tree | d03f7763ed89ffd94256e2bf0fb5b352de9b0711 /connectivity/source/drivers | |
parent | 77d844c9a92fdc1b8ffa043f46ea50bc1cfa7e05 (diff) |
connectivity: Use appropriate OUString functions on string constants
Change-Id: I10b2ddf9dcc83219fea8eb55783507eed52702e8
Diffstat (limited to 'connectivity/source/drivers')
9 files changed, 24 insertions, 31 deletions
diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx index dbb3c675a516..4e1551674152 100644 --- a/connectivity/source/drivers/file/FConnection.cxx +++ b/connectivity/source/drivers/file/FConnection.cxx @@ -105,9 +105,9 @@ void OConnection::construct(const OUString& url,const Sequence< PropertyValue >& const PropertyValue *pEnd = pIter + info.getLength(); for(;pIter != pEnd;++pIter) { - if( pIter->Name.equalsAscii("Extension")) + if( pIter->Name == "Extension" ) OSL_VERIFY( pIter->Value >>= aExt ); - else if( pIter->Name.equalsAscii("CharSet")) + else if( pIter->Name == "CharSet" ) { OUString sIanaName; OSL_VERIFY( pIter->Value >>= sIanaName ); @@ -119,11 +119,11 @@ void OConnection::construct(const OUString& url,const Sequence< PropertyValue >& else m_nTextEncoding = RTL_TEXTENCODING_DONTKNOW; } - else if( pIter->Name.equalsAscii("ShowDeleted")) + else if( pIter->Name == "ShowDeleted" ) { OSL_VERIFY( pIter->Value >>= m_bShowDeleted ); } - else if( pIter->Name.equalsAscii("EnableSQL92Check")) + else if( pIter->Name == "EnableSQL92Check" ) { pIter->Value >>= m_bCheckSQL92; } diff --git a/connectivity/source/drivers/flat/EConnection.cxx b/connectivity/source/drivers/flat/EConnection.cxx index 37d1d7877751..e3518e7dfe96 100644 --- a/connectivity/source/drivers/flat/EConnection.cxx +++ b/connectivity/source/drivers/flat/EConnection.cxx @@ -68,33 +68,33 @@ void OFlatConnection::construct(const OUString& url,const Sequence< PropertyValu const PropertyValue *pEnd = pBegin + info.getLength(); for(;pBegin != pEnd;++pBegin) { - if(pBegin->Name.equalsAscii("HeaderLine")) + if(pBegin->Name == "HeaderLine") OSL_VERIFY( pBegin->Value >>= m_bHeaderLine ); - else if(pBegin->Name.equalsAscii("FieldDelimiter")) + else if(pBegin->Name == "FieldDelimiter") { OUString aVal; OSL_VERIFY( pBegin->Value >>= aVal ); m_cFieldDelimiter = aVal.toChar(); } - else if(pBegin->Name.equalsAscii("StringDelimiter")) + else if(pBegin->Name == "StringDelimiter") { OUString aVal; OSL_VERIFY( pBegin->Value >>= aVal ); m_cStringDelimiter = aVal.toChar(); } - else if(pBegin->Name.equalsAscii("DecimalDelimiter")) + else if(pBegin->Name == "DecimalDelimiter") { OUString aVal; OSL_VERIFY( pBegin->Value >>= aVal ); m_cDecimalDelimiter = aVal.toChar(); } - else if(pBegin->Name.equalsAscii("ThousandDelimiter")) + else if(pBegin->Name == "ThousandDelimiter") { OUString aVal; OSL_VERIFY( pBegin->Value >>= aVal ); m_cThousandDelimiter = aVal.toChar(); } - else if ( pBegin->Name.equalsAscii("MaxRowScan") ) + else if ( pBegin->Name == "MaxRowScan" ) { pBegin->Value >>= m_nMaxRowsToScan; } diff --git a/connectivity/source/drivers/hsqldb/HConnection.cxx b/connectivity/source/drivers/hsqldb/HConnection.cxx index 70fc2529af3d..836a20d140ac 100644 --- a/connectivity/source/drivers/hsqldb/HConnection.cxx +++ b/connectivity/source/drivers/hsqldb/HConnection.cxx @@ -146,7 +146,7 @@ namespace connectivity { namespace hsqldb const PropertyValue* pEnd = pIter + aInfo.getLength(); for(;pIter != pEnd;++pIter) { - if ( pIter->Name.equalsAscii("readonly") ) + if ( pIter->Name == "readonly" ) m_bReadOnly = true; } } diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx index 2ff063cba27a..31923db3579a 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, std::exception) { - if ( m_Type.equalsAscii("VIEW") ) + if ( m_Type == "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, std::exception) { - if( m_Type.equalsAscii("VIEW") && rType == cppu::UnoType<XRename>::get()) + if( m_Type == "VIEW" && rType == cppu::UnoType<XRename>::get()) return Any(); return OTableHelper::queryInterface(rType); diff --git a/connectivity/source/drivers/mork/MDriver.cxx b/connectivity/source/drivers/mork/MDriver.cxx index a9ee71078d16..48fd9a8754bb 100644 --- a/connectivity/source/drivers/mork/MDriver.cxx +++ b/connectivity/source/drivers/mork/MDriver.cxx @@ -118,13 +118,7 @@ sal_Bool MorkDriver::acceptsURL(OUString const & url) aAddrbookScheme = aAddrbookURI.copy(0, nLen); } - if (aAddrbookScheme.equalsAscii( "thunderbird" ) || - aAddrbookScheme.equalsAscii( "mozilla" ) ) - { - return true; - } - - return false; + return aAddrbookScheme == "thunderbird" || aAddrbookScheme == "mozilla"; } css::uno::Sequence< css::sdbc::DriverPropertyInfo > MorkDriver::getPropertyInfo( diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx index da81055fa87f..0021fe378292 100644 --- a/connectivity/source/drivers/mork/MResultSet.cxx +++ b/connectivity/source/drivers/mork/MResultSet.cxx @@ -880,8 +880,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT matchString = parseTree->getChild(2)->getTokenValue(); } - if ( columnName.equalsAscii("0") && op == MQueryOp::Is && - matchString.equalsAscii("1") ) { + if ( columnName == "0" && op == MQueryOp::Is && matchString == "1" ) { OSL_TRACE("Query always evaluates to FALSE"); m_bIsAlwaysFalseQuery = true; } diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx index 3c524aece845..27d870b0e7e9 100644 --- a/connectivity/source/drivers/odbc/OConnection.cxx +++ b/connectivity/source/drivers/odbc/OConnection.cxx @@ -152,7 +152,7 @@ SQLRETURN OConnection::OpenConnection(const OUString& aConnectStr, sal_Int32 nTi { OUString aVal; OTools::GetInfo(this,m_aConnectionHandle,SQL_DATA_SOURCE_READ_ONLY,aVal,*this,getTextEncoding()); - m_bReadOnly = aVal.equalsAscii("Y"); + m_bReadOnly = aVal == "Y"; } catch(Exception&) { diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx index 6762ecde37fa..420aa3eb1ef3 100644 --- a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx +++ b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx @@ -1210,13 +1210,13 @@ void ODatabaseMetaDataResultSet::openImportedKeys(const Any& catalog, const OUSt const OUString& table) throw(SQLException, RuntimeException) { - openForeignKeys(Any(),NULL,NULL,catalog, schema.equalsAscii("%") ? &schema : NULL, &table); + openForeignKeys(Any(),NULL,NULL,catalog, schema == "%" ? &schema : NULL, &table); } void ODatabaseMetaDataResultSet::openExportedKeys(const Any& catalog, const OUString& schema, const OUString& table) throw(SQLException, RuntimeException) { - openForeignKeys(catalog, schema.equalsAscii("%") ? &schema : NULL, &table,Any(),NULL,NULL); + openForeignKeys(catalog, schema == "%" ? &schema : NULL, &table,Any(),NULL,NULL); } void ODatabaseMetaDataResultSet::openPrimaryKeys(const Any& catalog, const OUString& schema, diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx index de0200fe9174..33c3209a4d4f 100644 --- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx @@ -1185,9 +1185,9 @@ sal_Bool DatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw (SQLExc row[1] <<= xRow->getString( 1 ); row[2] <<= xRow->getString( 2 ); OUString type = xRow->getString(3); - if( type.equalsAscii( "r" ) ) + if( type == "r" ) { - if( xRow->getString(1).equalsAscii( "pg_catalog" ) ) + if( xRow->getString(1) == "pg_catalog" ) { row[3] <<= statics.SYSTEM_TABLE; } @@ -1196,7 +1196,7 @@ sal_Bool DatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw (SQLExc row[3] <<= statics.TABLE; } } - else if( type.equalsAscii( "v" ) ) + else if( type == "v" ) { row[3] <<= statics.VIEW; } @@ -1323,7 +1323,7 @@ sal_Int32 typeNameToDataType( const OUString &typeName, const OUString &typtype // string representation. Additionally, the edit-table-type-selection-box // is not so unusable anymore. sal_Int32 ret = com::sun::star::sdbc::DataType::LONGVARCHAR; - if( typtype.equalsAscii( "b" ) ) + if( typtype == "b" ) { // as long as the OOo framework does not support arrays, // the user is better of with interpreting arrays as strings ! @@ -1341,11 +1341,11 @@ sal_Int32 typeNameToDataType( const OUString &typeName, const OUString &typtype ret = ii->second; } } - else if( typtype.equalsAscii( "c" ) ) + else if( typtype == "c" ) { ret = com::sun::star::sdbc::DataType::STRUCT; } - else if( typtype.equalsAscii( "d" ) ) + else if( typtype == "d" ) { ret = com::sun::star::sdbc::DataType::LONGVARCHAR; } |