summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-08-02 16:06:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-03 12:18:15 +0200
commit5afdcad4c0e7850b18996c549892b9360cd8973f (patch)
tree53bd3997d044fdf869ae4643855eef722682983e /vcl/unx
parent39d364958447cd33a6e30dc9d2904ad94fd40aba (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. Change-Id: I2a24a123a64b762fd0741c45eaca3ad4bdd5580d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119884 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/gtk3/fpicker/resourceprovider.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/vcl/unx/gtk3/fpicker/resourceprovider.cxx b/vcl/unx/gtk3/fpicker/resourceprovider.cxx
index 95c098a73488..f656a93093a8 100644
--- a/vcl/unx/gtk3/fpicker/resourceprovider.cxx
+++ b/vcl/unx/gtk3/fpicker/resourceprovider.cxx
@@ -32,7 +32,7 @@ using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds;
const struct
{
sal_Int32 ctrlId;
- const char *resId;
+ TranslateId resId;
} CtrlIdToResIdTable[] = {
{ CHECKBOX_AUTOEXTENSION, STR_FPICKER_AUTO_EXTENSION },
{ CHECKBOX_PASSWORD, STR_FPICKER_PASSWORD },
@@ -57,21 +57,21 @@ const struct
{ FILE_PICKER_FILE_TYPE, STR_FPICKER_TYPE }
};
-static const char* CtrlIdToResId( sal_Int32 aControlId )
+static TranslateId CtrlIdToResId( sal_Int32 aControlId )
{
for (auto & i : CtrlIdToResIdTable)
{
if ( i.ctrlId == aControlId )
return i.resId;
}
- return nullptr;
+ return {};
}
OUString SalGtkPicker::getResString( sal_Int32 aId )
{
OUString aResString;
// translate the control id to a resource id
- const char *pResId = CtrlIdToResId( aId );
+ TranslateId pResId = CtrlIdToResId( aId );
if (pResId)
aResString = VclResId(pResId);
return aResString.replace('~', '_');