diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-19 13:18:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-05 09:39:11 +0200 |
commit | 14cfff500e93f0d6cbf8412065feea85c01ea81d (patch) | |
tree | 76e3fb8fbf2b0d8a12c8406d8cf994ea6a37aaff /sd/source/ui/sidebar | |
parent | d924ce30e0ca260682bd2aed192b8b1b2ca3e7c0 (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: Ia36047209368ca53431178c2e8723a18cfe8260a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119220
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/sidebar')
-rw-r--r-- | sd/source/ui/sidebar/LayoutMenu.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPageContainer.cxx | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx index 0e2e8aae890f..8483616c5e10 100644 --- a/sd/source/ui/sidebar/LayoutMenu.cxx +++ b/sd/source/ui/sidebar/LayoutMenu.cxx @@ -75,7 +75,7 @@ namespace { struct snewfoil_value_info { const char* msBmpResId; - const char* mpStrResId; + TranslateId mpStrResId; WritingMode meWritingMode; AutoLayout maAutoLayout; }; @@ -86,7 +86,7 @@ const snewfoil_value_info notes[] = { {BMP_FOILN_01, STR_AUTOLAYOUT_NOTES, WritingMode_LR_TB, AUTOLAYOUT_NOTES}, - {"", nullptr, WritingMode_LR_TB, AUTOLAYOUT_NONE}, + {"", {}, WritingMode_LR_TB, AUTOLAYOUT_NONE}, }; const snewfoil_value_info handout[] = @@ -103,7 +103,7 @@ const snewfoil_value_info handout[] = AUTOLAYOUT_HANDOUT6}, {BMP_FOILH_09, STR_AUTOLAYOUT_HANDOUT9, WritingMode_LR_TB, AUTOLAYOUT_HANDOUT9}, - {"", nullptr, WritingMode_LR_TB, AUTOLAYOUT_NONE}, + {"", {}, WritingMode_LR_TB, AUTOLAYOUT_NONE}, }; const snewfoil_value_info standard[] = @@ -126,7 +126,7 @@ const snewfoil_value_info standard[] = {BMP_LAYOUT_VERTICAL01, STR_AL_VERT_TITLE_VERT_OUTLINE, WritingMode_TB_RL, AUTOLAYOUT_VTITLE_VCONTENT}, {BMP_LAYOUT_HEAD02, STR_AL_TITLE_VERT_OUTLINE, WritingMode_TB_RL, AUTOLAYOUT_TITLE_VCONTENT}, {BMP_LAYOUT_HEAD02A, STR_AL_TITLE_VERT_OUTLINE_CLIPART, WritingMode_TB_RL, AUTOLAYOUT_TITLE_2VTEXT}, - {"", nullptr, WritingMode_LR_TB, AUTOLAYOUT_NONE} + {"", {}, WritingMode_LR_TB, AUTOLAYOUT_NONE} }; class LayoutValueSet : public ValueSet @@ -538,7 +538,7 @@ void LayoutMenu::Fill() } Clear(); - for (sal_uInt16 i=1; pInfo!=nullptr && pInfo->mpStrResId != nullptr; i++, pInfo++) + for (sal_uInt16 i=1; pInfo!=nullptr && pInfo->mpStrResId; i++, pInfo++) { if ((WritingMode_TB_RL != pInfo->meWritingMode) || bVertical) { diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx index a37b3b6ddeb0..3db225efba2d 100644 --- a/sd/source/ui/sidebar/MasterPageContainer.cxx +++ b/sd/source/ui/sidebar/MasterPageContainer.cxx @@ -157,7 +157,7 @@ private: Size maSmallPreviewSizePixel; Size maLargePreviewSizePixel; - Image GetPreviewSubstitution(const char* pId, PreviewSize ePreviewSize); + Image GetPreviewSubstitution(TranslateId pId, PreviewSize ePreviewSize); void CleanContainer(); }; @@ -841,14 +841,14 @@ SdDrawDocument* MasterPageContainer::Implementation::GetDocument() } Image MasterPageContainer::Implementation::GetPreviewSubstitution ( - const char* pId, + TranslateId pId, PreviewSize ePreviewSize) { const ::osl::MutexGuard aGuard (maMutex); Image aPreview; - if (strcmp(pId, STR_TASKPANEL_PREPARING_PREVIEW_SUBSTITUTION) == 0) + if (pId == STR_TASKPANEL_PREPARING_PREVIEW_SUBSTITUTION) { Image& rPreview (ePreviewSize==SMALL ? maSmallPreviewBeingCreated @@ -861,7 +861,7 @@ Image MasterPageContainer::Implementation::GetPreviewSubstitution ( } aPreview = rPreview; } - else if (strcmp(pId, STR_TASKPANEL_NOT_AVAILABLE_SUBSTITUTION) == 0) + else if (pId == STR_TASKPANEL_NOT_AVAILABLE_SUBSTITUTION) { Image& rPreview (ePreviewSize==SMALL ? maSmallPreviewNotAvailable |