diff options
author | David Ostrovsky <david@ostrovsky.org> | 2012-11-20 22:19:51 +0100 |
---|---|---|
committer | David Ostrovsky <david@ostrovsky.org> | 2012-11-20 22:40:40 +0100 |
commit | 4b9c10e298a5285edbeb87c47303c151209abded (patch) | |
tree | 5667f56c2049b12378268ae8c07256c96a235e7d /connectivity/source/drivers/mork/MDriver.cxx | |
parent | d23764182ccb5d1e96774cc958a7afaaa659e114 (diff) |
fdo#57285 restore acceptsURL logic
Change-Id: Ib03c7e4a78510eb0300d78a0ae3e83ec6a17f72f
Diffstat (limited to 'connectivity/source/drivers/mork/MDriver.cxx')
-rw-r--r-- | connectivity/source/drivers/mork/MDriver.cxx | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/connectivity/source/drivers/mork/MDriver.cxx b/connectivity/source/drivers/mork/MDriver.cxx index c5998921e324..9e96464b178e 100644 --- a/connectivity/source/drivers/mork/MDriver.cxx +++ b/connectivity/source/drivers/mork/MDriver.cxx @@ -95,10 +95,42 @@ sal_Bool MorkDriver::acceptsURL(rtl::OUString const & url) throw (css::sdbc::SQLException, css::uno::RuntimeException) { SAL_INFO("connectivity.mork", "=> MorkDriver::acceptsURL()" ); + // Skip 'sdbc:mozab: part of URL + // + sal_Int32 nLen = url.indexOf(':'); + nLen = url.indexOf(':',nLen+1); + OUString aAddrbookURI(url.copy(nLen+1)); + // Get Scheme + nLen = aAddrbookURI.indexOf(':'); + OUString aAddrbookScheme; + if ( nLen == -1 ) + { + // There isn't any subschema: - but could be just subschema + if ( !aAddrbookURI.isEmpty() ) + { + aAddrbookScheme= aAddrbookURI; + } + else if(url == OUString("sdbc:address:") ) + { + return false; + } + else + { + return false; + } + } + else + { + aAddrbookScheme = aAddrbookURI.copy(0, nLen); + } - //... TODO - (void) url; // avoid warnings - return true; + if ((aAddrbookScheme.compareToAscii( "thunderbird" ) == 0) || + (aAddrbookScheme.compareToAscii( "mozilla" ) == 0)) + { + return true; + } + + return false; } css::uno::Sequence< css::sdbc::DriverPropertyInfo > MorkDriver::getPropertyInfo( |