From 937b63af3322f7f8b5e869b2c7431a2deaec3113 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Sat, 9 Mar 2013 22:47:20 +0100 Subject: use startsWith() instead of compareToAscii() brain damage... Change-Id: I4dc63c7346f724eded9ac7b82cda25c2bb60beff --- connectivity/source/commontools/AutoRetrievingBase.cxx | 2 +- connectivity/source/drivers/ado/AConnection.cxx | 2 +- connectivity/source/drivers/hsqldb/HDriver.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/commontools/AutoRetrievingBase.cxx b/connectivity/source/commontools/AutoRetrievingBase.cxx index e88fe4160214..6e39c85cc8b4 100644 --- a/connectivity/source/commontools/AutoRetrievingBase.cxx +++ b/connectivity/source/commontools/AutoRetrievingBase.cxx @@ -27,7 +27,7 @@ namespace connectivity OSL_ENSURE( m_bAutoRetrievingEnabled,"Illegal call here. isAutoRetrievingEnabled is false!"); sStmt = sStmt.toAsciiUpperCase(); ::rtl::OUString sStatement; - if ( sStmt.compareToAscii("INSERT",6) == 0 ) + if ( sStmt.startsWith("INSERT") ) { sStatement = m_sGeneratedValueStatement; static const ::rtl::OUString sColumn(RTL_CONSTASCII_USTRINGPARAM("$column")); diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx index 2b24b24d67ed..9ffc553f3182 100644 --- a/connectivity/source/drivers/ado/AConnection.cxx +++ b/connectivity/source/drivers/ado/AConnection.cxx @@ -106,7 +106,7 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV sal_Int32 nLen = url.indexOf(':'); nLen = url.indexOf(':',nLen+1); ::rtl::OUString aDSN(url.copy(nLen+1)),aUID,aPWD; - if ( aDSN.compareToAscii("access:",7) == 0 ) + if ( aDSN.startsWith("access:") ) aDSN = aDSN.copy(7); sal_Int32 nTimeout = 20; diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx index 3f2a96bfbd68..d58c8f56d941 100644 --- a/connectivity/source/drivers/hsqldb/HDriver.cxx +++ b/connectivity/source/drivers/hsqldb/HDriver.cxx @@ -399,7 +399,7 @@ namespace connectivity { sal_Bool bEnabled = sal_False; OSL_VERIFY_EQUALS( jfw_getEnabled( &bEnabled ), JFW_E_NONE, "error in jfw_getEnabled" ); - return bEnabled && url.compareToAscii("sdbc:embedded:hsqldb",sizeof("sdbc:embedded:hsqldb")) == 0; + return bEnabled && url.startsWith("sdbc:embedded:hsqldb"); } //-------------------------------------------------------------------- -- cgit