diff options
author | Gabor Kelemen <kelemeng@ubuntu.com> | 2018-04-26 23:17:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-29 16:07:12 +0200 |
commit | 8f2788e6fcf0ebbaedef02478362dbda4e8c14c4 (patch) | |
tree | 20c082f50e3b5566b6473d3c4de98b8dddbd7639 /sfx2 | |
parent | 3a29d1a53d7ed362a8b420650c0046f30e4759ed (diff) |
Drop ShutdownIcon::GetResString l10n wrapper method
Just a wrapper above SfxResId, simpler to use that.
Change-Id: I3a0a6d262d873591b3eeb924f76373df572cf434
Reviewed-on: https://gerrit.libreoffice.org/53548
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/shutdownicon.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/appl/shutdownicon.hxx | 1 | ||||
-rw-r--r-- | sfx2/source/appl/shutdowniconaqua.mm | 17 | ||||
-rw-r--r-- | sfx2/source/appl/shutdowniconunx.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/appl/shutdowniconw32.cxx | 11 |
5 files changed, 21 insertions, 24 deletions
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index be129dabac5f..44eaf5d510ad 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -300,11 +300,6 @@ void ShutdownIcon::FromTemplate() } } -OUString ShutdownIcon::GetResString(const char* id) -{ - return SfxResId(id); -} - OUString ShutdownIcon::GetUrlDescription( const OUString& aUrl ) { ::SolarMutexGuard aGuard; diff --git a/sfx2/source/appl/shutdownicon.hxx b/sfx2/source/appl/shutdownicon.hxx index 67abad2b6ce0..31baf75fbfc7 100644 --- a/sfx2/source/appl/shutdownicon.hxx +++ b/sfx2/source/appl/shutdownicon.hxx @@ -111,7 +111,6 @@ class SFX2_DLLPUBLIC ShutdownIcon : public ShutdownIconServiceBase /// @throws css::uno::Exception void init(); - static OUString GetResString(const char* id); static OUString GetUrlDescription( const OUString& aUrl ); void SetVeto( bool bVeto ) { m_bVeto = bVeto;} diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm index 50d09f5c4f02..582b403ebecb 100644 --- a/sfx2/source/appl/shutdowniconaqua.mm +++ b/sfx2/source/appl/shutdowniconaqua.mm @@ -27,6 +27,7 @@ #include <comphelper/sequenceashashmap.hxx> #include <sfx2/app.hxx> #include <sal/macros.h> +#include <sfx2/sfxresid.hxx> #include <sfx2/strings.hrc> #include "shutdownicon.hxx" @@ -396,11 +397,11 @@ void aqua_init_systray() aShortcuts.clear(); pExecute = [[QSMenuExecute alloc] init]; - pDefMenu = [[NSMenuItem alloc] initWithTitle: getAutoreleasedString( ShutdownIcon::GetResString(STR_QUICKSTART_FILE) ) action: nullptr keyEquivalent: @""]; - pDockSubMenu = [[NSMenuItem alloc] initWithTitle: getAutoreleasedString( ShutdownIcon::GetResString(STR_QUICKSTART_FILE) ) action: nullptr keyEquivalent: @""]; - NSMenu* pMenu = [[NSMenu alloc] initWithTitle: getAutoreleasedString( ShutdownIcon::GetResString(STR_QUICKSTART_FILE) )]; + pDefMenu = [[NSMenuItem alloc] initWithTitle: getAutoreleasedString( SfxResId(STR_QUICKSTART_FILE) ) action: nullptr keyEquivalent: @""]; + pDockSubMenu = [[NSMenuItem alloc] initWithTitle: getAutoreleasedString( SfxResId(STR_QUICKSTART_FILE) ) action: nullptr keyEquivalent: @""]; + NSMenu* pMenu = [[NSMenu alloc] initWithTitle: getAutoreleasedString( SfxResId(STR_QUICKSTART_FILE) )]; [pMenu setAutoenablesItems: NO]; - NSMenu* pDockMenu = [[NSMenu alloc] initWithTitle: getAutoreleasedString( ShutdownIcon::GetResString(STR_QUICKSTART_FILE) )]; + NSMenu* pDockMenu = [[NSMenu alloc] initWithTitle: getAutoreleasedString( SfxResId(STR_QUICKSTART_FILE) )]; [pDockMenu setAutoenablesItems: NO]; // collect the URLs of the entries in the File/New menu @@ -436,7 +437,7 @@ void aqua_init_systray() // insert entry for startcenter if( aModuleOptions.IsModuleInstalled( SvtModuleOptions::EModule::STARTMODULE ) ) { - appendMenuItem( pMenu, nil, ShutdownIcon::GetResString(STR_QUICKSTART_STARTCENTER), MI_STARTMODULE, "n" ); + appendMenuItem( pMenu, nil, SfxResId(STR_QUICKSTART_STARTCENTER), MI_STARTMODULE, "n" ); if( [NSApp respondsToSelector: @selector(setDockIconClickHandler:)] ) [NSApp performSelector:@selector(setDockIconClickHandler:) withObject: pExecute]; else @@ -466,12 +467,12 @@ void aqua_init_systray() // insert the remaining menu entries // add recent menu - appendRecentMenu( pMenu, pDockMenu, ShutdownIcon::GetResString(STR_QUICKSTART_RECENTDOC) ); + appendRecentMenu( pMenu, pDockMenu, SfxResId(STR_QUICKSTART_RECENTDOC) ); - rtl::OUString aTitle( ShutdownIcon::GetResString(STR_QUICKSTART_FROMTEMPLATE) ); + rtl::OUString aTitle( SfxResId(STR_QUICKSTART_FROMTEMPLATE) ); rtl::OUString aKeyEquiv( getShortCut( aTitle ) ); appendMenuItem( pMenu, pDockMenu, aTitle, MI_TEMPLATE, aKeyEquiv ); - aTitle = ShutdownIcon::GetResString(STR_QUICKSTART_FILEOPEN); + aTitle = SfxResId(STR_QUICKSTART_FILEOPEN); aKeyEquiv = getShortCut( aTitle ); appendMenuItem( pMenu, pDockMenu, aTitle, MI_OPEN, aKeyEquiv ); diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx index 2909f9195577..25c35f86a35c 100644 --- a/sfx2/source/appl/shutdowniconunx.cxx +++ b/sfx2/source/appl/shutdowniconunx.cxx @@ -27,6 +27,7 @@ #include <glib.h> #include <osl/module.hxx> #include <sfx2/app.hxx> +#include <sfx2/sfxresid.hxx> #include <sfx2/strings.hrc> #include "shutdownicon.hxx" @@ -224,7 +225,7 @@ static void populate_menu( GtkWidget *pMenu ) add_item (pMenuShell, MATH_URL, nullptr, SV_ICON_ID_FORMULA, G_CALLBACK( open_url_cb )); - OUString aULabel = ShutdownIcon::GetResString(STR_QUICKSTART_FROMTEMPLATE); + OUString aULabel = SfxResId(STR_QUICKSTART_FROMTEMPLATE); add_item (pMenuShell, "dummy", &aULabel, SV_ICON_ID_TEMPLATE, G_CALLBACK( open_template_cb )); @@ -235,7 +236,7 @@ static void populate_menu( GtkWidget *pMenu ) pOpenMenuItem = add_image_menu_item (pMenuShell, GTK_STOCK_OPEN, - ShutdownIcon::GetResString(STR_QUICKSTART_FILEOPEN), + SfxResId(STR_QUICKSTART_FILEOPEN), G_CALLBACK( open_file_cb )); @@ -244,7 +245,7 @@ static void populate_menu( GtkWidget *pMenu ) pDisableMenuItem = add_image_menu_item ( pMenuShell, GTK_STOCK_CLOSE, - ShutdownIcon::GetResString(STR_QUICKSTART_PRELAUNCH_UNX), + SfxResId(STR_QUICKSTART_PRELAUNCH_UNX), G_CALLBACK( systray_disable_cb ) ); pMenuItem = gtk_separator_menu_item_new(); @@ -252,7 +253,7 @@ static void populate_menu( GtkWidget *pMenu ) pExitMenuItem = add_image_menu_item ( pMenuShell, GTK_STOCK_QUIT, - ShutdownIcon::GetResString(STR_QUICKSTART_EXIT), + SfxResId(STR_QUICKSTART_EXIT), G_CALLBACK( exit_quickstarter_cb ) ); gtk_widget_show_all( pMenu ); @@ -324,7 +325,7 @@ void plugin_init_sys_tray() ShutdownIcon *pShutdownIcon = ShutdownIcon::getInstance(); aLabel = OUStringToOString ( - ShutdownIcon::GetResString(STR_QUICKSTART_TIP), + SfxResId(STR_QUICKSTART_TIP), RTL_TEXTENCODING_UTF8 ); pTrayIcon = gtk_status_icon_new_from_icon_name ("libreoffice-startcenter"); diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index c5c4fe7f7dcf..f96968186948 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -29,6 +29,7 @@ #undef WB_RIGHT #include "shutdownicon.hxx" +#include <sfx2/sfxresid.hxx> #include <sfx2/strings.hrc> #include <shlobj.h> #include <objidl.h> @@ -200,13 +201,13 @@ static HMENU createSystrayMenu( ) // insert the remaining menu entries addMenuItem( hMenu, IDM_TEMPLATE, ICON_TEMPLATE, - ShutdownIcon::GetResString( STR_QUICKSTART_FROMTEMPLATE ), pos, true, ""); + SfxResId( STR_QUICKSTART_FROMTEMPLATE ), pos, true, ""); addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, "" ); - addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, ShutdownIcon::GetResString(STR_QUICKSTART_FILEOPEN), pos, true, "SHELL32"); + addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, SfxResId(STR_QUICKSTART_FILEOPEN), pos, true, "SHELL32"); addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, "" ); - addMenuItem( hMenu, IDM_INSTALL,0, ShutdownIcon::GetResString(STR_QUICKSTART_PRELAUNCH), pos, false, "" ); + addMenuItem( hMenu, IDM_INSTALL,0, SfxResId(STR_QUICKSTART_PRELAUNCH), pos, false, "" ); addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, "" ); - addMenuItem( hMenu, IDM_EXIT, 0, ShutdownIcon::GetResString(STR_QUICKSTART_EXIT), pos, false, "" ); + addMenuItem( hMenu, IDM_EXIT, 0, SfxResId(STR_QUICKSTART_EXIT), pos, false, "" ); // indicate status of autostart folder CheckMenuItem( hMenu, IDM_INSTALL, MF_BYCOMMAND | (ShutdownIcon::GetAutostart() ? MF_CHECKED : MF_UNCHECKED) ); @@ -241,7 +242,7 @@ static void deleteSystrayMenu( HMENU hMenu ) static void addTaskbarIcon( HWND hWnd ) { - OUString strTip = ShutdownIcon::GetResString(STR_QUICKSTART_TIP); + OUString strTip = SfxResId(STR_QUICKSTART_TIP); // add taskbar icon NOTIFYICONDATAW nid; |