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 /sfx2 | |
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 'sfx2')
-rw-r--r-- | sfx2/inc/dinfdlg.hrc | 2 | ||||
-rw-r--r-- | sfx2/inc/doctempl.hrc | 2 | ||||
-rw-r--r-- | sfx2/source/devtools/DevToolsStrings.hrc | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sfx2/inc/dinfdlg.hrc b/sfx2/inc/dinfdlg.hrc index b0b72d8685b6..ef47615e7e22 100644 --- a/sfx2/inc/dinfdlg.hrc +++ b/sfx2/inc/dinfdlg.hrc @@ -22,7 +22,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 SFX_CB_PROPERTY_STRINGARRAY[] = { diff --git a/sfx2/inc/doctempl.hrc b/sfx2/inc/doctempl.hrc index 0bd5a1957a78..82bcfef269fb 100644 --- a/sfx2/inc/doctempl.hrc +++ b/sfx2/inc/doctempl.hrc @@ -22,7 +22,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 TEMPLATE_LONG_NAMES_ARY[] = { diff --git a/sfx2/source/devtools/DevToolsStrings.hrc b/sfx2/source/devtools/DevToolsStrings.hrc index 4c3f3e9ceb33..9ba434021401 100644 --- a/sfx2/source/devtools/DevToolsStrings.hrc +++ b/sfx2/source/devtools/DevToolsStrings.hrc @@ -10,7 +10,7 @@ #pragma once -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) #define STR_TEXT_PORTION NC_("STR_TEXT_PORTION", "Text Portion %1") #define STR_PARAGRAPH NC_("STR_PARAGRAPH", "Paragraph %1") |