[gnumeric] GUI: Fix crash with missing images for sheet object.



commit 14e2e786da7a1205361b8917f0f67ff14fbca32e
Author: Morten Welinder <terra gnome org>
Date:   Thu Mar 8 10:52:08 2012 -0500

    GUI: Fix crash with missing images for sheet object.

 ChangeLog                |    4 ++++
 NEWS                     |    1 +
 src/sheet-object-image.c |   18 +++++-------------
 3 files changed, 10 insertions(+), 13 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0dae147..e431211 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-03-08  Morten Welinder  <terra gnome org>
+
+	* src/sheet-object-image.c (gnm_soi_new_view): Fix crash.
+
 2012-03-08  Jean Brefort  <jean brefort normalesup org>
 
 	* src/sheet-object-widget.c (widget_wbc), (cb_selection_changed): fixed
diff --git a/NEWS b/NEWS
index ad03653..0f5d5d3 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ Morten:
 	* Fix xls export of conditional formats' pattern.  [Part of #671513]
 	* Improve xls import of rich text.  [Part of #671513]
 	* Fix rich text export problem with non-ASCII.  [Part of #671513]
+	* Fix crash with images on sheet.
 
 --------------------------------------------------------------------------
 Gnumeric 1.11.2
diff --git a/src/sheet-object-image.c b/src/sheet-object-image.c
index a7c8aba..3ec0835 100644
--- a/src/sheet-object-image.c
+++ b/src/sheet-object-image.c
@@ -200,25 +200,17 @@ gnm_soi_new_view (SheetObject *so, SheetObjectViewContainer *container)
 			NULL));
 
 	} else {
-		GdkPixbuf *pixbuf, *placeholder = NULL;
-
-		pixbuf = go_image_get_pixbuf (soi->image);
-
-		if (pixbuf == NULL) {
-			placeholder = gtk_icon_theme_load_icon (
-				gtk_icon_theme_get_default (),
-				"unknown_image", 100, 0, NULL);
-			pixbuf = gdk_pixbuf_copy (placeholder);
-		}
+		GdkPixbuf *placeholder = gtk_icon_theme_load_icon
+			(gtk_icon_theme_get_default (),
+			 "unknown_image", 100, 0, NULL);
+		GdkPixbuf *pixbuf = gdk_pixbuf_copy (placeholder);
 
 		goc_item_hide (goc_item_new (GOC_GROUP (item),
 			GOC_TYPE_PIXBUF,
 			"pixbuf", pixbuf,
 			NULL));
 		g_object_unref (G_OBJECT (pixbuf));
-
-		if (placeholder)
-			g_object_set_data (G_OBJECT (item), "tile", placeholder);
+		g_object_set_data (G_OBJECT (item), "tile", placeholder);
 	}
 
 	return gnm_pane_object_register (so, item, TRUE);



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