summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-25 17:12:26 +0000
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2021-11-27 17:47:17 +0100
commitf2b7b0efba1ffc22b987563a5df339282018bc7a (patch)
tree0dd02f0d3585169a250438d4ebb4bfe4ff0088ec /svx
parentb129bc808fe846f729f511062e7cbedf24b9047e (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/+/125828 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/galbrws2.hxx1
-rw-r--r--svx/source/gallery2/galbrws2.cxx14
2 files changed, 6 insertions, 9 deletions
diff --git a/svx/inc/galbrws2.hxx b/svx/inc/galbrws2.hxx
index 2640184846e3..7136a54284bf 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 b644a2d51422..452825679bdb 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -342,14 +342,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);
@@ -860,6 +857,9 @@ void GalleryBrowser2::UpdateRows(bool bVisibleOnly)
}
}
+ ScopedVclPtr<VirtualDevice> xDev(mxListView->create_virtual_device());
+ xDev->SetOutputSizePixel(maPreviewSize);
+
if (!aBitmapEx.IsEmpty())
{
const Size aBitmapExSizePixel(aBitmapEx.GetSizePixel());
@@ -867,19 +867,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;