From 15f0d61206dddee12159b68aeab5c860e3d5aff4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 7 Dec 2018 10:29:02 +0200 Subject: use Image(OUString) instead of Image(Bitmap(OUString)) which benefits LOOL since we can delay creating the image until we know the dpi setting of the display we are going to write to. Achieved by perl -pi -w -e "s/\bImage\s*\(\s*BitmapEx\s*\((\w+)\s*\)\s*\)/Image\(\1\)/g" $( git grep -lw "BitmapEx" ) followed by git grep -nP '\bImage\s*\(\s*BitmapEx\s*\(' followed by commenting out the BitmapEx(OUString) constructor and seeing what needed adjusting. Change-Id: I3224e11937d720fa484b0d659d25673a9e809267 Reviewed-on: https://gerrit.libreoffice.org/64760 Tested-by: Jenkins Reviewed-by: Michael Meeks --- cui/source/customize/cfgutil.cxx | 12 ++++++------ cui/source/dialogs/cuihyperdlg.cxx | 8 ++++---- cui/source/dialogs/scriptdlg.cxx | 8 ++++---- cui/source/options/dbregister.cxx | 2 +- cui/source/tabpages/labdlg.cxx | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) (limited to 'cui') diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index 17efb2d86497..267f8217784d 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -426,17 +426,17 @@ struct SvxConfigGroupBoxResource_Impl }; SvxConfigGroupBoxResource_Impl::SvxConfigGroupBoxResource_Impl() : - m_hdImage(BitmapEx(RID_CUIBMP_HARDDISK)), - m_libImage(BitmapEx(RID_CUIBMP_LIB)), - m_macImage(BitmapEx(RID_CUIBMP_MACRO)), - m_docImage(BitmapEx(RID_CUIBMP_DOC)), + m_hdImage(StockImage::Yes, RID_CUIBMP_HARDDISK), + m_libImage(StockImage::Yes, RID_CUIBMP_LIB), + m_macImage(StockImage::Yes, RID_CUIBMP_MACRO), + m_docImage(StockImage::Yes, RID_CUIBMP_DOC), m_sMyMacros(CuiResId(RID_SVXSTR_MYMACROS)), m_sProdMacros(CuiResId(RID_SVXSTR_PRODMACROS)), m_sMacros(CuiResId(RID_SVXSTR_BASICMACROS)), m_sDlgMacros(CuiResId(RID_SVXSTR_PRODMACROS)), m_aStrGroupStyles(CuiResId(RID_SVXSTR_GROUP_STYLES)), - m_collapsedImage(BitmapEx(RID_CUIBMP_COLLAPSED)), - m_expandedImage(BitmapEx(RID_CUIBMP_EXPANDED)) + m_collapsedImage(StockImage::Yes, RID_CUIBMP_COLLAPSED), + m_expandedImage(StockImage::Yes, RID_CUIBMP_EXPANDED) { } diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx index e106826bdeba..a3e31a91dbd4 100644 --- a/cui/source/dialogs/cuihyperdlg.cxx +++ b/cui/source/dialogs/cuihyperdlg.cxx @@ -93,10 +93,10 @@ SvxHpLinkDlg::SvxHpLinkDlg (vcl::Window* pParent, SfxBindings* pBindings) std::vector imgVector; OUString aStrTitle; SvxIconChoiceCtrlEntry *pEntry; - imgVector.emplace_back(BitmapEx(RID_SVXBMP_HLINETTP)); - imgVector.emplace_back(BitmapEx(RID_SVXBMP_HLMAILTP)); - imgVector.emplace_back(BitmapEx(RID_SVXBMP_HLDOCTP)); - imgVector.emplace_back(BitmapEx(RID_SVXBMP_HLDOCNTP)); + imgVector.emplace_back(StockImage::Yes, RID_SVXBMP_HLINETTP); + imgVector.emplace_back(StockImage::Yes, RID_SVXBMP_HLMAILTP); + imgVector.emplace_back(StockImage::Yes, RID_SVXBMP_HLDOCTP); + imgVector.emplace_back(StockImage::Yes, RID_SVXBMP_HLDOCNTP); for(Image &aImage : imgVector ) { diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index d0eeb7b8c2ea..379ceeb47240 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -73,10 +73,10 @@ static void ShowErrorDialog( const Any& aException ) SFTreeListBox::SFTreeListBox(vcl::Window* pParent) : SvTreeListBox(pParent) - , m_hdImage(BitmapEx(RID_CUIBMP_HARDDISK)) - , m_libImage(BitmapEx(RID_CUIBMP_LIB)) - , m_macImage(BitmapEx(RID_CUIBMP_MACRO)) - , m_docImage(BitmapEx(RID_CUIBMP_DOC)) + , m_hdImage(StockImage::Yes, RID_CUIBMP_HARDDISK) + , m_libImage(StockImage::Yes, RID_CUIBMP_LIB) + , m_macImage(StockImage::Yes, RID_CUIBMP_MACRO) + , m_docImage(StockImage::Yes, RID_CUIBMP_DOC) , m_sMyMacros(CuiResId(RID_SVXSTR_MYMACROS)) , m_sProdMacros(CuiResId(RID_SVXSTR_PRODMACROS)) { diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index ebd641bb628d..d31876dadd98 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -389,7 +389,7 @@ void DbRegistrationOptionsPage::insertNewEntry( const OUString& _sName,const OUS SvTreeListEntry* pEntry = nullptr; if ( _bReadOnly ) { - Image aLocked(BitmapEx(RID_SVXBMP_LOCK)); + Image aLocked(StockImage::Yes, RID_SVXBMP_LOCK); pEntry = m_pPathBox->InsertEntry( aStr, aLocked, aLocked ); } else diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx index 4d8331e05c0e..cda14818ee05 100644 --- a/cui/source/tabpages/labdlg.cxx +++ b/cui/source/tabpages/labdlg.cxx @@ -112,9 +112,9 @@ SvxCaptionTabPage::SvxCaptionTabPage(TabPageParent pParent, const SfxItemSet& rI aLineTypes.push_back(m_xLineTypes->get_text(i)); static_assert(CAPTYPE_BITMAPS_COUNT == 3, "unexpected"); - m_aBmpCapTypes[0] = Image(BitmapEx(RID_SVXBMP_LEGTYP1)); - m_aBmpCapTypes[1] = Image(BitmapEx(RID_SVXBMP_LEGTYP2)); - m_aBmpCapTypes[2] = Image(BitmapEx(RID_SVXBMP_LEGTYP3)); + m_aBmpCapTypes[0] = Image(StockImage::Yes, RID_SVXBMP_LEGTYP1); + m_aBmpCapTypes[1] = Image(StockImage::Yes, RID_SVXBMP_LEGTYP2); + m_aBmpCapTypes[2] = Image(StockImage::Yes, RID_SVXBMP_LEGTYP3); //------------install ValueSet-------------------------- m_xCT_CAPTTYPE->SetStyle( m_xCT_CAPTTYPE->GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER | WB_NAMEFIELD ); -- cgit