diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-12-27 18:13:55 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-12-28 05:43:18 +0100 |
commit | 9de3aa9328e46aed6ca7fdd9485085b7355c3e25 (patch) | |
tree | 4579f57443499e3ee655dff53040ad78e657d9e0 /sfx2/source/appl | |
parent | 9e8c1da64fa8a520730ce0aea0f7199cd75c892f (diff) |
Use OUStringLiteral
Change-Id: Id337f2c9cfa192663f2ddb226c786cdb9f6b3265
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127590
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r-- | sfx2/source/appl/shutdownicon.hxx | 16 | ||||
-rw-r--r-- | sfx2/source/appl/shutdowniconaqua.mm | 6 | ||||
-rw-r--r-- | sfx2/source/appl/shutdowniconw32.cxx | 12 |
3 files changed, 16 insertions, 18 deletions
diff --git a/sfx2/source/appl/shutdownicon.hxx b/sfx2/source/appl/shutdownicon.hxx index cb352e60b443..c551a190a01d 100644 --- a/sfx2/source/appl/shutdownicon.hxx +++ b/sfx2/source/appl/shutdownicon.hxx @@ -50,14 +50,14 @@ typedef comphelper::WeakComponentImplHelper< css::lang::XServiceInfo, css::beans::XFastPropertySet > ShutdownIconServiceBase; -#define WRITER_URL "private:factory/swriter" -#define CALC_URL "private:factory/scalc" -#define IMPRESS_URL "private:factory/simpress" -#define IMPRESS_WIZARD_URL "private:factory/simpress?slot=6686" -#define DRAW_URL "private:factory/sdraw" -#define MATH_URL "private:factory/smath" -#define BASE_URL "private:factory/sdatabase?Interactive" -#define STARTMODULE_URL ".uno:ShowStartModule" +inline constexpr OUStringLiteral WRITER_URL = u"private:factory/swriter"; +inline constexpr OUStringLiteral CALC_URL = u"private:factory/scalc"; +inline constexpr OUStringLiteral IMPRESS_URL = u"private:factory/simpress"; +inline constexpr OUStringLiteral IMPRESS_WIZARD_URL = u"private:factory/simpress?slot=6686"; +inline constexpr OUStringLiteral DRAW_URL = u"private:factory/sdraw"; +inline constexpr OUStringLiteral MATH_URL = u"private:factory/smath"; +inline constexpr OUStringLiteral BASE_URL = u"private:factory/sdatabase?Interactive"; +inline constexpr OUStringLiteral STARTMODULE_URL = u".uno:ShowStartModule"; class ShutdownIcon : public ShutdownIconServiceBase { diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm index 74a9602e6ce1..1a692f7ed164 100644 --- a/sfx2/source/appl/shutdowniconaqua.mm +++ b/sfx2/source/appl/shutdowniconaqua.mm @@ -407,8 +407,8 @@ void aqua_init_systray() { SvtModuleOptions::EModule eModuleIdentifier; int nMenuTag; - const char* pAsciiURLDescription; - } aMenuItems[] = + rtl::OUStringConstExpr sURLDescription; + } static const aMenuItems[] = { { SvtModuleOptions::EModule::WRITER, MI_WRITER, WRITER_URL }, { SvtModuleOptions::EModule::CALC, MI_CALC, CALC_URL }, @@ -436,7 +436,7 @@ void aqua_init_systray() // the complete application is not even installed continue; - OUString sURL( OUString::createFromAscii( aMenuItems[i].pAsciiURLDescription ) ); + const OUString& sURL( aMenuItems[i].sURLDescription ); if ( aFileNewAppsAvailable.find( sURL ) == aFileNewAppsAvailable.end() ) // the application is installed, but the entry has been configured to *not* appear in the File/New diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index f27fb4db6bc8..3c0c62359fe9 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -160,8 +160,8 @@ static HMENU createSystrayMenu( ) SvtModuleOptions::EModule eModuleIdentifier; UINT nMenuItemID; UINT nMenuIconID; - const char* pAsciiURLDescription; - } aMenuItems[] = + rtl::OUStringConstExpr sURLDescription; + } static const aMenuItems[] = { { SvtModuleOptions::EModule::WRITER, IDM_WRITER, ICON_TEXT_DOCUMENT, WRITER_URL }, { SvtModuleOptions::EModule::CALC, IDM_CALC, ICON_SPREADSHEET_DOCUMENT, CALC_URL }, @@ -172,20 +172,18 @@ static HMENU createSystrayMenu( ) }; // insert the menu entries for launching the applications - for ( size_t i = 0; i < SAL_N_ELEMENTS(aMenuItems); ++i ) + for (const auto& [eModuleIdentifier, nMenuItemID, nMenuIconID, sURL] : aMenuItems) { - if ( !aModuleOptions.IsModuleInstalled( aMenuItems[i].eModuleIdentifier ) ) + if ( !aModuleOptions.IsModuleInstalled( eModuleIdentifier ) ) // the complete application is not even installed continue; - OUString sURL( OUString::createFromAscii( aMenuItems[i].pAsciiURLDescription ) ); - if ( aFileNewAppsAvailable.find( sURL ) == aFileNewAppsAvailable.end() ) // the application is installed, but the entry has been configured to *not* appear in the File/New // menu => also let not appear it in the quickstarter continue; - addMenuItem( hMenu, aMenuItems[i].nMenuItemID, aMenuItems[i].nMenuIconID, + addMenuItem( hMenu, nMenuItemID, nMenuIconID, ShutdownIcon::GetUrlDescription( sURL ), pos, true, "" ); } |