[gnumeric] Fix cell border style selectors with recent gdk-pixbuf. [#781988]



commit 512f63e22d0e42a723d698f8c0e71460d57cf6c0
Author: Jean Brefort <jean brefort normalesup org>
Date:   Mon Jul 3 13:28:54 2017 +0200

    Fix cell border style selectors with recent gdk-pixbuf. [#781988]

 NEWS                             |    3 +++
 src/dialogs/ChangeLog            |    5 +++++
 src/dialogs/dialog-cell-format.c |   14 +++++++++++---
 3 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/NEWS b/NEWS
index 68b5398..381ce3b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 Gnumeric 1.12.35
 
+Jean:
+       * Fix cell border style selectors with recent gdk-pixbuf. [#781988]
+
 Morten:
        * Test suite improvements.
        * Improve relative accuracy of BESSELJ and BESSELY.
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 5c1f1ca..af649e6 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,8 @@
+2017-07-03  Jean Brefort  <jean brefort normalesup org>
+
+       * dialog-cell-format.c (setup_pattern_button): fix pixdata loading
+       when gdk-pixbuf is >= 2.36.1. [#781988]
+
 2017-03-20  Morten Welinder <terra gnome org>
 
        * Release 1.12.34
diff --git a/src/dialogs/dialog-cell-format.c b/src/dialogs/dialog-cell-format.c
index af943ed..9bb580f 100644
--- a/src/dialogs/dialog-cell-format.c
+++ b/src/dialogs/dialog-cell-format.c
@@ -315,9 +315,17 @@ setup_pattern_button (GdkScreen *screen,
                GtkButton *button = GTK_BUTTON (tmp);
                if (do_image) {
                        char *res = g_strconcat ("/org/gnumeric/gnumeric/images/", name, ".xpm", NULL);
-                       GtkWidget *image = from_icon
-                               ? gtk_image_new_from_icon_name (name, GTK_ICON_SIZE_DIALOG)
-                               : gtk_image_new_from_resource (res);
+                       GtkWidget *image;
+                       if (from_icon)
+                               image = gtk_image_new_from_icon_name (name, GTK_ICON_SIZE_DIALOG);
+                       else {
+                               /* gtk_image_new_from_resource() is unable to load pixdata with gdk-pixbuf >= 
2.36.1
+                                * because it uses the gdk_pixbuf_loader API and the pixdata module has been 
removed
+                                * because of a security issue. See #776004. */
+                               GdkPixbuf *pixbuf = gdk_pixbuf_new_from_resource (res, NULL);
+                               image = gtk_image_new_from_pixbuf (pixbuf);
+                               g_object_unref (pixbuf);
+                       }
                        g_free (res);
                        gtk_widget_show (image);
                        gtk_container_add (GTK_CONTAINER (tmp), image);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]