comparison src/composite.c @ 98213:52d26067a946

(Fcomposition_get_gstring): Yet another int/Lisp_Oject mixup (YAILOM).
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 17 Sep 2008 21:25:29 +0000
parents b5e444f66902
children 5803b1114219
comparison
equal deleted inserted replaced
98212:3b2bee2b95a4 98213:52d26067a946
1487 must be ignore. */) 1487 must be ignore. */)
1488 (from, to, font_object, string) 1488 (from, to, font_object, string)
1489 Lisp_Object font_object, from, to, string; 1489 Lisp_Object font_object, from, to, string;
1490 { 1490 {
1491 Lisp_Object gstring, header; 1491 Lisp_Object gstring, header;
1492 EMACS_INT frompos, topos;
1492 1493
1493 if (! NILP (font_object)) 1494 if (! NILP (font_object))
1494 CHECK_FONT_OBJECT (font_object); 1495 CHECK_FONT_OBJECT (font_object);
1495 header = fill_gstring_header (Qnil, from, to, font_object, string); 1496 header = fill_gstring_header (Qnil, from, to, font_object, string);
1496 gstring = gstring_lookup_cache (header); 1497 gstring = gstring_lookup_cache (header);
1497 if (! NILP (gstring)) 1498 if (! NILP (gstring))
1498 return gstring; 1499 return gstring;
1499 if (LGSTRING_GLYPH_LEN (gstring_work) < to - from) 1500
1500 gstring_work = Fmake_vector (make_number (to - from + 2), Qnil); 1501 /* Maybe we should check this at the function's entry. --Stef */
1502 CHECK_NATNUM (from); frompos = XINT (from);
1503 CHECK_NATNUM (to); topos = XINT (to);
1504
1505 if (LGSTRING_GLYPH_LEN (gstring_work) < topos - frompos)
1506 gstring_work = Fmake_vector (make_number (topos - frompos + 2), Qnil);
1501 LGSTRING_SET_HEADER (gstring_work, header); 1507 LGSTRING_SET_HEADER (gstring_work, header);
1502 LGSTRING_SET_ID (gstring_work, Qnil); 1508 LGSTRING_SET_ID (gstring_work, Qnil);
1503 fill_gstring_body (gstring_work); 1509 fill_gstring_body (gstring_work);
1504 return gstring_work; 1510 return gstring_work;
1505 } 1511 }