From 8b091048d1e02f73dfc80b7e981bcd58fb801902 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 6 May 2024 10:17:16 +0200 Subject: [PATCH] loplugin:ostr avmedia Change-Id: Ice017029f0b93ae92e76d3905f38c730cc5a2fc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167189 Tested-by: Jenkins Reviewed-by: Noel Grandin --- animations/source/animcore/animcore.cxx | 12 ++--- avmedia/source/framework/MediaControlBase.cxx | 48 +++++++++---------- avmedia/source/framework/mediacontrol.cxx | 30 ++++++------ avmedia/source/framework/mediaitem.cxx | 4 +- avmedia/source/framework/mediatoolbox.cxx | 4 +- avmedia/source/gstreamer/gstmanager.cxx | 4 +- avmedia/source/viewer/mediawindow.cxx | 4 +- avmedia/source/viewer/mediawindow_impl.cxx | 4 +- 8 files changed, 55 insertions(+), 55 deletions(-) diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx index 9e097ec98733..76bac60014c0 100644 --- a/animations/source/animcore/animcore.cxx +++ b/animations/source/animcore/animcore.cxx @@ -1893,7 +1893,7 @@ Reference< XAnimationNode > SAL_CALL AnimationNode::insertBefore( const Referenc std::unique_lock l( m_aMutex ); if( !newChild.is() || !refChild.is() ) - throw IllegalArgumentException("no child", static_cast(this), -1); + throw IllegalArgumentException(u"no child"_ustr, static_cast(this), -1); if( std::find(maChildren.begin(), maChildren.end(), newChild) != maChildren.end() ) throw ElementExistException(); @@ -1918,7 +1918,7 @@ Reference< XAnimationNode > SAL_CALL AnimationNode::insertAfter( const Reference std::unique_lock l( m_aMutex ); if( !newChild.is() || !refChild.is() ) - throw IllegalArgumentException("no child", static_cast(this), -1); + throw IllegalArgumentException(u"no child"_ustr, static_cast(this), -1); if( std::find(maChildren.begin(), maChildren.end(), newChild) != maChildren.end() ) throw ElementExistException(); @@ -1947,7 +1947,7 @@ Reference< XAnimationNode > SAL_CALL AnimationNode::replaceChild( const Referenc std::unique_lock l( m_aMutex ); if( !newChild.is() || !oldChild.is() ) - throw IllegalArgumentException("no child", static_cast(this), -1); + throw IllegalArgumentException(u"no child"_ustr, static_cast(this), -1); if( std::find(maChildren.begin(), maChildren.end(), newChild) != maChildren.end() ) throw ElementExistException(); @@ -1973,7 +1973,7 @@ Reference< XAnimationNode > SAL_CALL AnimationNode::removeChild( const Reference std::unique_lock l( m_aMutex ); if( !oldChild.is() ) - throw IllegalArgumentException("no child", static_cast(this), 1); + throw IllegalArgumentException(u"no child"_ustr, static_cast(this), 1); auto old = std::find(maChildren.begin(), maChildren.end(), oldChild); if( old == maChildren.end() ) @@ -1996,13 +1996,13 @@ Reference< XAnimationNode > SAL_CALL AnimationNode::appendChild( const Reference std::unique_lock aGuard( m_aMutex ); if( !newChild.is() ) - throw IllegalArgumentException("no child", xThis, 1); + throw IllegalArgumentException(u"no child"_ustr, xThis, 1); if( std::find(maChildren.begin(), maChildren.end(), newChild) != maChildren.end() ) throw ElementExistException({}, xThis); if( xThis == newChild ) - throw IllegalArgumentException("cannot append self", xThis, -1); + throw IllegalArgumentException(u"cannot append self"_ustr, xThis, -1); maChildren.push_back( newChild ); } diff --git a/avmedia/source/framework/MediaControlBase.cxx b/avmedia/source/framework/MediaControlBase.cxx index fb8f91066b67..9d09e925372c 100644 --- a/avmedia/source/framework/MediaControlBase.cxx +++ b/avmedia/source/framework/MediaControlBase.cxx @@ -106,11 +106,11 @@ void MediaControlBase::UpdateTimeSlider( MediaItem const & aMediaItem ) void MediaControlBase::InitializeWidgets() { - mxPlayToolBox->set_item_help_id("play", HID_AVMEDIA_TOOLBOXITEM_PLAY); - mxPlayToolBox->set_item_help_id("pause", HID_AVMEDIA_TOOLBOXITEM_PAUSE); - mxPlayToolBox->set_item_help_id("stop", HID_AVMEDIA_TOOLBOXITEM_STOP); - mxPlayToolBox->set_item_help_id("loop", HID_AVMEDIA_TOOLBOXITEM_LOOP); - mxMuteToolBox->set_item_help_id("mute", HID_AVMEDIA_TOOLBOXITEM_MUTE); + mxPlayToolBox->set_item_help_id(u"play"_ustr, HID_AVMEDIA_TOOLBOXITEM_PLAY); + mxPlayToolBox->set_item_help_id(u"pause"_ustr, HID_AVMEDIA_TOOLBOXITEM_PAUSE); + mxPlayToolBox->set_item_help_id(u"stop"_ustr, HID_AVMEDIA_TOOLBOXITEM_STOP); + mxPlayToolBox->set_item_help_id(u"loop"_ustr, HID_AVMEDIA_TOOLBOXITEM_LOOP); + mxMuteToolBox->set_item_help_id(u"mute"_ustr, HID_AVMEDIA_TOOLBOXITEM_MUTE); mxZoomListBox->append(OUString::number(AVMEDIA_ZOOMLEVEL_50), AvmResId( AVMEDIA_STR_ZOOM_50 )); mxZoomListBox->append(OUString::number(AVMEDIA_ZOOMLEVEL_100), AvmResId( AVMEDIA_STR_ZOOM_100 )); @@ -119,7 +119,7 @@ void MediaControlBase::InitializeWidgets() mxZoomListBox->set_help_id( HID_AVMEDIA_ZOOMLISTBOX ); mxZoomListBox->set_tooltip_text(AvmResId( AVMEDIA_STR_ZOOM_TOOLTIP )); - mxTimeEdit->set_text( " 00:00:00/00:00:00 " ); + mxTimeEdit->set_text( u" 00:00:00/00:00:00 "_ustr ); mxTimeEdit->set_help_id( HID_AVMEDIA_TIMEEDIT ); mxTimeEdit->set_sensitive(false); @@ -135,32 +135,32 @@ void MediaControlBase::UpdatePlayState(const MediaItem& rMediaItem) { if (rMediaItem.getState() == MediaState::Play) { - mxPlayToolBox->set_item_active("play", true); - mxPlayToolBox->set_item_active("pause", false); - mxPlayToolBox->set_item_active("stop", false); + mxPlayToolBox->set_item_active(u"play"_ustr, true); + mxPlayToolBox->set_item_active(u"pause"_ustr, false); + mxPlayToolBox->set_item_active(u"stop"_ustr, false); } else if( rMediaItem.getState() == MediaState::Pause ) { - mxPlayToolBox->set_item_active("play", false); - mxPlayToolBox->set_item_active("pause", true); - mxPlayToolBox->set_item_active("stop", false); + mxPlayToolBox->set_item_active(u"play"_ustr, false); + mxPlayToolBox->set_item_active(u"pause"_ustr, true); + mxPlayToolBox->set_item_active(u"stop"_ustr, false); } else { - mxPlayToolBox->set_item_active("play", false); - mxPlayToolBox->set_item_active("pause", false); - mxPlayToolBox->set_item_active("stop", true); + mxPlayToolBox->set_item_active(u"play"_ustr, false); + mxPlayToolBox->set_item_active(u"pause"_ustr, false); + mxPlayToolBox->set_item_active(u"stop"_ustr, true); } } void MediaControlBase::UpdateToolBoxes(const MediaItem& rMediaItem) { const bool bValidURL = !rMediaItem.getURL().isEmpty(); - mxPlayToolBox->set_item_sensitive("play", bValidURL); - mxPlayToolBox->set_item_sensitive("pause", bValidURL); - mxPlayToolBox->set_item_sensitive("stop", bValidURL); - mxPlayToolBox->set_item_sensitive("loop", bValidURL); - mxMuteToolBox->set_item_sensitive("mute", bValidURL); + mxPlayToolBox->set_item_sensitive(u"play"_ustr, bValidURL); + mxPlayToolBox->set_item_sensitive(u"pause"_ustr, bValidURL); + mxPlayToolBox->set_item_sensitive(u"stop"_ustr, bValidURL); + mxPlayToolBox->set_item_sensitive(u"loop"_ustr, bValidURL); + mxMuteToolBox->set_item_sensitive(u"mute"_ustr, bValidURL); if( !bValidURL ) { mxZoomListBox->set_sensitive(false); @@ -171,8 +171,8 @@ void MediaControlBase::UpdateToolBoxes(const MediaItem& rMediaItem) mxPlayToolBox->set_sensitive(true); mxMuteToolBox->set_sensitive(true); UpdatePlayState(rMediaItem); - mxPlayToolBox->set_item_active("loop", rMediaItem.isLoop()); - mxMuteToolBox->set_item_active("mute", rMediaItem.isMute()); + mxPlayToolBox->set_item_active(u"loop"_ustr, rMediaItem.isLoop()); + mxMuteToolBox->set_item_active(u"mute"_ustr, rMediaItem.isMute()); if (!mbCurrentlySettingZoom) { sal_uInt16 nSelectEntryPos ; @@ -247,11 +247,11 @@ void MediaControlBase::SelectPlayToolBoxItem( MediaItem& aExecItem, MediaItem co } else if (rId == u"mute") { - aExecItem.setMute( mxMuteToolBox->get_item_active("mute") ); + aExecItem.setMute( mxMuteToolBox->get_item_active(u"mute"_ustr) ); } else if (rId == u"loop") { - aExecItem.setLoop( mxPlayToolBox->get_item_active("loop") ); + aExecItem.setLoop( mxPlayToolBox->get_item_active(u"loop"_ustr) ); } } diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx index a9c33ff45455..569061cfe27a 100644 --- a/avmedia/source/framework/mediacontrol.cxx +++ b/avmedia/source/framework/mediacontrol.cxx @@ -32,22 +32,22 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl // MediaControlStyle::MultiLine is the normal docking windows of tools->media player // MediaControlStyle::SingleLine is the toolbar of view->toolbar->media playback InterimItemWindow(pParent, eControlStyle == MediaControlStyle::MultiLine ? - OUString("svx/ui/mediawindow.ui") : - OUString("svx/ui/medialine.ui"), - "MediaWindow"), + u"svx/ui/mediawindow.ui"_ustr : + u"svx/ui/medialine.ui"_ustr, + u"MediaWindow"_ustr), maIdle( "avmedia MediaControl Idle" ), maChangeTimeIdle( "avmedia MediaControl Change Time Idle" ), maItem( 0, AVMediaSetMask::ALL ), mbLocked( false ), meControlStyle( eControlStyle ) { - mxPlayToolBox = m_xBuilder->weld_toolbar("playtoolbox"); - mxTimeSlider = m_xBuilder->weld_scale("timeslider"); - mxMuteToolBox = m_xBuilder->weld_toolbar("mutetoolbox"); - mxVolumeSlider = m_xBuilder->weld_scale("volumeslider"); - mxZoomListBox = m_xBuilder->weld_combo_box("zoombox"); - mxTimeEdit = m_xBuilder->weld_entry("timeedit"); - mxMediaPath = m_xBuilder->weld_label("url"); + mxPlayToolBox = m_xBuilder->weld_toolbar(u"playtoolbox"_ustr); + mxTimeSlider = m_xBuilder->weld_scale(u"timeslider"_ustr); + mxMuteToolBox = m_xBuilder->weld_toolbar(u"mutetoolbox"_ustr); + mxVolumeSlider = m_xBuilder->weld_scale(u"volumeslider"_ustr); + mxZoomListBox = m_xBuilder->weld_combo_box(u"zoombox"_ustr); + mxTimeEdit = m_xBuilder->weld_entry(u"timeedit"_ustr); + mxMediaPath = m_xBuilder->weld_label(u"url"_ustr); InitializeWidgets(); @@ -59,7 +59,7 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl maChangeTimeIdle.SetPriority( TaskPriority::LOWEST ); maChangeTimeIdle.SetInvokeHandler( LINK( this, MediaControl, implTimeEndHdl ) ); - mxTimeEdit->set_text(" 00:00:00/00:00:00 "); + mxTimeEdit->set_text(u" 00:00:00/00:00:00 "_ustr); Size aTextSize = mxTimeEdit->get_preferred_size(); mxTimeEdit->set_size_request(aTextSize.Width(), aTextSize.Height()); mxTimeEdit->set_text(OUString()); @@ -85,8 +85,8 @@ void MediaControl::InitializeWidgets() { if( meControlStyle != MediaControlStyle::SingleLine ) { - mxPlayToolBox->set_item_help_id("open", HID_AVMEDIA_TOOLBOXITEM_OPEN); - mxPlayToolBox->set_item_help_id("apply", HID_AVMEDIA_TOOLBOXITEM_INSERT); + mxPlayToolBox->set_item_help_id(u"open"_ustr, HID_AVMEDIA_TOOLBOXITEM_OPEN); + mxPlayToolBox->set_item_help_id(u"apply"_ustr, HID_AVMEDIA_TOOLBOXITEM_INSERT); } avmedia::MediaControlBase::InitializeWidgets(); } @@ -164,11 +164,11 @@ IMPL_LINK( MediaControl, implSelectHdl, const OUString&, rIdent, void ) OUString aURL; if (MediaWindow::executeMediaURLDialog(GetFrameWeld(), aURL, nullptr)) { - if( !MediaWindow::isMediaURL( aURL, ""/*TODO?*/, true ) ) + if( !MediaWindow::isMediaURL( aURL, u""_ustr/*TODO?*/, true ) ) MediaWindow::executeFormatErrorBox(GetFrameWeld()); else { - aExecItem.setURL( aURL, "", ""/*TODO?*/ ); + aExecItem.setURL( aURL, u""_ustr, u""_ustr/*TODO?*/ ); aExecItem.setState( MediaState::Play ); } } diff --git a/avmedia/source/framework/mediaitem.cxx b/avmedia/source/framework/mediaitem.cxx index 320a24bc9bfe..ce04a88b6668 100644 --- a/avmedia/source/framework/mediaitem.cxx +++ b/avmedia/source/framework/mediaitem.cxx @@ -450,10 +450,10 @@ CreateStream(uno::Reference const& xStorage, uno::UNO_QUERY); if (xStreamProps.is()) { // this is NOT supported in FileSystemStorage OUString const guessed(::comphelper::GuessMediaMimeType(filename)); - xStreamProps->setPropertyValue("MediaType", + xStreamProps->setPropertyValue(u"MediaType"_ustr, uno::Any(guessed.isEmpty() ? AVMEDIA_MIMETYPE_COMMON : guessed)); xStreamProps->setPropertyValue( // turn off compression - "Compressed", uno::Any(false)); + u"Compressed"_ustr, uno::Any(false)); } return xStream; } diff --git a/avmedia/source/framework/mediatoolbox.cxx b/avmedia/source/framework/mediatoolbox.cxx index 55a19ac6601d..490ba08ac65a 100644 --- a/avmedia/source/framework/mediatoolbox.cxx +++ b/avmedia/source/framework/mediatoolbox.cxx @@ -112,7 +112,7 @@ VclPtr MediaToolBoxControl::CreateItemWindow( vcl::Window *pP void MediaToolBoxControl::implUpdateMediaControl() { - updateStatus( ".uno:AVMediaToolBox" ); + updateStatus( u".uno:AVMediaToolBox"_ustr ); } void MediaToolBoxControl::implExecuteMediaControl( const MediaItem& rItem ) @@ -126,7 +126,7 @@ void MediaToolBoxControl::implExecuteMediaControl( const MediaItem& rItem ) { "AVMediaToolBox", aAny } })); - Dispatch( ".uno:AVMediaToolBox" , aArgs ); + Dispatch( u".uno:AVMediaToolBox"_ustr , aArgs ); } } // namespace avmedia diff --git a/avmedia/source/gstreamer/gstmanager.cxx b/avmedia/source/gstreamer/gstmanager.cxx index 54d23541676e..addbccd231bf 100644 --- a/avmedia/source/gstreamer/gstmanager.cxx +++ b/avmedia/source/gstreamer/gstmanager.cxx @@ -50,7 +50,7 @@ uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const OUString& OUString SAL_CALL Manager::getImplementationName( ) { - return "com.sun.star.comp.media.Manager_GStreamer"; + return u"com.sun.star.comp.media.Manager_GStreamer"_ustr; } sal_Bool SAL_CALL Manager::supportsService( const OUString& ServiceName ) @@ -60,7 +60,7 @@ sal_Bool SAL_CALL Manager::supportsService( const OUString& ServiceName ) uno::Sequence< OUString > SAL_CALL Manager::getSupportedServiceNames( ) { - return { "com.sun.star.media.Manager" }; + return { u"com.sun.star.media.Manager"_ustr }; } } // namespace diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx index cc369bed6264..140eab4dcd49 100644 --- a/avmedia/source/viewer/mediawindow.cxx +++ b/avmedia/source/viewer/mediawindow.cxx @@ -257,7 +257,7 @@ bool MediaWindow::executeMediaURLDialog(weld::Window* pParent, OUString& rURL, b } // add filter for all types - aDlg.AddFilter( AvmResId( AVMEDIA_STR_ALL_FILES ), "*.*" ); + aDlg.AddFilter( AvmResId( AVMEDIA_STR_ALL_FILES ), u"*.*"_ustr ); uno::Reference const xFP(aDlg.GetFilePicker()); uno::Reference const xCtrlAcc(xFP, @@ -450,7 +450,7 @@ void MediaWindow::dispatchInsertAVMedia(const css::uno::Reference xTrans(css::util::URLTransformer::create(::comphelper::getProcessComponentContext())); xTrans->parseStrict(aDispatchURL); - css::uno::Reference xDispatch = rDispatchProvider->queryDispatch(aDispatchURL, "", 0); + css::uno::Reference xDispatch = rDispatchProvider->queryDispatch(aDispatchURL, u""_ustr, 0); css::uno::Sequence aArgs(comphelper::InitPropertySequence({ { "URL", css::uno::Any(rURL) }, { "Size.Width", uno::Any(rSize.Width)}, diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index 82ca1b92821c..502adbc124e6 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -185,9 +185,9 @@ uno::Reference MediaWindowImpl::createPlayer(const OUString& rUR { uno::Reference xContext(::comphelper::getProcessComponentContext()); if (Application::GetToolkitName() == "gtk4") - xPlayer = createPlayer(rURL, "com.sun.star.comp.avmedia.Manager_Gtk", xContext); + xPlayer = createPlayer(rURL, u"com.sun.star.comp.avmedia.Manager_Gtk"_ustr, xContext); else - xPlayer = createPlayer(rURL, AVMEDIA_MANAGER_SERVICE_NAME, xContext); + xPlayer = createPlayer(rURL, u"" AVMEDIA_MANAGER_SERVICE_NAME ""_ustr, xContext); } return xPlayer;