diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-15 16:45:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-15 20:12:11 +0200 |
commit | f9a15395dc1d71a9597296e0e29e266cf9441a7e (patch) | |
tree | 58dd78d3bc7be5fb5b14bd5ccc6de683a7ad25c7 /connectivity | |
parent | 558aaa9ed222e7142fe87c9bab9a8293a5e2a159 (diff) |
use more string_view in connectivity
Change-Id: I916db7599e600ba795e02b7afd29b54d1dc7187e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133073
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/hsqldb/HStorageMap.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/drivers/mysql_jdbc/YDriver.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/inc/hsqldb/HStorageMap.hxx | 2 | ||||
-rw-r--r-- | connectivity/source/inc/mysql/YDriver.hxx | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx index 63b5e0481c5c..aba88f192801 100644 --- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx @@ -132,9 +132,9 @@ namespace connectivity::hsqldb return OUString::number(s_nCount++); } - OUString StorageContainer::removeURLPrefix(const OUString& _sURL,const OUString& _sFileURL) + OUString StorageContainer::removeURLPrefix(std::u16string_view _sURL,const OUString& _sFileURL) { - return _sURL.copy(_sFileURL.getLength()+1); + return OUString(_sURL.substr(_sFileURL.getLength()+1)); } OUString StorageContainer::removeOldURLPrefix(const OUString& _sURL) diff --git a/connectivity/source/drivers/mysql_jdbc/YDriver.cxx b/connectivity/source/drivers/mysql_jdbc/YDriver.cxx index 7ee501d42e81..69d2386990ae 100644 --- a/connectivity/source/drivers/mysql_jdbc/YDriver.cxx +++ b/connectivity/source/drivers/mysql_jdbc/YDriver.cxx @@ -115,9 +115,9 @@ T_DRIVERTYPE lcl_getDriverType(std::u16string_view _sUrl) return eRet; } -OUString transformUrl(const OUString& _sUrl) +OUString transformUrl(std::u16string_view _sUrl) { - OUString sNewUrl = _sUrl.copy(11); + OUString sNewUrl(_sUrl.substr(11)); if (isOdbcUrl(_sUrl)) sNewUrl = "sdbc:" + sNewUrl; else if (isNativeUrl(_sUrl)) @@ -187,7 +187,7 @@ Sequence<PropertyValue> lcl_convertProperties(T_DRIVERTYPE _eType, } } -Reference<XDriver> ODriverDelegator::loadDriver(const OUString& url, +Reference<XDriver> ODriverDelegator::loadDriver(std::u16string_view url, const Sequence<PropertyValue>& info) { Reference<XDriver> xDriver; diff --git a/connectivity/source/inc/hsqldb/HStorageMap.hxx b/connectivity/source/inc/hsqldb/HStorageMap.hxx index ee4590864016..06f31e6df326 100644 --- a/connectivity/source/inc/hsqldb/HStorageMap.hxx +++ b/connectivity/source/inc/hsqldb/HStorageMap.hxx @@ -86,7 +86,7 @@ namespace connectivity::hsqldb static TStreamMap::mapped_type getRegisteredStream( JNIEnv * env, jstring name, jstring key); static OUString jstring2ustring(JNIEnv * env, jstring jstr); - static OUString removeURLPrefix(const OUString& _sURL,const OUString& _sFileURL); + static OUString removeURLPrefix(std::u16string_view _sURL,const OUString& _sFileURL); static OUString removeOldURLPrefix(const OUString& _sURL); static void throwJavaException(const css::uno::Exception& _aException,JNIEnv * env); }; diff --git a/connectivity/source/inc/mysql/YDriver.hxx b/connectivity/source/inc/mysql/YDriver.hxx index 7bdb499718fd..84fad1af1c99 100644 --- a/connectivity/source/inc/mysql/YDriver.hxx +++ b/connectivity/source/inc/mysql/YDriver.hxx @@ -72,7 +72,7 @@ namespace connectivity @return The driver which was currently selected. */ - css::uno::Reference< css::sdbc::XDriver > loadDriver( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ); + css::uno::Reference< css::sdbc::XDriver > loadDriver( std::u16string_view url, const css::uno::Sequence< css::beans::PropertyValue >& info ); public: /** creates a new delegator for a mysql driver |