Kaydet (Commit) 624a116d authored tarafından Noel Grandin's avatar Noel Grandin

use OUString::startsWith()

Change-Id: I0fc77b50792e48be175ab7cc151509e097676849
üst ebc0a155
......@@ -115,12 +115,12 @@ namespace connectivity
bool isOdbcUrl(const OUString& _sUrl)
{
return _sUrl.copy(0,16) == "sdbc:mysql:odbc:";
return _sUrl.startsWith("sdbc:mysql:odbc:");
}
bool isNativeUrl(const OUString& _sUrl)
{
return (!_sUrl.compareTo(OUString("sdbc:mysql:mysqlc:"), sizeof("sdbc:mysql:mysqlc:")-1));
return _sUrl.startsWith("sdbc:mysql:mysqlc:");
}
T_DRIVERTYPE lcl_getDriverType(const OUString& _sUrl)
......
......@@ -118,7 +118,7 @@ void OConnection::construct(const OUString& url, const Sequence< PropertyValue >
// parse url. Url has the following format:
// external server: sdbc:mysqlc:[hostname]:[port]/[dbname]
if (!url.compareTo(OUString(MYSQLC_URI_PREFIX), sizeof(MYSQLC_URI_PREFIX)-1)) {
if (url.startsWith(MYSQLC_URI_PREFIX)) {
nIndex = 12;
} else {
bEmbedded = sal_True;
......
......@@ -243,7 +243,7 @@ sal_Bool SAL_CALL MysqlCDriver::acceptsURL(const OUString& url)
throw(SQLException, RuntimeException, std::exception)
{
OSL_TRACE("MysqlCDriver::acceptsURL");
return (!url.compareTo(OUString("sdbc:mysqlc:"), sizeof("sdbc:mysqlc:")-1));
return url.startsWith("sdbc:mysqlc:");
}
/* }}} */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment