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 /avmedia | |
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 'avmedia')
-rw-r--r-- | avmedia/inc/helpids.h | 24 | ||||
-rw-r--r-- | avmedia/inc/mediacontrol.hxx | 2 | ||||
-rw-r--r-- | avmedia/source/framework/MediaControlBase.cxx | 14 | ||||
-rw-r--r-- | avmedia/source/framework/mediacontrol.cxx | 2 |
4 files changed, 21 insertions, 21 deletions
diff --git a/avmedia/inc/helpids.h b/avmedia/inc/helpids.h index 1f9a4c305e1d..f49f12fb3e00 100644 --- a/avmedia/inc/helpids.h +++ b/avmedia/inc/helpids.h @@ -19,18 +19,18 @@ #pragma once -#include <rtl/string.hxx> +#include <rtl/ustring.hxx> -inline constexpr OStringLiteral HID_AVMEDIA_TOOLBOXITEM_PLAY = "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_PLAY"; -inline constexpr OStringLiteral HID_AVMEDIA_TOOLBOXITEM_PAUSE = "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_PAUSE"; -inline constexpr OStringLiteral HID_AVMEDIA_TOOLBOXITEM_STOP = "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_STOP"; -inline constexpr OStringLiteral HID_AVMEDIA_TOOLBOXITEM_MUTE = "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_MUTE"; -inline constexpr OStringLiteral HID_AVMEDIA_TOOLBOXITEM_LOOP = "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_LOOP"; -inline constexpr OStringLiteral HID_AVMEDIA_TOOLBOXITEM_OPEN = "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_OPEN"; -inline constexpr OStringLiteral HID_AVMEDIA_TOOLBOXITEM_INSERT = "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_INSERT"; -inline constexpr OStringLiteral HID_AVMEDIA_ZOOMLISTBOX = "AVMEDIA_HID_AVMEDIA_ZOOMLISTBOX"; -inline constexpr OStringLiteral HID_AVMEDIA_TIMEEDIT = "AVMEDIA_HID_AVMEDIA_TIMEEDIT"; -inline constexpr OStringLiteral HID_AVMEDIA_VOLUMESLIDER = "AVMEDIA_HID_AVMEDIA_VOLUMESLIDER"; -inline constexpr OStringLiteral HID_AVMEDIA_PLAYERWINDOW = "AVMEDIA_HID_AVMEDIA_PLAYERWINDOW"; +inline constexpr OUStringLiteral HID_AVMEDIA_TOOLBOXITEM_PLAY = u"AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_PLAY"; +inline constexpr OUStringLiteral HID_AVMEDIA_TOOLBOXITEM_PAUSE = u"AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_PAUSE"; +inline constexpr OUStringLiteral HID_AVMEDIA_TOOLBOXITEM_STOP = u"AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_STOP"; +inline constexpr OUStringLiteral HID_AVMEDIA_TOOLBOXITEM_MUTE = u"AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_MUTE"; +inline constexpr OUStringLiteral HID_AVMEDIA_TOOLBOXITEM_LOOP = u"AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_LOOP"; +inline constexpr OUStringLiteral HID_AVMEDIA_TOOLBOXITEM_OPEN = u"AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_OPEN"; +inline constexpr OUStringLiteral HID_AVMEDIA_TOOLBOXITEM_INSERT = u"AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_INSERT"; +inline constexpr OUStringLiteral HID_AVMEDIA_ZOOMLISTBOX = u"AVMEDIA_HID_AVMEDIA_ZOOMLISTBOX"; +inline constexpr OUStringLiteral HID_AVMEDIA_TIMEEDIT = u"AVMEDIA_HID_AVMEDIA_TIMEEDIT"; +inline constexpr OUStringLiteral HID_AVMEDIA_VOLUMESLIDER = u"AVMEDIA_HID_AVMEDIA_VOLUMESLIDER"; +inline constexpr OUStringLiteral HID_AVMEDIA_PLAYERWINDOW = u"AVMEDIA_HID_AVMEDIA_PLAYERWINDOW"; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/avmedia/inc/mediacontrol.hxx b/avmedia/inc/mediacontrol.hxx index 6b004626ff83..f168ef566807 100644 --- a/avmedia/inc/mediacontrol.hxx +++ b/avmedia/inc/mediacontrol.hxx @@ -57,7 +57,7 @@ private: DECL_LINK(implTimeHdl, weld::Scale&, void); DECL_LINK(implTimeEndHdl, Timer*, void); DECL_LINK(implVolumeHdl, weld::Scale&, void); - DECL_LINK(implSelectHdl, const OString&, void); + DECL_LINK(implSelectHdl, const OUString&, void); DECL_LINK(implZoomSelectHdl, weld::ComboBox&, void); DECL_LINK(implTimeoutHdl, Timer*, void); diff --git a/avmedia/source/framework/MediaControlBase.cxx b/avmedia/source/framework/MediaControlBase.cxx index 534c27c2c33c..d2c254293811 100644 --- a/avmedia/source/framework/MediaControlBase.cxx +++ b/avmedia/source/framework/MediaControlBase.cxx @@ -209,16 +209,16 @@ void MediaControlBase::UpdateToolBoxes(const MediaItem& rMediaItem) } } -void MediaControlBase::SelectPlayToolBoxItem( MediaItem& aExecItem, MediaItem const & aItem, std::string_view rId) +void MediaControlBase::SelectPlayToolBoxItem( MediaItem& aExecItem, MediaItem const & aItem, std::u16string_view rId) { - if (rId == "apply") + if (rId == u"apply") { MediaFloater* pFloater = avmedia::getMediaFloater(); if( pFloater ) pFloater->dispatchCurrentURL(); } - else if (rId == "play") + else if (rId == u"play") { aExecItem.setState( MediaState::Play ); @@ -229,24 +229,24 @@ void MediaControlBase::SelectPlayToolBoxItem( MediaItem& aExecItem, MediaItem co UpdatePlayState(aExecItem); } - else if (rId == "pause") + else if (rId == u"pause") { aExecItem.setState( MediaState::Pause ); UpdatePlayState(aExecItem); } - else if (rId == "stop") + else if (rId == u"stop") { aExecItem.setState( MediaState::Stop ); aExecItem.setTime( 0.0 ); UpdatePlayState(aExecItem); } - else if (rId == "mute") + else if (rId == u"mute") { aExecItem.setMute( mxMuteToolBox->get_item_active("mute") ); } - else if (rId == "loop") + else if (rId == u"loop") { aExecItem.setLoop( mxPlayToolBox->get_item_active("loop") ); } diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx index 23d700595f95..a9c33ff45455 100644 --- a/avmedia/source/framework/mediacontrol.cxx +++ b/avmedia/source/framework/mediacontrol.cxx @@ -156,7 +156,7 @@ IMPL_LINK( MediaControl, implVolumeHdl, weld::Scale&, rSlider, void ) update(); } -IMPL_LINK( MediaControl, implSelectHdl, const OString&, rIdent, void ) +IMPL_LINK( MediaControl, implSelectHdl, const OUString&, rIdent, void ) { MediaItem aExecItem; if (rIdent == "open") |