diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-19 12:06:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-19 15:04:33 +0200 |
commit | 6a0a0a4d78bb8850bf4a304b83784d3822895efe (patch) | |
tree | 2800dce4daa42965a010336456117733830e2694 /dbaccess | |
parent | 832b23d9376019619929764606276aacde1e329a (diff) |
use more string_view in comphelper::string
Change-Id: I5d27824694e38de540e5f1fcd8704f8777f65140
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114261
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/misc/dsntypes.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/inc/dsntypes.hxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppDetailPageHelper.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionHelper.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionHelper.hxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.hxx | 2 |
7 files changed, 15 insertions, 15 deletions
diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx index 494994c347da..aca8aacb560b 100644 --- a/dbaccess/source/core/misc/dsntypes.cxx +++ b/dbaccess/source/core/misc/dsntypes.cxx @@ -77,7 +77,7 @@ OUString ODsnTypeCollection::getTypeDisplayName(std::u16string_view _sURL) const return m_aDriverConfig.getDriverTypeDisplayName(_sURL); } -OUString ODsnTypeCollection::cutPrefix(const OUString& _sURL) const +OUString ODsnTypeCollection::cutPrefix(std::u16string_view _sURL) const { OUString sRet; OUString sOldPattern; @@ -292,7 +292,7 @@ OUString ODsnTypeCollection::getEmbeddedDatabase() } -DATASOURCE_TYPE ODsnTypeCollection::determineType(const OUString& _rDsn) const +DATASOURCE_TYPE ODsnTypeCollection::determineType(std::u16string_view _rDsn) const { OUString sDsn(comphelper::string::stripEnd(_rDsn, '*')); sal_Int32 nSeparator = sDsn.indexOf(u':'); @@ -403,7 +403,7 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(const OUString& _rDsn) const return DST_UNKNOWN; } -void ODsnTypeCollection::fillPageIds(const OUString& _sURL,std::vector<sal_Int16>& _rOutPathIds) const +void ODsnTypeCollection::fillPageIds(std::u16string_view _sURL,std::vector<sal_Int16>& _rOutPathIds) const { DATASOURCE_TYPE eType = determineType(_sURL); switch(eType) diff --git a/dbaccess/source/inc/dsntypes.hxx b/dbaccess/source/inc/dsntypes.hxx index 629759ccfd47..b7642c66f20c 100644 --- a/dbaccess/source/inc/dsntypes.hxx +++ b/dbaccess/source/inc/dsntypes.hxx @@ -121,7 +121,7 @@ public: OUString getTypeDisplayName(std::u16string_view _sURL) const; /// on a given string, cut the type prefix and return the result - OUString cutPrefix(const OUString& _sURL) const; + OUString cutPrefix(std::u16string_view _sURL) const; /// on a given string, return the type prefix OUString getPrefix(const OUString& _sURL) const; @@ -175,9 +175,9 @@ public: /// get access to the (last + 1st) element of the types collection inline TypeIterator end() const; - void fillPageIds(const OUString& _sURL,std::vector<sal_Int16>& _rOutPathIds) const; + void fillPageIds(std::u16string_view _sURL,std::vector<sal_Int16>& _rOutPathIds) const; - DATASOURCE_TYPE determineType(const OUString& _rDsn) const; + DATASOURCE_TYPE determineType(std::u16string_view _rDsn) const; sal_Int32 getIndexOf(std::u16string_view _sURL) const; sal_Int32 size() const; diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 1ab3c0ad29bf..f13926e3d204 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -884,7 +884,7 @@ bool OAppDetailPageHelper::isPreviewEnabled() const namespace { - OUString stripTrailingDots(const OUString& rStr) + OUString stripTrailingDots(std::u16string_view rStr) { return comphelper::string::stripEnd(rStr, '.'); } diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 4339d3bc3e08..722ee44a87ca 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -364,7 +364,7 @@ namespace dbaui return true; } - void OConnectionHelper::impl_setURL( const OUString& _rURL, bool _bPrefix ) + void OConnectionHelper::impl_setURL( std::u16string_view _rURL, bool _bPrefix ) { OUString sURL( comphelper::string::stripEnd(_rURL, '*') ); OSL_ENSURE( m_pCollection, "OConnectionHelper::impl_setURL: have no interpreter for the URLs!" ); @@ -436,7 +436,7 @@ namespace dbaui return sURL; } - void OConnectionHelper::setURL( const OUString& _rURL ) + void OConnectionHelper::setURL( std::u16string_view _rURL ) { impl_setURL( _rURL, true ); } @@ -446,7 +446,7 @@ namespace dbaui return impl_getURL(); } - void OConnectionHelper::setURLNoPrefix( const OUString& _rURL ) + void OConnectionHelper::setURLNoPrefix( std::u16string_view _rURL ) { impl_setURL( _rURL, false ); } diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.hxx b/dbaccess/source/ui/dlg/ConnectionHelper.hxx index 7129e1f5600b..5b765dfa50b1 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.hxx @@ -65,7 +65,7 @@ namespace dbaui //void setURL( const OUString& _rURL, OConnectionURLEdit* _m_pConnection ); OUString getURLNoPrefix( ) const; - void setURLNoPrefix( const OUString& _rURL ); + void setURLNoPrefix( std::u16string_view _rURL ); /** checks if the path is existence @param _rURL @@ -84,7 +84,7 @@ namespace dbaui void askForFileName(::sfx2::FileDialogHelper& _aFileOpen); protected: - void setURL( const OUString& _rURL ); + void setURL( std::u16string_view _rURL ); virtual bool checkTestConnection(); private: @@ -93,7 +93,7 @@ namespace dbaui DECL_LINK(GetFocusHdl, weld::Widget&, void); DECL_LINK(LoseFocusHdl, weld::Widget&, void); OUString impl_getURL() const; - void impl_setURL( const OUString& _rURL, bool _bPrefix ); + void impl_setURL( std::u16string_view _rURL, bool _bPrefix ); void implUpdateURLDependentStates() const; }; diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index d02ac934fba7..5de35c10c539 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -297,7 +297,7 @@ namespace dbaui // representative for all MySQl databases) // Also, embedded databases (embedded HSQL, at the moment), are not to appear in the list of // databases to connect to. - bool OGeneralPage::approveDatasourceType( const OUString& _sURLPrefix, OUString& _inout_rDisplayName ) + bool OGeneralPage::approveDatasourceType( std::u16string_view _sURLPrefix, OUString& _inout_rDisplayName ) { return approveDatasourceType( m_pCollection->determineType(_sURLPrefix), _inout_rDisplayName ); } diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index 452817a056cf..810fd44d0682 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -46,7 +46,7 @@ namespace dbaui Link<OGeneralPage&,void> m_aTypeSelectHandler; /// to be called if a new type is selected bool m_bInitTypeList : 1; - bool approveDatasourceType( const OUString& _sURLPrefix, OUString& _inout_rDisplayName ); + bool approveDatasourceType( std::u16string_view _sURLPrefix, OUString& _inout_rDisplayName ); void insertDatasourceTypeEntryData( const OUString& _sType, const OUString& sDisplayName ); protected: |