Mercurial > hg > xemacs-beta
diff src/glyphs.c @ 4816:576f09d387d5
Fix query_string_font lookup domains
author | Didier Verna <didier@lrde.epita.fr> |
---|---|
date | Sat, 09 Jan 2010 15:49:38 +0100 |
parents | 6540302eedf5 |
children | a98ca4640147 |
line wrap: on
line diff
--- a/src/glyphs.c Sat Jan 09 15:31:25 2010 +0100 +++ b/src/glyphs.c Sat Jan 09 15:49:38 2010 +0100 @@ -2431,32 +2431,24 @@ query_string_font (Lisp_Object string, Lisp_Object face, Lisp_Object domain) { unsigned char charsets[NUM_LEADING_BYTES]; - struct face_cachel frame_cachel; - struct face_cachel *cachel; + struct face_cachel cachel; int i; - Lisp_Object frame = DOMAIN_FRAME (domain); + Lisp_Object window = DOMAIN_WINDOW (domain); + Lisp_Object frame = DOMAIN_FRAME (domain); /* Compute string font info */ find_charsets_in_ibyte_string (charsets, - XSTRING_DATA (string), - XSTRING_LENGTH (string)); - - reset_face_cachel (&frame_cachel); - update_face_cachel_data (&frame_cachel, frame, face); - cachel = &frame_cachel; - - ensure_face_cachel_complete (cachel, domain, charsets); + XSTRING_DATA (string), + XSTRING_LENGTH (string)); + + reset_face_cachel (&cachel); + update_face_cachel_data (&cachel, NILP (window) ? frame : window, face); + ensure_face_cachel_complete (&cachel, domain, charsets); for (i = 0; i < NUM_LEADING_BYTES; i++) - { - if (charsets[i]) - { - return FACE_CACHEL_FONT (cachel, - charset_by_leading_byte (i + - MIN_LEADING_BYTE)); - - } - } + if (charsets[i]) + return FACE_CACHEL_FONT + ((&cachel), charset_by_leading_byte (i + MIN_LEADING_BYTE)); return Qnil; /* NOT REACHED */ }