diff options
author | Matthew J. Francis <mjay.francis@gmail.com> | 2014-11-16 10:26:18 +0800 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-17 09:57:27 +0000 |
commit | e43f692ef908fd2bc180a5e16fb363ec6bb7eb09 (patch) | |
tree | b7b2bdd5d7f7a8381d9da4387a3655c333af37e4 /sfx2 | |
parent | 0843ade74e5848c0babad509b10c334b01847be2 (diff) |
fdo#85478 Avoid destroying bitmaps after VCL is shut down
Change-Id: I1ece738e7f60b6bbbdc802339f8b9deec9396e1b
Reviewed-on: https://gerrit.libreoffice.org/12469
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/recentdocsviewitem.cxx | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx index aa2a7e03f320..c8f19f46720c 100644 --- a/sfx2/source/control/recentdocsviewitem.cxx +++ b/sfx2/source/control/recentdocsviewitem.cxx @@ -30,31 +30,13 @@ using namespace com::sun::star::uno; using namespace drawinglayer::primitive2d; using namespace drawinglayer::processor2d; -/// Icon that the user can click to remove the document from the recent documents. -struct theRemoveRecentBitmap : public rtl::StaticWithInit<BitmapEx, theRemoveRecentBitmap> -{ - BitmapEx operator()() - { - return SfxResId(IMG_RECENTDOC_REMOVE); - } - -}; - -/// Highlighted version of icon that the user can click to remove the document from the recent documents. -struct theRemoveRecentBitmapHighlighted : public rtl::StaticWithInit<BitmapEx, theRemoveRecentBitmapHighlighted> -{ - BitmapEx operator()() - { - return SfxResId(IMG_RECENTDOC_REMOVE_HIGHLIGHTED); - } - -}; - RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rURL, const OUString &rTitle, const BitmapEx &rThumbnail, sal_uInt16 nId) : ThumbnailViewItem(rView, nId), maURL(rURL), - m_bRemoveIconHighlighted(false) + m_bRemoveIconHighlighted(false), + m_aRemoveRecentBitmap(SfxResId(IMG_RECENTDOC_REMOVE)), + m_aRemoveRecentBitmapHighlighted(SfxResId(IMG_RECENTDOC_REMOVE_HIGHLIGHTED)) { OUString aTitle(rTitle); INetURLObject aURLObj(rURL); @@ -151,7 +133,7 @@ Rectangle RecentDocsViewItem::updateHighlight(bool bVisible, const Point& rPoint Rectangle RecentDocsViewItem::getRemoveIconArea() const { Rectangle aArea(getDrawArea()); - Size aSize(theRemoveRecentBitmap::get().GetSizePixel()); + Size aSize(m_aRemoveRecentBitmap.GetSizePixel()); return Rectangle( Point(aArea.Right() - aSize.Width() - THUMBNAILVIEW_ITEM_CORNER, aArea.Top() + THUMBNAILVIEW_ITEM_CORNER), @@ -175,7 +157,7 @@ void RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc Point aIconPos(getRemoveIconArea().TopLeft()); aSeq[0] = drawinglayer::primitive2d::Primitive2DReference(new DiscreteBitmapPrimitive2D( - m_bRemoveIconHighlighted? theRemoveRecentBitmapHighlighted::get(): theRemoveRecentBitmap::get(), + m_bRemoveIconHighlighted ? m_aRemoveRecentBitmapHighlighted : m_aRemoveRecentBitmap, B2DPoint(aIconPos.X(), aIconPos.Y()))); pProcessor->process(aSeq); |