From eda88cd2eb4cba8f1a3482a3d1bfda66d29f3aab 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. Reviewed-on: https://gerrit.libreoffice.org/64760 Tested-by: Jenkins Reviewed-by: Michael Meeks Reviewed-on: https://gerrit.libreoffice.org/64860 Tested-by: Michael Meeks (cherry picked from commit 89161e4d5835b93f0942e960a116a0d3863cc55c) Change-Id: I3224e11937d720fa484b0d659d25673a9e809267 Reviewed-on: https://gerrit.libreoffice.org/79844 Tested-by: Jenkins CollaboraOffice Reviewed-by: Noel Grandin --- framework/source/uielement/controlmenucontroller.cxx | 2 +- framework/source/uielement/popuptoolbarcontroller.cxx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'framework') diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx index 9685ac385a95..151ba431bbf2 100644 --- a/framework/source/uielement/controlmenucontroller.cxx +++ b/framework/source/uielement/controlmenucontroller.cxx @@ -182,7 +182,7 @@ void ControlMenuController::updateImagesPopupMenu( PopupMenu* pPopupMenu ) OString sIdent = OString(aCommands[i]).copy(5); sal_uInt16 nId = pPopupMenu->GetItemId(sIdent); if (m_bShowMenuImages) - pPopupMenu->SetItemImage(nId, Image(BitmapEx(aImgIds[i]))); + pPopupMenu->SetItemImage(nId, Image(StockImage::Yes, aImgIds[i])); else pPopupMenu->SetItemImage(nId, Image()); } diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index 0da3d9b97b74..6ce0354f891c 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -492,11 +492,11 @@ void SaveToolbarController::updateImage() else if ( m_bModified ) { if (eImageType == vcl::ImageType::Size26) - aImage = Image(BitmapEx(BMP_SAVEMODIFIED_LARGE)); + aImage = Image(StockImage::Yes, BMP_SAVEMODIFIED_LARGE); else if (eImageType == vcl::ImageType::Size32) - aImage = Image(BitmapEx(BMP_SAVEMODIFIED_EXTRALARGE)); + aImage = Image(StockImage::Yes, BMP_SAVEMODIFIED_EXTRALARGE); else - aImage = Image(BitmapEx(BMP_SAVEMODIFIED_SMALL)); + aImage = Image(StockImage::Yes, BMP_SAVEMODIFIED_SMALL); } if ( !aImage ) -- cgit