From dcea29c283680c8e75e4890f46b1624d0a55846f Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 12 Oct 2023 11:17:11 +0200 Subject: 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 --- dbaccess/inc/query.hrc | 2 +- dbaccess/inc/strings.hrc | 2 +- dbaccess/inc/templwin.hrc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'dbaccess/inc') diff --git a/dbaccess/inc/query.hrc b/dbaccess/inc/query.hrc index e183f777ca5f..abb8bef8d1e8 100644 --- a/dbaccess/inc/query.hrc +++ b/dbaccess/inc/query.hrc @@ -21,7 +21,7 @@ #include -#define NC_(Context, String) TranslateId(Context, reinterpret_cast(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) const TranslateId RSC_QUERY_OBJECT_TYPE[] = { diff --git a/dbaccess/inc/strings.hrc b/dbaccess/inc/strings.hrc index 2db9ce75c467..0c6226ea8fee 100644 --- a/dbaccess/inc/strings.hrc +++ b/dbaccess/inc/strings.hrc @@ -21,7 +21,7 @@ #include -#define NC_(Context, String) TranslateId(Context, reinterpret_cast(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) #define RID_STR_CONNECTION_INVALID NC_("RID_STR_CONNECTION_INVALID", "No connection could be established.") #define RID_STR_TABLE_IS_FILTERED NC_("RID_STR_TABLE_IS_FILTERED", "The table $name$ already exists. It is not visible because it has been filtered out.") diff --git a/dbaccess/inc/templwin.hrc b/dbaccess/inc/templwin.hrc index 052883d37926..2cc76e395245 100644 --- a/dbaccess/inc/templwin.hrc +++ b/dbaccess/inc/templwin.hrc @@ -22,7 +22,7 @@ #include #include -#define NC_(Context, String) TranslateId(Context, reinterpret_cast(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) #define DI_TITLE 1 #define DI_FROM 2 -- cgit