diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-11-25 17:12:26 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-11-26 09:49:52 +0100 |
commit | 23662e4ca69386c14425798f1e9d80ff803fb7cc (patch) | |
tree | 0f7930aba1fbd3ee1a0185f06a8d0b78a5ec61a0 /svx/source | |
parent | c4499bef94845176b53bbe9678d242638d86040c (diff) |
tdf#139102 Erase with COL_TRANSPARENT doesn't do what it should
lets not fight that here, just provide a simple backportable fix to 7-2
for now.
Change-Id: I77ceb7ccace08041a42b51e1b028ebe2d6a03e51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125823
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/gallery2/galbrws2.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index ffd38f8f45a5..2e715fa95071 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -340,14 +340,11 @@ GalleryBrowser2::GalleryBrowser2(weld::Builder& rBuilder, Gallery* pGallery) , mxIconButton(rBuilder.weld_toggle_button("icon")) , mxListButton(rBuilder.weld_toggle_button("list")) , mxInfoBar(rBuilder.weld_label("label")) - , mxDev(mxListView->create_virtual_device()) , maPreviewSize(28, 28) , mnCurActionPos ( 0xffffffff ) , meMode ( GALLERYBROWSERMODE_NONE ) , meLastMode ( GALLERYBROWSERMODE_NONE ) { - mxDev->SetOutputSizePixel(maPreviewSize); - m_xContext.set( ::comphelper::getProcessComponentContext() ); int nHeight = mxListView->get_height_rows(10); @@ -858,6 +855,9 @@ void GalleryBrowser2::UpdateRows(bool bVisibleOnly) } } + ScopedVclPtr<VirtualDevice> xDev(mxListView->create_virtual_device()); + xDev->SetOutputSizePixel(maPreviewSize); + if (!aBitmapEx.IsEmpty()) { const Size aBitmapExSizePixel(aBitmapEx.GetSizePixel()); @@ -865,19 +865,17 @@ void GalleryBrowser2::UpdateRows(bool bVisibleOnly) ((maPreviewSize.Width() - aBitmapExSizePixel.Width()) >> 1), ((maPreviewSize.Height() - aBitmapExSizePixel.Height()) >> 1)); - mxDev->Erase(); - if (aBitmapEx.IsAlpha()) { // draw checkered background - GalleryIconView::drawTransparenceBackground(*mxDev, aPos, aBitmapExSizePixel); + GalleryIconView::drawTransparenceBackground(*xDev, aPos, aBitmapExSizePixel); } - mxDev->DrawBitmapEx(aPos, aBitmapEx); + xDev->DrawBitmapEx(aPos, aBitmapEx); } mxListView->set_text(rEntry, sItemTextTitle); - mxListView->set_image(rEntry, *mxDev); + mxListView->set_image(rEntry, *xDev); mxListView->set_id(rEntry, OUString()); return false; |