summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-12-07 10:29:02 +0200
committerMichael Meeks <michael.meeks@collabora.com>2018-12-10 11:09:00 +0100
commit89161e4d5835b93f0942e960a116a0d3863cc55c (patch)
tree5c614702f3f553bd41f8082e48b841cf9db4c2e9 /sd/source
parent3f4874dcff0423e045151eb8f435b2b1d057733b (diff)
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 <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/64860 Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/animations/CustomAnimationList.cxx7
-rw-r--r--sd/source/ui/animations/SlideTransitionPane.cxx2
-rw-r--r--sd/source/ui/app/sdmod2.cxx4
-rw-r--r--sd/source/ui/dlg/navigatr.cxx2
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx28
-rw-r--r--sd/source/ui/tools/IconCache.cxx2
6 files changed, 22 insertions, 23 deletions
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index 58d6d6b475b1..15b5ca0b40cd 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -266,11 +266,11 @@ void CustomAnimationListEntryItem::Paint(const Point& rPos, SvTreeListBox& rDev,
sal_Int16 nNodeType = mpEffect->getNodeType();
if (nNodeType == EffectNodeType::ON_CLICK )
{
- rRenderContext.DrawImage(aPos, Image(BitmapEx(BMP_CUSTOMANIMATION_ON_CLICK)));
+ rRenderContext.DrawImage(aPos, Image(StockImage::Yes, BMP_CUSTOMANIMATION_ON_CLICK));
}
else if (nNodeType == EffectNodeType::AFTER_PREVIOUS)
{
- rRenderContext.DrawImage(aPos, Image(BitmapEx(BMP_CUSTOMANIMATION_AFTER_PREVIOUS)));
+ rRenderContext.DrawImage(aPos, Image(StockImage::Yes, BMP_CUSTOMANIMATION_AFTER_PREVIOUS));
}
else if (nNodeType == EffectNodeType::WITH_PREVIOUS)
{
@@ -315,8 +315,7 @@ void CustomAnimationListEntryItem::Paint(const Point& rPos, SvTreeListBox& rDev,
if (!sImage.isEmpty())
{
- BitmapEx aBitmap(sImage);
- Image aImage(aBitmap);
+ Image aImage(StockImage::Yes, sImage);
Point aImagePos(aPos);
aImagePos.Y() += (aSize.Height()/2 - aImage.GetSizePixel().Height()) >> 1;
rRenderContext.DrawImage(aImagePos, aImage);
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index 5ca0ea8227c9..df96aa23f34a 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -467,7 +467,7 @@ void SlideTransitionPane::Initialize(SdDrawDocument* pDoc)
// dummy list box of slide transitions for startup.
mpVS_TRANSITION_ICONS->InsertItem(
- 0, Image( BitmapEx( "sd/cmd/transition-none.png" ) ),
+ 0, Image( StockImage::Yes, "sd/cmd/transition-none.png" ),
SdResId( STR_SLIDETRANSITION_NONE ),
VALUESET_APPEND, /* show legend */ true );
mpVS_TRANSITION_ICONS->RecalculateItemSizes();
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 9fc37b1c70e4..012c8cb8da04 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -816,12 +816,12 @@ SfxStyleFamilies* SdModule::CreateStyleFamilies()
pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Para,
SdResId(STR_GRAPHICS_STYLE_FAMILY),
- Image(BitmapEx(BMP_STYLES_FAMILY_GRAPHICS)),
+ Image(StockImage::Yes, BMP_STYLES_FAMILY_GRAPHICS),
RID_GRAPHICSTYLEFAMILY, SD_MOD()->GetResLocale()));
pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Pseudo,
SdResId(STR_PRESENTATIONS_STYLE_FAMILY),
- Image(BitmapEx(BMP_STYLES_FAMILY_PRESENTATIONS)),
+ Image(StockImage::Yes, BMP_STYLES_FAMILY_PRESENTATIONS),
RID_PRESENTATIONSTYLEFAMILY, SD_MOD()->GetResLocale()));
return pStyleFamilies;
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 53526c95473b..f3578054502c 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -757,7 +757,7 @@ void SdNavigatorWin::KeyInput( const KeyEvent& rKEvt )
void SdNavigatorWin::SetDragImage()
{
const sal_uInt16 nDragTypeId = maToolbox->GetItemId("dragmode");
- maToolbox->SetItemImage(nDragTypeId, Image(BitmapEx(GetDragTypeSdBmpId(meDragType))));
+ maToolbox->SetItemImage(nDragTypeId, Image(StockImage::Yes, GetDragTypeSdBmpId(meDragType)));
}
/**
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index d9d193e445c0..f87be19864eb 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -198,8 +198,8 @@ SdPageObjsTLB::SdPageObjsTLB( vcl::Window* pParentWin, WinBits nStyle )
, mpBookmarkDoc ( nullptr )
, mpMedium ( nullptr )
, mpOwnMedium ( nullptr )
-, maImgOle ( BitmapEx(BMP_OLE) )
-, maImgGraphic ( BitmapEx(BMP_GRAPHIC) )
+, maImgOle ( StockImage::Yes, BMP_OLE )
+, maImgGraphic ( StockImage::Yes, BMP_GRAPHIC )
, mbLinkableSelected ( false )
, mpDropNavWin ( nullptr )
, mpFrame ( nullptr )
@@ -215,7 +215,7 @@ SdPageObjsTLB::SdPageObjsTLB( vcl::Window* pParentWin, WinBits nStyle )
WB_HSCROLL |
WB_HASBUTTONSATROOT );
SetQuickSearch(true); /* i31275 */;
- SetNodeBitmaps(Image(BitmapEx(BMP_EXPAND)), Image(BitmapEx(BMP_COLLAPSE)));
+ SetNodeBitmaps(Image(StockImage::Yes, BMP_EXPAND), Image(StockImage::Yes, BMP_COLLAPSE));
SetDragDropMode(
DragDropMode::CTRL_MOVE | DragDropMode::CTRL_COPY |
@@ -487,8 +487,8 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, SfxMedium* pInMedium,
mpMedium = pInMedium;
maDocName = rDocName;
- Image aImgDocOpen=Image(BitmapEx(BMP_DOC_OPEN));
- Image aImgDocClosed=Image(BitmapEx(BMP_DOC_CLOSED));
+ Image aImgDocOpen(StockImage::Yes, BMP_DOC_OPEN);
+ Image aImgDocClosed(StockImage::Yes, BMP_DOC_CLOSED);
// insert document name
InsertEntry( maDocName, aImgDocOpen, aImgDocClosed, nullptr, true, TREELIST_APPEND,
@@ -749,9 +749,9 @@ void SdPageObjsTLB::RequestingChildren( SvTreeListEntry* pFileEntry )
SdrObject* pObj = nullptr;
SvTreeListEntry* pPageEntry = nullptr;
- Image aImgPage = Image(BitmapEx(BMP_PAGE));
- Image aImgPageObjs = Image(BitmapEx(BMP_PAGEOBJS));
- Image aImgObjects = Image(BitmapEx(BMP_OBJECTS));
+ Image aImgPage(StockImage::Yes, BMP_PAGE);
+ Image aImgPageObjs(StockImage::Yes, BMP_PAGEOBJS);
+ Image aImgObjects(StockImage::Yes, BMP_OBJECTS);
// document name already inserted
@@ -1448,12 +1448,12 @@ void SdPageObjsTLB::AddShapeToTransferable (
//===== IconProvider ==========================================================
SdPageObjsTLB::IconProvider::IconProvider()
- : maImgPage(BitmapEx(BMP_PAGE)),
- maImgPageExcl(BitmapEx(BMP_PAGE_EXCLUDED)),
- maImgPageObjsExcl(BitmapEx(BMP_PAGEOBJS_EXCLUDED)),
- maImgPageObjs(BitmapEx(BMP_PAGEOBJS)),
- maImgObjects(BitmapEx(BMP_OBJECTS)),
- maImgGroup(BitmapEx(BMP_GROUP))
+ : maImgPage(StockImage::Yes, BMP_PAGE),
+ maImgPageExcl(StockImage::Yes, BMP_PAGE_EXCLUDED),
+ maImgPageObjsExcl(StockImage::Yes, BMP_PAGEOBJS_EXCLUDED),
+ maImgPageObjs(StockImage::Yes, BMP_PAGEOBJS),
+ maImgObjects(StockImage::Yes, BMP_OBJECTS),
+ maImgGroup(StockImage::Yes, BMP_GROUP)
{
}
diff --git a/sd/source/ui/tools/IconCache.cxx b/sd/source/ui/tools/IconCache.cxx
index 1208d62cedf8..b323d7b1cc49 100644
--- a/sd/source/ui/tools/IconCache.cxx
+++ b/sd/source/ui/tools/IconCache.cxx
@@ -55,7 +55,7 @@ Image IconCache::Implementation::GetIcon(const OUString& rResourceId)
iImage = maContainer.find(rResourceId);
if (iImage == maContainer.end())
{
- aResult = Image(BitmapEx(rResourceId));
+ aResult = Image(StockImage::Yes, rResourceId);
maContainer[rResourceId] = aResult;
}
else