svx/inc/galbrws2.hxx | 1 - svx/source/gallery2/galbrws2.cxx | 14 ++++++-------- 2 files changed, 6 insertions(+), 9 deletions(-)
New commits: commit 368c9f4721bcb7b5e373321868f2af249f12fcfc Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Nov 25 17:12:26 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Nov 26 20:19:08 2021 +0100 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 <caol...@redhat.com> (cherry picked from commit 23662e4ca69386c14425798f1e9d80ff803fb7cc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125834 diff --git a/svx/inc/galbrws2.hxx b/svx/inc/galbrws2.hxx index fc97d9bccdb5..2cf8609ed32b 100644 --- a/svx/inc/galbrws2.hxx +++ b/svx/inc/galbrws2.hxx @@ -85,7 +85,6 @@ private: std::unique_ptr<weld::ToggleButton> mxIconButton; std::unique_ptr<weld::ToggleButton> mxListButton; std::unique_ptr<weld::Label> mxInfoBar; - ScopedVclPtr<VirtualDevice> mxDev; Size maPreviewSize; rtl::Reference<GalleryTransferable> m_xHelper; sal_uInt32 mnCurActionPos; 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;