summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-28 15:21:26 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-29 09:22:30 +0200
commit53840ffd9755bbf2965676136c9772089891bfe8 (patch)
tree813326af6895dab50d1fc14ee2a925b5f8ad52f9 /accessibility
parent4598a385ffaaf8fdc124962d347fead994450bea (diff)
Pass context and resource string down to boost::locale separately
because this is often on a hot path, and we can avoid the splitting and joining of strings like this. Create a new small index type TranslateId for some type-safety. This change only updates accessibility to use the new API, other modules will follow in stages. Change-Id: I289245ad34fda775812302ca7ac1588710167b34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119632 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/inc/helper/accresmgr.hxx4
-rw-r--r--accessibility/inc/strings.hrc2
-rw-r--r--accessibility/source/helper/accresmgr.cxx3
3 files changed, 4 insertions, 5 deletions
diff --git a/accessibility/inc/helper/accresmgr.hxx b/accessibility/inc/helper/accresmgr.hxx
index c0926f190ac1..75ccc2df63fb 100644
--- a/accessibility/inc/helper/accresmgr.hxx
+++ b/accessibility/inc/helper/accresmgr.hxx
@@ -20,8 +20,8 @@
#pragma once
#include <rtl/ustring.hxx>
-#include <string_view>
+#include <unotools/resmgr.hxx>
-OUString AccResId(std::string_view aId);
+OUString AccResId(TranslateId aId);
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/accessibility/inc/strings.hrc b/accessibility/inc/strings.hrc
index 4a79f3306033..7e51ade2d46d 100644
--- a/accessibility/inc/strings.hrc
+++ b/accessibility/inc/strings.hrc
@@ -19,7 +19,7 @@
#pragma once
-#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String)
+#define NC_(Context, String) TranslateId(Context, u8##String)
#define RID_STR_ACC_NAME_BROWSEBUTTON NC_("RID_STR_ACC_NAME_BROWSEBUTTON", "Browse")
#define STR_SVT_ACC_ACTION_EXPAND NC_("STR_SVT_ACC_ACTION_EXPAND", "Expand" )
diff --git a/accessibility/source/helper/accresmgr.cxx b/accessibility/source/helper/accresmgr.cxx
index b335f8ac185b..f120dcb2600d 100644
--- a/accessibility/source/helper/accresmgr.cxx
+++ b/accessibility/source/helper/accresmgr.cxx
@@ -18,8 +18,7 @@
*/
#include <helper/accresmgr.hxx>
-#include <unotools/resmgr.hxx>
-OUString AccResId(std::string_view aId) { return Translate::get(aId, Translate::Create("acc")); }
+OUString AccResId(TranslateId aId) { return Translate::get(aId, Translate::Create("acc")); }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */