diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-05-18 21:14:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-05-19 15:40:40 +0200 |
commit | 2155e04d6343638ca9815d394cbc4f78c2b17c3a (patch) | |
tree | 0378142f6ce9edb63074291aed45527568e7b254 /avmedia | |
parent | cee02e81cd3b55fb46eacf5db5713e8bf4363bcd (diff) |
make string translation loading more uniform
change various ResId classes that use conversion operator to OUString to
functions that return a OUString
drop various defines
drop unnecessary toString calls
Change-Id: Ibeccdf2b91a46a2ed5b4b74e6024e301a023bc92
Reviewed-on: https://gerrit.libreoffice.org/37817
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/framework/MediaControlBase.cxx | 18 | ||||
-rw-r--r-- | avmedia/source/framework/mediacontrol.cxx | 10 | ||||
-rw-r--r-- | avmedia/source/framework/mediaplayer.cxx | 2 | ||||
-rw-r--r-- | avmedia/source/inc/mediamisc.hxx | 17 | ||||
-rw-r--r-- | avmedia/source/viewer/mediawindow.cxx | 8 |
5 files changed, 28 insertions, 27 deletions
diff --git a/avmedia/source/framework/MediaControlBase.cxx b/avmedia/source/framework/MediaControlBase.cxx index b828efb990b6..c4174f0304d4 100644 --- a/avmedia/source/framework/MediaControlBase.cxx +++ b/avmedia/source/framework/MediaControlBase.cxx @@ -97,27 +97,27 @@ void MediaControlBase::UpdateTimeSlider( MediaItem aMediaItem ) void MediaControlBase::InitializeWidgets() { - mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_PLAY, GetImage(AVMEDIA_TOOLBOXITEM_PLAY), OUString( AVMEDIA_RESID( AVMEDIA_STR_PLAY ) ), ToolBoxItemBits::CHECKABLE ); + mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_PLAY, GetImage(AVMEDIA_TOOLBOXITEM_PLAY), OUString( AvmResId( AVMEDIA_STR_PLAY ) ), ToolBoxItemBits::CHECKABLE ); mpPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_PLAY, HID_AVMEDIA_TOOLBOXITEM_PLAY ); - mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_PAUSE, GetImage(AVMEDIA_TOOLBOXITEM_PAUSE), OUString( AVMEDIA_RESID( AVMEDIA_STR_PAUSE ) ), ToolBoxItemBits::CHECKABLE ); + mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_PAUSE, GetImage(AVMEDIA_TOOLBOXITEM_PAUSE), OUString( AvmResId( AVMEDIA_STR_PAUSE ) ), ToolBoxItemBits::CHECKABLE ); mpPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_PAUSE, HID_AVMEDIA_TOOLBOXITEM_PAUSE ); - mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_STOP, GetImage(AVMEDIA_TOOLBOXITEM_STOP), OUString( AVMEDIA_RESID( AVMEDIA_STR_STOP ) ), ToolBoxItemBits::CHECKABLE ); + mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_STOP, GetImage(AVMEDIA_TOOLBOXITEM_STOP), OUString( AvmResId( AVMEDIA_STR_STOP ) ), ToolBoxItemBits::CHECKABLE ); mpPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_STOP, HID_AVMEDIA_TOOLBOXITEM_STOP ); mpPlayToolBox->InsertSeparator(); - mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_LOOP, GetImage(AVMEDIA_TOOLBOXITEM_LOOP), OUString( AVMEDIA_RESID( AVMEDIA_STR_LOOP ) ) ); + mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_LOOP, GetImage(AVMEDIA_TOOLBOXITEM_LOOP), OUString( AvmResId( AVMEDIA_STR_LOOP ) ) ); mpPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_LOOP, HID_AVMEDIA_TOOLBOXITEM_LOOP ); - mpMuteToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_MUTE, GetImage(AVMEDIA_TOOLBOXITEM_MUTE), OUString( AVMEDIA_RESID( AVMEDIA_STR_MUTE ) ) ); + mpMuteToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_MUTE, GetImage(AVMEDIA_TOOLBOXITEM_MUTE), OUString( AvmResId( AVMEDIA_STR_MUTE ) ) ); mpMuteToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_MUTE, HID_AVMEDIA_TOOLBOXITEM_MUTE ); - mpZoomListBox->InsertEntry( OUString( AVMEDIA_RESID( AVMEDIA_STR_ZOOM_50 ) ), AVMEDIA_ZOOMLEVEL_50 ); - mpZoomListBox->InsertEntry( OUString( AVMEDIA_RESID( AVMEDIA_STR_ZOOM_100 ) ), AVMEDIA_ZOOMLEVEL_100 ); - mpZoomListBox->InsertEntry( OUString( AVMEDIA_RESID( AVMEDIA_STR_ZOOM_200 ) ), AVMEDIA_ZOOMLEVEL_200 ); - mpZoomListBox->InsertEntry( OUString( AVMEDIA_RESID( AVMEDIA_STR_ZOOM_FIT ) ), AVMEDIA_ZOOMLEVEL_FIT ); + mpZoomListBox->InsertEntry( OUString( AvmResId( AVMEDIA_STR_ZOOM_50 ) ), AVMEDIA_ZOOMLEVEL_50 ); + mpZoomListBox->InsertEntry( OUString( AvmResId( AVMEDIA_STR_ZOOM_100 ) ), AVMEDIA_ZOOMLEVEL_100 ); + mpZoomListBox->InsertEntry( OUString( AvmResId( AVMEDIA_STR_ZOOM_200 ) ), AVMEDIA_ZOOMLEVEL_200 ); + mpZoomListBox->InsertEntry( OUString( AvmResId( AVMEDIA_STR_ZOOM_FIT ) ), AVMEDIA_ZOOMLEVEL_FIT ); mpZoomListBox->SetHelpId( HID_AVMEDIA_ZOOMLISTBOX ); const OUString aTimeText( " 00:00:00/00:00:00 " ); diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx index 698042eb9a73..be6528b44e8b 100644 --- a/avmedia/source/framework/mediacontrol.cxx +++ b/avmedia/source/framework/mediacontrol.cxx @@ -89,7 +89,7 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl mpZoomListBox->SetSizePixel( Size( mpTimeEdit->GetSizePixel().Width(), 260 ) ); mpZoomListBox->SetSelectHdl( LINK( this, MediaControl, implZoomSelectHdl ) ); - mpZoomToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_ZOOM, OUString( AVMEDIA_RESID( AVMEDIA_STR_ZOOM ) ) ); + mpZoomToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_ZOOM, OUString( AvmResId( AVMEDIA_STR_ZOOM ) ) ); mpZoomToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_ZOOM, HID_AVMEDIA_ZOOMLISTBOX ); mpZoomToolBox->SetItemWindow( AVMEDIA_TOOLBOXITEM_ZOOM, mpZoomListBox ); @@ -98,7 +98,7 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl mpZoomToolBox->Show(); maMinSize.Width() += mpZoomToolBox->GetSizePixel().Width(); - const OUString aMediaPath( AVMEDIA_RESID( AVMEDIA_MEDIA_PATH_DEFAULT ) ); + const OUString aMediaPath( AvmResId( AVMEDIA_MEDIA_PATH_DEFAULT ) ); mpMediaPath->SetText(aMediaPath); mpMediaPath->SetUpdateMode( false ); mpMediaPath->SetSizePixel( Size( mpMediaPath->GetTextWidth( aMediaPath ) + 400, mpPlayToolBox->GetSizePixel().Height() ) ); // maybe extend the no. 400 to span the screen width @@ -123,9 +123,9 @@ void MediaControl::InitializeWidgets() { if( meControlStyle != MEDIACONTROLSTYLE_SINGLELINE ) { - mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_OPEN, GetImage(AVMEDIA_TOOLBOXITEM_OPEN), OUString( AVMEDIA_RESID( AVMEDIA_STR_OPEN ) ) ); + mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_OPEN, GetImage(AVMEDIA_TOOLBOXITEM_OPEN), OUString( AvmResId( AVMEDIA_STR_OPEN ) ) ); mpPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_OPEN, HID_AVMEDIA_TOOLBOXITEM_OPEN ); - mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_INSERT, GetImage(AVMEDIA_TOOLBOXITEM_INSERT), OUString( AVMEDIA_RESID( AVMEDIA_STR_INSERT ) ) ); + mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_INSERT, GetImage(AVMEDIA_TOOLBOXITEM_INSERT), OUString( AvmResId( AVMEDIA_STR_INSERT ) ) ); mpPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_INSERT, HID_AVMEDIA_TOOLBOXITEM_INSERT ); mpPlayToolBox->InsertSeparator(); } @@ -170,7 +170,7 @@ const Size& MediaControl::getMinSizePixel() const void MediaControl::UpdateURLField(MediaItem tempItem) { - const OUString aURL( OUString(AVMEDIA_RESID(AVMEDIA_MEDIA_PATH)) + ": " + tempItem.getURL() ) ; + const OUString aURL( OUString(AvmResId(AVMEDIA_MEDIA_PATH)) + ": " + tempItem.getURL() ) ; mpMediaPath->SetText(aURL); mpMediaPath->SetUpdateMode( false ); mpMediaPath->SetSizePixel( Size( mpMediaPath->GetTextWidth( aURL ) + 8, mpPlayToolBox->GetSizePixel().Height() ) ); diff --git a/avmedia/source/framework/mediaplayer.cxx b/avmedia/source/framework/mediaplayer.cxx index 881ce0760244..0a0c86f88c8c 100644 --- a/avmedia/source/framework/mediaplayer.cxx +++ b/avmedia/source/framework/mediaplayer.cxx @@ -57,7 +57,7 @@ MediaFloater::MediaFloater( SfxBindings* _pBindings, SfxChildWindow* pCW, vcl::W SetPosSizePixel( Point( 0, 0 ), aSize ); SetMinOutputSizePixel( aSize ); - SetText( OUString( AVMEDIA_RESID( AVMEDIA_STR_MEDIAPLAYER ) ) ); + SetText( OUString( AvmResId( AVMEDIA_STR_MEDIAPLAYER ) ) ); mpMediaWindow->show(); } diff --git a/avmedia/source/inc/mediamisc.hxx b/avmedia/source/inc/mediamisc.hxx index f6db84cc2ecb..aefc6ac49c0b 100644 --- a/avmedia/source/inc/mediamisc.hxx +++ b/avmedia/source/inc/mediamisc.hxx @@ -21,10 +21,17 @@ #define INCLUDED_AVMEDIA_SOURCE_INC_MEDIAMISC_HXX #include <config_features.h> +#include <tools/resid.hxx> -class ResMgr; +namespace avmedia +{ + ResMgr* GetResMgr(); +} -#define AVMEDIA_RESID( nId ) ResId( nId, * ::avmedia::GetResMgr() ) +inline OUString AvmResId(sal_uInt16 nId) +{ + return ResId(nId, * ::avmedia::GetResMgr()); +} #define AVMEDIA_MANAGER_SERVICE_PREFERRED "com.sun.star.comp.avmedia.Manager_VLC" #ifdef _WIN32 @@ -48,12 +55,6 @@ class ResMgr; #define AVMEDIA_MIMETYPE_JSON "model/vnd.gltf+json" #endif - -namespace avmedia -{ - ResMgr* GetResMgr(); -} - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx index 811ac0e1f7d5..8145cea56b32 100644 --- a/avmedia/source/viewer/mediawindow.cxx +++ b/avmedia/source/viewer/mediawindow.cxx @@ -219,7 +219,7 @@ bool MediaWindow::executeMediaURLDialog(OUString& rURL, bool *const o_pbLink) static const char aSeparator[] = ";"; OUString aAllTypes; - aDlg.SetTitle( AVMEDIA_RESID( (o_pbLink) + aDlg.SetTitle( AvmResId( (o_pbLink) ? AVMEDIA_STR_INSERTMEDIA_DLG : AVMEDIA_STR_OPENMEDIA_DLG ) ); getMediaFilters( aFilters ); @@ -236,7 +236,7 @@ bool MediaWindow::executeMediaURLDialog(OUString& rURL, bool *const o_pbLink) } // add filter for all media types - aDlg.AddFilter( AVMEDIA_RESID( AVMEDIA_STR_ALL_MEDIAFILES ), aAllTypes ); + aDlg.AddFilter( AvmResId( AVMEDIA_STR_ALL_MEDIAFILES ), aAllTypes ); for( FilterNameVector::size_type i = 0; i < aFilters.size(); ++i ) { @@ -255,7 +255,7 @@ bool MediaWindow::executeMediaURLDialog(OUString& rURL, bool *const o_pbLink) } // add filter for all types - aDlg.AddFilter( AVMEDIA_RESID( AVMEDIA_STR_ALL_FILES ), "*.*" ); + aDlg.AddFilter( AvmResId( AVMEDIA_STR_ALL_FILES ), "*.*" ); uno::Reference<ui::dialogs::XFilePicker2> const xFP(aDlg.GetFilePicker()); uno::Reference<ui::dialogs::XFilePickerControlAccess> const xCtrlAcc(xFP, @@ -297,7 +297,7 @@ bool MediaWindow::executeMediaURLDialog(OUString& rURL, bool *const o_pbLink) void MediaWindow::executeFormatErrorBox( vcl::Window* pParent ) { - ScopedVclPtrInstance< MessageDialog > aErrBox( pParent, AVMEDIA_RESID( AVMEDIA_STR_ERR_URL ) ); + ScopedVclPtrInstance< MessageDialog > aErrBox( pParent, AvmResId( AVMEDIA_STR_ERR_URL ) ); aErrBox->Execute(); aErrBox.disposeAndClear(); |