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 /scaddins/inc | |
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 'scaddins/inc')
-rw-r--r-- | scaddins/inc/analysis.hrc | 2 | ||||
-rw-r--r-- | scaddins/inc/datefunc.hrc | 2 | ||||
-rw-r--r-- | scaddins/inc/pricing.hrc | 2 | ||||
-rw-r--r-- | scaddins/inc/strings.hrc | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/scaddins/inc/analysis.hrc b/scaddins/inc/analysis.hrc index b66233ede80e..7a7aa5f7c04d 100644 --- a/scaddins/inc/analysis.hrc +++ b/scaddins/inc/analysis.hrc @@ -21,7 +21,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 ANALYSIS_Workday[] = { diff --git a/scaddins/inc/datefunc.hrc b/scaddins/inc/datefunc.hrc index f4a370ae1e44..d6285c2c74ec 100644 --- a/scaddins/inc/datefunc.hrc +++ b/scaddins/inc/datefunc.hrc @@ -21,7 +21,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 DATE_FUNCDESC_DiffWeeks[] = { diff --git a/scaddins/inc/pricing.hrc b/scaddins/inc/pricing.hrc index bb99748e6933..c632a4e5b719 100644 --- a/scaddins/inc/pricing.hrc +++ b/scaddins/inc/pricing.hrc @@ -21,7 +21,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) // function and parameter description const TranslateId PRICING_FUNCDESC_OptBarrier[] = diff --git a/scaddins/inc/strings.hrc b/scaddins/inc/strings.hrc index ed7122b61056..965845d8fbcc 100644 --- a/scaddins/inc/strings.hrc +++ b/scaddins/inc/strings.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) // function names as accessible from cells #define PRICING_FUNCNAME_OptBarrier NC_("PRICING_FUNCNAME_OptBarrier", "OPT_BARRIER") |