From 1a490b71feb2340ac4f58ff1bef983ef1115e2f3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 11 Feb 2021 20:57:25 +0000 Subject: allow using css::graphic::XGraphic to set menu image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ice5062f26ea300aec73d5fd849484c8bc4fc43bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110793 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/unx/gtk3/gtk3gtkinst.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index d24edef22ae9..2a9e02308cd3 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -8282,6 +8282,7 @@ public: virtual void insert(int pos, const OUString& rId, const OUString& rStr, const OUString* pIconName, VirtualDevice* pImageSurface, + const css::uno::Reference* pGraphic, TriState eCheckRadioFalse) override { GtkWidget* pImage = nullptr; @@ -8297,6 +8298,14 @@ public: { pImage = image_new_from_virtual_device(*pImageSurface); } + else if (pGraphic) + { + if (GdkPixbuf* pixbuf = getPixbuf(*pGraphic)) + { + pImage = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + } + } GtkWidget *pItem; if (pImage) -- cgit