diff options
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/controller/slidelayoutcontroller.cxx | 14 | ||||
-rw-r--r-- | sd/source/ui/presenter/PresenterHelper.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/sidebar/LayoutMenu.cxx | 12 |
3 files changed, 17 insertions, 13 deletions
diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx index cbfd847204b8..06814feda90f 100644 --- a/sd/source/ui/controller/slidelayoutcontroller.cxx +++ b/sd/source/ui/controller/slidelayoutcontroller.cxx @@ -79,17 +79,19 @@ private: struct snewfoil_value_info_layout { - const char* msBmpResId; + rtl::OUStringConstExpr msBmpResId; TranslateId mpStrResId; AutoLayout maAutoLayout; }; } +constexpr OUStringLiteral EMPTY = u""; + const snewfoil_value_info_layout notes[] = { {BMP_FOILN_01, STR_AUTOLAYOUT_NOTES, AUTOLAYOUT_NOTES}, - {nullptr, {}, AUTOLAYOUT_NONE}, + {EMPTY, {}, AUTOLAYOUT_NONE}, }; const snewfoil_value_info_layout handout[] = @@ -100,7 +102,7 @@ const snewfoil_value_info_layout handout[] = {BMP_FOILH_04, STR_AUTOLAYOUT_HANDOUT4, AUTOLAYOUT_HANDOUT4}, {BMP_FOILH_06, STR_AUTOLAYOUT_HANDOUT6, AUTOLAYOUT_HANDOUT6}, {BMP_FOILH_09, STR_AUTOLAYOUT_HANDOUT9, AUTOLAYOUT_HANDOUT9}, - {nullptr, {}, AUTOLAYOUT_NONE}, + {EMPTY, {}, AUTOLAYOUT_NONE}, }; const snewfoil_value_info_layout standard[] = @@ -117,7 +119,7 @@ const snewfoil_value_info_layout standard[] = {BMP_LAYOUT_HEAD02B, STR_AUTOLAYOUT_CONTENT_OVER_CONTENT, AUTOLAYOUT_TITLE_CONTENT_OVER_CONTENT }, {BMP_LAYOUT_HEAD04, STR_AUTOLAYOUT_4CONTENT, AUTOLAYOUT_TITLE_4CONTENT }, {BMP_LAYOUT_HEAD06, STR_AUTOLAYOUT_6CONTENT, AUTOLAYOUT_TITLE_6CONTENT }, - {nullptr, {}, AUTOLAYOUT_NONE} + {EMPTY, {}, AUTOLAYOUT_NONE} }; const snewfoil_value_info_layout v_standard[] = @@ -127,7 +129,7 @@ const snewfoil_value_info_layout v_standard[] = {BMP_LAYOUT_VERTICAL01, STR_AL_VERT_TITLE_VERT_OUTLINE, AUTOLAYOUT_VTITLE_VCONTENT }, {BMP_LAYOUT_HEAD02, STR_AL_TITLE_VERT_OUTLINE, AUTOLAYOUT_TITLE_VCONTENT }, {BMP_LAYOUT_HEAD02A, STR_AL_TITLE_VERT_OUTLINE_CLIPART, AUTOLAYOUT_TITLE_2VTEXT }, - {nullptr, {}, AUTOLAYOUT_NONE} + {EMPTY, {}, AUTOLAYOUT_NONE} }; static void fillLayoutValueSet( ValueSet* pValue, const snewfoil_value_info_layout* pInfo ) @@ -136,7 +138,7 @@ static void fillLayoutValueSet( ValueSet* pValue, const snewfoil_value_info_layo for( ; pInfo->mpStrResId; pInfo++ ) { OUString aText(SdResId(pInfo->mpStrResId)); - Image aImg(StockImage::Yes, OUString::createFromAscii(pInfo->msBmpResId)); + Image aImg(StockImage::Yes, pInfo->msBmpResId); pValue->InsertItem(static_cast<sal_uInt16>(pInfo->maAutoLayout)+1, aImg, aText); aLayoutItemSize.setWidth( std::max( aLayoutItemSize.Width(), aImg.GetSizePixel().Width() ) ); aLayoutItemSize.setHeight( std::max( aLayoutItemSize.Height(), aImg.GetSizePixel().Height() ) ); diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx index 7cc32eae1db1..5841e7b59f57 100644 --- a/sd/source/ui/presenter/PresenterHelper.cxx +++ b/sd/source/ui/presenter/PresenterHelper.cxx @@ -173,7 +173,7 @@ namespace { struct IdMapEntry { char const * sid; - const char* bmpid; + rtl::OUStringConstExpr bmpid; }; } @@ -386,7 +386,7 @@ Reference<rendering::XBitmap> SAL_CALL PresenterHelper::loadBitmap ( OUString bmpid; for (std::size_t i = 0; i != SAL_N_ELEMENTS(map); ++i) { if (id.equalsAscii(map[i].sid)) { - bmpid = OUString::createFromAscii(map[i].bmpid); + bmpid = map[i].bmpid; break; } } diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx index 8483616c5e10..ffc5795e5e44 100644 --- a/sd/source/ui/sidebar/LayoutMenu.cxx +++ b/sd/source/ui/sidebar/LayoutMenu.cxx @@ -74,7 +74,7 @@ namespace { struct snewfoil_value_info { - const char* msBmpResId; + rtl::OUStringConstExpr msBmpResId; TranslateId mpStrResId; WritingMode meWritingMode; AutoLayout maAutoLayout; @@ -82,11 +82,13 @@ struct snewfoil_value_info } +constexpr OUStringLiteral EMPTY = u""; + const snewfoil_value_info notes[] = { {BMP_FOILN_01, STR_AUTOLAYOUT_NOTES, WritingMode_LR_TB, AUTOLAYOUT_NOTES}, - {"", {}, WritingMode_LR_TB, AUTOLAYOUT_NONE}, + {EMPTY, {}, WritingMode_LR_TB, AUTOLAYOUT_NONE}, }; const snewfoil_value_info handout[] = @@ -103,7 +105,7 @@ const snewfoil_value_info handout[] = AUTOLAYOUT_HANDOUT6}, {BMP_FOILH_09, STR_AUTOLAYOUT_HANDOUT9, WritingMode_LR_TB, AUTOLAYOUT_HANDOUT9}, - {"", {}, WritingMode_LR_TB, AUTOLAYOUT_NONE}, + {EMPTY, {}, WritingMode_LR_TB, AUTOLAYOUT_NONE}, }; const snewfoil_value_info standard[] = @@ -126,7 +128,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}, - {"", {}, WritingMode_LR_TB, AUTOLAYOUT_NONE} + {EMPTY, {}, WritingMode_LR_TB, AUTOLAYOUT_NONE} }; class LayoutValueSet : public ValueSet @@ -542,7 +544,7 @@ void LayoutMenu::Fill() { if ((WritingMode_TB_RL != pInfo->meWritingMode) || bVertical) { - Image aImg("private:graphicrepository/" + OUString::createFromAscii(pInfo->msBmpResId)); + Image aImg("private:graphicrepository/" + static_cast<const OUString &>(pInfo->msBmpResId)); if (bRightToLeft && (WritingMode_TB_RL != pInfo->meWritingMode)) { // FIXME: avoid interpolating RTL layouts. |