]> git.eshelyaron.com Git - emacs.git/commitdiff
* gtkutil.c (xg_get_image_for_pixmap): If x_find_image_file returns
authorJan Djärv <jan.h.d@swipnet.se>
Fri, 24 Feb 2006 15:37:10 +0000 (15:37 +0000)
committerJan Djärv <jan.h.d@swipnet.se>
Fri, 24 Feb 2006 15:37:10 +0000 (15:37 +0000)
 nil the image file has been removed, in that case use the (cached)
 pixmap.

src/ChangeLog
src/gtkutil.c

index d8e0b6fb4e151e728e5c8c076dacb970555a745a..8ec98e429178ee74ad96412fa2530a4a7a7da804 100644 (file)
@@ -1,3 +1,9 @@
+2006-02-24  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * 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  <handa@m17n.org>
 
        * fileio.c (Finsert_file_contents): When a text is replaced
index 203eab257f37e415747762bf850a77a6d05315f1..b8d37df22144ad16c4ee364900218e4327b36f48 100644 (file)
@@ -327,6 +327,7 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
      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 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
     if (EQ (XCAR (tail), QCfile))
       specified_file = XCAR (XCDR (tail));
 
-  if (STRINGP (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);
+  /* 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)))
+    {
       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);
     }