[gnumeric] Don't crash when copying an image.



commit e1e0d397e3ded36add085f53273a698d921aceb5
Author: Jean Brefort <jean brefort normalesup org>
Date:   Sat Oct 20 12:03:42 2012 +0200

    Don't crash when copying an image.

 ChangeLog                |    5 +++++
 src/sheet-object-image.c |    3 ++-
 2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fc7928b..3ee4032 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-20  Jean Brefort  <jean brefort normalesup org>
+
+	* src/sheet-object-image.c (gnm_soi_get_target_list): fix trivial crasher,
+	(gnm_soi_copy): really copy the image.
+
 2012-10-19  Morten Welinder  <terra gnome org>
 
 	* src/sheet-style.c (internal_style_list): Check actual area
diff --git a/src/sheet-object-image.c b/src/sheet-object-image.c
index 306373c..3037fe1 100644
--- a/src/sheet-object-image.c
+++ b/src/sheet-object-image.c
@@ -256,7 +256,7 @@ gnm_soi_get_target_list (SheetObject const *so)
 	GSList *mimes, *ptr;
 	GdkPixbuf *pixbuf = NULL;
 
-	if (soi->type == NULL || soi->image == NULL)
+	if (soi->type == NULL)
 		pixbuf = go_image_get_pixbuf (soi->image);
 	mime_str = go_image_format_to_mime (soi->type);
 	if (mime_str) {
@@ -462,6 +462,7 @@ gnm_soi_copy (SheetObject *dst, SheetObject const *src)
 	new_soi->crop_bottom	= soi->crop_bottom;
 	new_soi->crop_left	= soi->crop_left;
 	new_soi->crop_right	= soi->crop_right;
+	new_soi->image		= g_object_ref (soi->image);
 }
 
 static void



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