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 /sc/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 'sc/inc')
-rw-r--r-- | sc/inc/compiler.hrc | 2 | ||||
-rw-r--r-- | sc/inc/globstr.hrc | 2 | ||||
-rw-r--r-- | sc/inc/pvfundlg.hrc | 2 | ||||
-rw-r--r-- | sc/inc/scerrors.hrc | 2 | ||||
-rw-r--r-- | sc/inc/scfuncs.hrc | 2 | ||||
-rw-r--r-- | sc/inc/scstyles.hrc | 2 | ||||
-rw-r--r-- | sc/inc/strings.hrc | 2 | ||||
-rw-r--r-- | sc/inc/subtotals.hrc | 2 | ||||
-rw-r--r-- | sc/inc/units.hrc | 2 |
9 files changed, 9 insertions, 9 deletions
diff --git a/sc/inc/compiler.hrc b/sc/inc/compiler.hrc index e77dd26ea6a4..f7cb95d6d33a 100644 --- a/sc/inc/compiler.hrc +++ b/sc/inc/compiler.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 RID_FUNCTION_CATEGORIES[] = { diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index 5e6880d973d1..2b949cba8264 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -20,7 +20,7 @@ #ifndef SC_GLOBSTR_HRC #define SC_GLOBSTR_HRC -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) #define NNC_(Context, StringSingular, StringPlural) TranslateNId(Context, reinterpret_cast<char const *>(u8##StringSingular), reinterpret_cast<char const *>(u8##StringPlural)) /* diff --git a/sc/inc/pvfundlg.hrc b/sc/inc/pvfundlg.hrc index 1f3f8df37c17..510c5ad05c5c 100644 --- a/sc/inc/pvfundlg.hrc +++ b/sc/inc/pvfundlg.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 SCSTR_DPFUNCLISTBOX[] = { diff --git a/sc/inc/scerrors.hrc b/sc/inc/scerrors.hrc index b2ee886174ee..88b099f69107 100644 --- a/sc/inc/scerrors.hrc +++ b/sc/inc/scerrors.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 <svtools/ehdl.hxx> #include "scerrors.hxx" diff --git a/sc/inc/scfuncs.hrc b/sc/inc/scfuncs.hrc index cfb55d2be8bb..8fb9f59e9029 100644 --- a/sc/inc/scfuncs.hrc +++ b/sc/inc/scfuncs.hrc @@ -20,7 +20,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) /* Resource file for the function wizard / autopilot. * diff --git a/sc/inc/scstyles.hrc b/sc/inc/scstyles.hrc index 224f2cd475ac..f7df2db50862 100644 --- a/sc/inc/scstyles.hrc +++ b/sc/inc/scstyles.hrc @@ -22,7 +22,7 @@ #include <svl/style.hxx> #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 std::pair<TranslateId, SfxStyleSearchBits> RID_CELLSTYLEFAMILY[] = { diff --git a/sc/inc/strings.hrc b/sc/inc/strings.hrc index 7767da4abd6a..b40ed197be4b 100644 --- a/sc/inc/strings.hrc +++ b/sc/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) #define NNC_(Context, StringSingular, StringPlural) TranslateNId(Context, reinterpret_cast<char const *>(u8##StringSingular), reinterpret_cast<char const *>(u8##StringPlural)) // Strings for interface names ------------------------------------------- diff --git a/sc/inc/subtotals.hrc b/sc/inc/subtotals.hrc index 21ede539b113..73c701a618fc 100644 --- a/sc/inc/subtotals.hrc +++ b/sc/inc/subtotals.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 SCSTR_SUBTOTALS[] = { diff --git a/sc/inc/units.hrc b/sc/inc/units.hrc index 66ba5bd933e4..6993f370bd98 100644 --- a/sc/inc/units.hrc +++ b/sc/inc/units.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) #include <tools/fldunit.hxx> |