aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2006-02-24 15:37:10 +0000
committerJan Djärv2006-02-24 15:37:10 +0000
commita821c035f3f0481da1e57158f1036631a14c76fb (patch)
tree89c4cb37343c97633cfe5acbcc373bda3f90126f /src
parentcb694ab73063cc92342daf96d009cdc6d086bc0b (diff)
downloademacs-a821c035f3f0481da1e57158f1036631a14c76fb.tar.gz
emacs-a821c035f3f0481da1e57158f1036631a14c76fb.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/gtkutil.c18
2 files changed, 13 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d8e0b6fb4e1..8ec98e42917 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12006-02-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * gtkutil.c (xg_get_image_for_pixmap): If x_find_image_file returns
4 nil the image file has been removed, in that case use the (cached)
5 pixmap.
6
12006-02-24 Kenichi Handa <handa@m17n.org> 72006-02-24 Kenichi Handa <handa@m17n.org>
2 8
3 * fileio.c (Finsert_file_contents): When a text is replaced 9 * fileio.c (Finsert_file_contents): When a text is replaced
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 203eab257f3..b8d37df2214 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -327,6 +327,7 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
327 look good in all cases. */ 327 look good in all cases. */
328 Lisp_Object specified_file = Qnil; 328 Lisp_Object specified_file = Qnil;
329 Lisp_Object tail; 329 Lisp_Object tail;
330 Lisp_Object file;
330 extern Lisp_Object QCfile; 331 extern Lisp_Object QCfile;
331 332
332 for (tail = XCDR (img->spec); 333 for (tail = XCDR (img->spec);
@@ -335,23 +336,18 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
335 if (EQ (XCAR (tail), QCfile)) 336 if (EQ (XCAR (tail), QCfile))
336 specified_file = XCAR (XCDR (tail)); 337 specified_file = XCAR (XCDR (tail));
337 338
338 if (STRINGP (specified_file)) 339 /* We already loaded the image once before calling this
339 { 340 function, so this only fails if the image file has been removed.
340 Lisp_Object file = Qnil; 341 In that case, use the pixmap already loaded. */
341 struct gcpro gcpro1;
342 GCPRO1 (file);
343
344 file = x_find_image_file (specified_file);
345 /* We already loaded the image once before calling this
346 function, so this should not fail. */
347 xassert (STRINGP (file) != 0);
348 342
343 if (STRINGP (specified_file)
344 && STRINGP (file = x_find_image_file (specified_file)))
345 {
349 if (! old_widget) 346 if (! old_widget)
350 old_widget = GTK_IMAGE (gtk_image_new_from_file (SSDATA (file))); 347 old_widget = GTK_IMAGE (gtk_image_new_from_file (SSDATA (file)));
351 else 348 else
352 gtk_image_set_from_file (old_widget, SSDATA (file)); 349 gtk_image_set_from_file (old_widget, SSDATA (file));
353 350
354 UNGCPRO;
355 return GTK_WIDGET (old_widget); 351 return GTK_WIDGET (old_widget);
356 } 352 }
357 353