diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-02 01:18:42 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-02 18:46:47 +0200 |
commit | 116b9d6ddf2b61186b29f0370234eec9c1bbe306 (patch) | |
tree | 7f90a12333274086e33c4e0fabfd96a8e54e6b6c /toolkit | |
parent | d7ba78e9c7be835a1e2ecdacd25995663e96862f (diff) |
Avoid conversions between OUString and OString in VCL
Standardize on OUString, which is the main internal string class.
Convert from/to OUString only when communicating with respective
external APIs.
Removes about 200 conversions from the code.
Change-Id: I96ecee7c6fd271bb76639220e96d69d2964bed26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149930
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxmenu.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 9 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindows.cxx | 2 |
3 files changed, 6 insertions, 9 deletions
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index 52edfb5caa49..f8c662ae2480 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -282,7 +282,7 @@ void VCLXMenu::insertItem( std::unique_lock aGuard( maMutex ); if ( mpMenu ) - mpMenu->InsertItem(nItemId, aText, static_cast<MenuItemBits>(nItemStyle), OString(), nPos); + mpMenu->InsertItem(nItemId, aText, static_cast<MenuItemBits>(nItemStyle), {}, nPos); } void VCLXMenu::removeItem( @@ -430,7 +430,7 @@ void VCLXMenu::insertSeparator( std::unique_lock aGuard( maMutex ); if ( mpMenu ) - mpMenu->InsertSeparator(OString(), nPos); + mpMenu->InsertSeparator({}, nPos); } void VCLXMenu::setDefaultItem( diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index f3985bc12df5..1c7dcf5990b1 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -1532,9 +1532,9 @@ void VCLXWindow::setProperty( const OUString& PropertyName, const css::uno::Any& { INetURLObject aHelpURL( aURL ); if ( aHelpURL.GetProtocol() == INetProtocol::Hid ) - pWindow->SetHelpId( OUStringToOString( aHelpURL.GetURLPath(), RTL_TEXTENCODING_UTF8 ) ); + pWindow->SetHelpId( aHelpURL.GetURLPath() ); else - pWindow->SetHelpId( OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ) ); + pWindow->SetHelpId( aURL ); } } break; @@ -2042,10 +2042,7 @@ css::uno::Any VCLXWindow::getProperty( const OUString& PropertyName ) } break; case BASEPROPERTY_HELPURL: - { - OUString aHelpId( OStringToOUString( GetWindow()->GetHelpId(), RTL_TEXTENCODING_UTF8 ) ); - aProp <<= aHelpId; - } + aProp <<= GetWindow()->GetHelpId(); break; case BASEPROPERTY_FONTDESCRIPTOR: { diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 8fc6dc0277db..abe8c9057b00 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -2236,7 +2236,7 @@ void SAL_CALL VCLXDialog::setHelpId( const OUString& rId ) SolarMutexGuard aGuard; VclPtr< vcl::Window > pWindow = GetWindow(); if ( pWindow ) - pWindow->SetHelpId( OUStringToOString( rId, RTL_TEXTENCODING_UTF8 ) ); + pWindow->SetHelpId( rId ); } void VCLXDialog::setTitle( const OUString& Title ) |