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 /include/svx | |
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 'include/svx')
-rw-r--r-- | include/svx/strings.hrc | 2 | ||||
-rw-r--r-- | include/svx/svxitems.hrc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc index b4a04c3a2c60..8dc2aa04639e 100644 --- a/include/svx/strings.hrc +++ b/include/svx/strings.hrc @@ -20,7 +20,7 @@ #ifndef INCLUDED_SVX_INC_STRINGS_HRC #define INCLUDED_SVX_INC_STRINGS_HRC -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) #define STR_ObjNameSingulNONE NC_("STR_ObjNameSingulNONE", "Drawing object") #define STR_ObjNamePluralNONE NC_("STR_ObjNamePluralNONE", "Drawing objects") diff --git a/include/svx/svxitems.hrc b/include/svx/svxitems.hrc index d42194497144..af1e5aa3375b 100644 --- a/include/svx/svxitems.hrc +++ b/include/svx/svxitems.hrc @@ -27,7 +27,7 @@ #include <unotools/resmgr.hxx> #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> RID_ATTR_NAMES[] = { |