diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-10-12 11:17:11 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-10-12 18:17:49 +0200 |
commit | dcea29c283680c8e75e4890f46b1624d0a55846f (patch) | |
tree | 1ca0e41d8d00f27d3b8d3dec5d99a6c2e5aebb91 /cui | |
parent | 6056a0e320f0aabbde7adb28c42e00ed72ef2e5b (diff) |
Make NC_ constexpr-friendly
...by moving the char8_t -> char reinterpret_cast out of any potential constexpr
paths into a new TranslateId::getId. And demonstrate constexpr'ability by
making the aCategories var in OApplicationIconControl::Fill
(dbaccess/source/ui/app/AppIconControl.cxx) constexpr. (And there might be more
such cases that could now be made constexpr.)
Change-Id: I0b4e3292faf8f6b901f9b9e934e1aa6bf0f583ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157862
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/inc/numcategories.hrc | 2 | ||||
-rw-r--r-- | cui/inc/strings.hrc | 2 | ||||
-rw-r--r-- | cui/inc/tipoftheday.hrc | 2 | ||||
-rw-r--r-- | cui/inc/toolbarmode.hrc | 2 | ||||
-rw-r--r-- | cui/inc/treeopt.hrc | 2 | ||||
-rw-r--r-- | cui/inc/twolines.hrc | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/cui/inc/numcategories.hrc b/cui/inc/numcategories.hrc index 40370cc65811..58f2a1d9d79b 100644 --- a/cui/inc/numcategories.hrc +++ b/cui/inc/numcategories.hrc @@ -11,7 +11,7 @@ #include <unotools/resmgr.hxx> -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) const TranslateId NUM_CATEGORIES[] = { diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc index 66a9957b7698..f5252694459c 100644 --- a/cui/inc/strings.hrc +++ b/cui/inc/strings.hrc @@ -18,7 +18,7 @@ */ #pragma once -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) #define RID_CUISTR_KEY_WORK_PATH NC_("RID_SVXSTR_KEY_WORK_PATH", "My Documents") #define RID_CUISTR_KEY_GRAPHICS_PATH NC_("RID_SVXSTR_KEY_GRAPHICS_PATH", "Images") diff --git a/cui/inc/tipoftheday.hrc b/cui/inc/tipoftheday.hrc index a1c45dae45b6..7f1dca4441d9 100644 --- a/cui/inc/tipoftheday.hrc +++ b/cui/inc/tipoftheday.hrc @@ -19,7 +19,7 @@ #pragma once -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) #include <rtl/ustring.hxx> #include <config_python.h> diff --git a/cui/inc/toolbarmode.hrc b/cui/inc/toolbarmode.hrc index d073eaaf996a..1891795b93cf 100644 --- a/cui/inc/toolbarmode.hrc +++ b/cui/inc/toolbarmode.hrc @@ -9,7 +9,7 @@ #pragma once -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) #include <rtl/ustring.hxx> #include <tuple> diff --git a/cui/inc/treeopt.hrc b/cui/inc/treeopt.hrc index cdd7b582da89..27b7998c8c2d 100644 --- a/cui/inc/treeopt.hrc +++ b/cui/inc/treeopt.hrc @@ -27,7 +27,7 @@ #include <utility> -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) const std::pair<TranslateId, sal_uInt16> SID_GENERAL_OPTIONS_RES[] = { diff --git a/cui/inc/twolines.hrc b/cui/inc/twolines.hrc index 659efa838cd7..2c338d8f0e65 100644 --- a/cui/inc/twolines.hrc +++ b/cui/inc/twolines.hrc @@ -14,7 +14,7 @@ #include <utility> -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) #define CHRDLG_ENCLOSE_NONE 0 #define CHRDLG_ENCLOSE_ROUND 1 |