# HG changeset patch # User Jan Dj¸«£rv # Date 1140795430 0 # Node ID 6b335e9ea5774d7bae5ca8a708d328a8858cf867 # Parent 3d8b060d10fbb32709ea015b573cdf0b3764f0d3 * gtkutil.c (xg_get_image_for_pixmap): If x_find_image_file returns nil the image file has been removed, in that case use the (cached) pixmap. diff -r 3d8b060d10fb -r 6b335e9ea577 src/ChangeLog --- a/src/ChangeLog Fri Feb 24 15:33:02 2006 +0000 +++ b/src/ChangeLog Fri Feb 24 15:37:10 2006 +0000 @@ -1,3 +1,9 @@ +2006-02-24 Jan Dj,Ad(Brv + + * gtkutil.c (xg_get_image_for_pixmap): If x_find_image_file returns + nil the image file has been removed, in that case use the (cached) + pixmap. + 2006-02-24 Kenichi Handa * fileio.c (Finsert_file_contents): When a text is replaced diff -r 3d8b060d10fb -r 6b335e9ea577 src/gtkutil.c --- a/src/gtkutil.c Fri Feb 24 15:33:02 2006 +0000 +++ b/src/gtkutil.c Fri Feb 24 15:37:10 2006 +0000 @@ -327,6 +327,7 @@ look good in all cases. */ Lisp_Object specified_file = Qnil; Lisp_Object tail; + Lisp_Object file; extern Lisp_Object QCfile; for (tail = XCDR (img->spec); @@ -335,23 +336,18 @@ if (EQ (XCAR (tail), QCfile)) specified_file = XCAR (XCDR (tail)); - if (STRINGP (specified_file)) + /* We already loaded the image once before calling this + function, so this only fails if the image file has been removed. + In that case, use the pixmap already loaded. */ + + if (STRINGP (specified_file) + && STRINGP (file = x_find_image_file (specified_file))) { - Lisp_Object file = Qnil; - struct gcpro gcpro1; - GCPRO1 (file); - - file = x_find_image_file (specified_file); - /* We already loaded the image once before calling this - function, so this should not fail. */ - xassert (STRINGP (file) != 0); - if (! old_widget) old_widget = GTK_IMAGE (gtk_image_new_from_file (SSDATA (file))); else gtk_image_set_from_file (old_widget, SSDATA (file)); - UNGCPRO; return GTK_WIDGET (old_widget); }