Commit 67b055a7 authored by Morten Welinder's avatar Morten Welinder

Printing: fix crash for printing images with certain cairo versions.

parent cd0a6185
2010-10-18 Morten Welinder <terra@gnome.org>
* src/sheet-object-image.c (gnm_soi_draw_cairo): Fix printing
crash. [#632439]
2010-10-15 Morten Welinder <terra@gnome.org>
* src/sheet-object-widget.c (sheet_widget_frame_user_config): Use
......
......@@ -18,6 +18,7 @@ Jean:
Morten:
* Fix crash related to broken xls. [#632050]
* Fix print area problem from broken xls.
* Fix printing crash. [#632439]
--------------------------------------------------------------------------
Gnumeric 1.10.11
......
......@@ -550,6 +550,7 @@ gnm_soi_draw_cairo (SheetObject const *so, cairo_t *cr,
pixbuf = soi_get_pixbuf (SHEET_OBJECT_IMAGE (so), 1.);
if (!pixbuf || width == 0. || height == 0.)
return;
cairo_save (cr);
img = go_image_new_from_pixbuf (pixbuf);
cr_pattern = go_image_create_cairo_pattern (img);
......@@ -562,6 +563,11 @@ gnm_soi_draw_cairo (SheetObject const *so, cairo_t *cr,
cairo_rectangle (cr, 0., 0., width, height);
cairo_set_source (cr, cr_pattern);
cairo_fill (cr);
/*
* We need to unset the source before we destroy the pattern.
* cairo_restore will do that. See #632439.
*/
cairo_restore (cr);
cairo_pattern_destroy (cr_pattern);
g_object_unref (img);
g_object_unref (pixbuf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment