From: handa Date: Wed, 17 Mar 2004 07:45:20 +0000 (+0000) Subject: (visual_order): Delete unused locale var `pos'. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=fd7e1e06b7bf98a408d0d20775259a14ef36e559;p=m17n%2Fm17n-lib.git (visual_order): Delete unused locale var `pos'. (compose_glyph_string): Fix for the case that gstring->glyphs is realloced. Stop generating glyphs at TO. --- diff --git a/src/draw.c b/src/draw.c index 75894d2..f36fdba 100644 --- a/src/draw.c +++ b/src/draw.c @@ -236,6 +236,7 @@ compose_glyph_string (MFrame *frame, MText *mt, int from, int to, int size = gstring->control.fixed_width; int ignore_formatting_char = gstring->control.ignore_formatting_char; int i, limit; + int last; MLIST_RESET (gstring); gstring->from = from; @@ -251,7 +252,7 @@ compose_glyph_string (MFrame *frame, MText *mt, int from, int to, APPEND_GLYPH (gstring, g_tmp); stop = face_change = charset_change = language_change = pos = from; - g = gstring->glyphs + gstring->used; + last = 0; non_ascii_found = 0; while (1) { @@ -284,13 +285,15 @@ compose_glyph_string (MFrame *frame, MText *mt, int from, int to, } } - if (pos == stop || script != this_script || g->type != g_tmp.type) + if (pos == stop || script != this_script + || MGLYPH (last)->type != g_tmp.type) { + g = MGLYPH (last); if (non_ascii_found && g->type == GLYPH_CHAR) while (g < gstring->glyphs + gstring->used) g = mface__for_chars (script, language, charset, g, gstring->glyphs + gstring->used, size); - g = gstring->glyphs + gstring->used; + last = gstring->used; non_ascii_found = 0; script = this_script; if (pos == to) @@ -317,7 +320,9 @@ compose_glyph_string (MFrame *frame, MText *mt, int from, int to, language, charset, size) : default_rface); } - stop = language_change; + stop = to; + if (stop > language_change) + stop = language_change; if (stop > charset_change) stop = charset_change; if (face_change < stop)