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 /vcl | |
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 'vcl')
-rw-r--r-- | vcl/inc/font/OpenTypeFeatureStrings.hrc | 2 | ||||
-rw-r--r-- | vcl/inc/print.hrc | 2 | ||||
-rw-r--r-- | vcl/inc/printaccessoryview.hrc | 2 | ||||
-rw-r--r-- | vcl/inc/strings.hrc | 2 | ||||
-rw-r--r-- | vcl/inc/units.hrc | 2 | ||||
-rw-r--r-- | vcl/source/app/svdata.cxx | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/vcl/inc/font/OpenTypeFeatureStrings.hrc b/vcl/inc/font/OpenTypeFeatureStrings.hrc index aebdda1d2743..086d7d500c0e 100644 --- a/vcl/inc/font/OpenTypeFeatureStrings.hrc +++ b/vcl/inc/font/OpenTypeFeatureStrings.hrc @@ -20,7 +20,7 @@ #ifndef INCLUDED_VCL_INC_FONT_OPENTYPEFEATRESTRINGS_HRC #define INCLUDED_VCL_INC_FONT_OPENTYPEFEATRESTRINGS_HRC -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) #define STR_FONT_FEATURE_ID_AALT NC_("STR_FONT_FEATURE_ID_AALT", "Access All Alternates") #define STR_FONT_FEATURE_ID_AFRC NC_("STR_FONT_FEATURE_ID_AFRC", "Alternative (Vertical) Fractions") diff --git a/vcl/inc/print.hrc b/vcl/inc/print.hrc index 7e19c4c75004..661e881690b3 100644 --- a/vcl/inc/print.hrc +++ b/vcl/inc/print.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 RID_STR_PAPERNAMES[] = { diff --git a/vcl/inc/printaccessoryview.hrc b/vcl/inc/printaccessoryview.hrc index 737ff11a621f..9d94654b4c7a 100644 --- a/vcl/inc/printaccessoryview.hrc +++ b/vcl/inc/printaccessoryview.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 SV_PRINT_NATIVE_STRINGS[] = { diff --git a/vcl/inc/strings.hrc b/vcl/inc/strings.hrc index 7f5699aae1d6..6ce4854deb45 100644 --- a/vcl/inc/strings.hrc +++ b/vcl/inc/strings.hrc @@ -20,7 +20,7 @@ #ifndef INCLUDED_VCL_INC_STRINGS_HRC #define INCLUDED_VCL_INC_STRINGS_HRC -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) #define SV_RESID_STRING_NOSELECTIONPOSSIBLE NC_("SV_RESID_STRING_NOSELECTIONPOSSIBLE", "[No selection possible]") diff --git a/vcl/inc/units.hrc b/vcl/inc/units.hrc index 30809ee93d65..677f9f5cefee 100644 --- a/vcl/inc/units.hrc +++ b/vcl/inc/units.hrc @@ -23,7 +23,7 @@ #include <tools/fldunit.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) std::pair<TranslateId, FieldUnit> SV_FUNIT_STRINGS[] = { diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index 9840eec37fc6..75dc09e28e4a 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -286,7 +286,7 @@ namespace vcl sal_uInt32 nUnits = SAL_N_ELEMENTS(SV_FUNIT_STRINGS); for (sal_uInt32 i = 0; i < nUnits; ++i) { - if (o3tl::equalsAscii(rEnglishMetricString, SV_FUNIT_STRINGS[i].first.mpId)) + if (o3tl::equalsAscii(rEnglishMetricString, SV_FUNIT_STRINGS[i].first.getId())) return SV_FUNIT_STRINGS[i].second; } return FieldUnit::NONE; |