diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-07 17:53:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-09 16:28:13 +0200 |
commit | 3fbadf2801f4c13f086d76a3ed566180cc0693dc (patch) | |
tree | 6ec41f5a137122ce803bb4aa82d2548fe60e337b /dbaccess/source | |
parent | f707834e8538c0a183716b26ebdf04381482ca6d (diff) |
use more OUStringToOString
which makes it easier to pass around string_view in a few places.
Change-Id: Icbbb7f56494986582f1c3272404775bd98031240
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150129
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/ui/control/charsetlistbox.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/DbAdminImpl.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/charsetlistbox.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/charsets.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/charsets.cxx | 2 |
5 files changed, 5 insertions, 6 deletions
diff --git a/dbaccess/source/ui/control/charsetlistbox.cxx b/dbaccess/source/ui/control/charsetlistbox.cxx index 8915b65c9455..e6090ccfd84d 100644 --- a/dbaccess/source/ui/control/charsetlistbox.cxx +++ b/dbaccess/source/ui/control/charsetlistbox.cxx @@ -34,7 +34,7 @@ namespace dbaui } } - void CharSetListBox::SelectEntryByIanaName( const OUString& _rIanaName ) + void CharSetListBox::SelectEntryByIanaName( std::u16string_view _rIanaName ) { OCharsetDisplay::const_iterator aFind = m_aCharSets.findIanaName( _rIanaName ); if (aFind == m_aCharSets.end()) diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index 2f60d21a9101..97210e843b00 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -860,8 +860,7 @@ OString ODbDataSourceAdministrationHelper::translatePropertyId( sal_Int32 _nId ) aString = indirectPos->second; } - OString aReturn( aString.getStr(), aString.getLength(), RTL_TEXTENCODING_ASCII_US ); - return aReturn; + return OUStringToOString( aString, RTL_TEXTENCODING_ASCII_US ); } template<class T> static bool checkItemType(const SfxPoolItem* pItem){ return dynamic_cast<const T*>(pItem) != nullptr;} diff --git a/dbaccess/source/ui/inc/charsetlistbox.hxx b/dbaccess/source/ui/inc/charsetlistbox.hxx index aedfb6ec50a4..2b91bbb5389f 100644 --- a/dbaccess/source/ui/inc/charsetlistbox.hxx +++ b/dbaccess/source/ui/inc/charsetlistbox.hxx @@ -32,7 +32,7 @@ namespace dbaui public: CharSetListBox(std::unique_ptr<weld::ComboBox> xControl); - void SelectEntryByIanaName( const OUString& _rIanaName ); + void SelectEntryByIanaName( std::u16string_view _rIanaName ); bool StoreSelectedCharSet( SfxItemSet& _rSet, const sal_uInt16 _nItemId ); weld::ComboBox* get_widget() { return m_xControl.get(); } diff --git a/dbaccess/source/ui/inc/charsets.hxx b/dbaccess/source/ui/inc/charsets.hxx index 4d4454e010d1..49977bd56262 100644 --- a/dbaccess/source/ui/inc/charsets.hxx +++ b/dbaccess/source/ui/inc/charsets.hxx @@ -43,7 +43,7 @@ namespace dbaui // various find operations const_iterator findEncoding(const rtl_TextEncoding _eEncoding) const; - const_iterator findIanaName(const OUString& _rIanaName) const; + const_iterator findIanaName(std::u16string_view _rIanaName) const; const_iterator findDisplayName(const OUString& _rDisplayName) const; /// get access to the first element of the charset collection diff --git a/dbaccess/source/ui/misc/charsets.cxx b/dbaccess/source/ui/misc/charsets.cxx index 3cec6284511e..5224e65d3c63 100644 --- a/dbaccess/source/ui/misc/charsets.cxx +++ b/dbaccess/source/ui/misc/charsets.cxx @@ -62,7 +62,7 @@ namespace dbaui return const_iterator( this, aBaseIter ); } - OCharsetDisplay::const_iterator OCharsetDisplay::findIanaName(const OUString& _rIanaName) const + OCharsetDisplay::const_iterator OCharsetDisplay::findIanaName(std::u16string_view _rIanaName) const { OCharsetMap::const_iterator aBaseIter = OCharsetMap::findIanaName(_rIanaName); return const_iterator( this, aBaseIter ); |