From: tasn Date: Sun, 30 Jan 2011 10:39:03 +0000 (+0000) Subject: Evas language utils: fixed evas_common_language_script_end_of_run_get and adjusted... X-Git-Tag: submit/trunk/20120815.174732~2052 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=08425563dac8055e74da807fb579744b260d14a0;p=profile%2Fivi%2Fevas.git Evas language utils: fixed evas_common_language_script_end_of_run_get and adjusted text and textblock object to use it. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@56478 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/canvas/evas_object_text.c b/src/lib/canvas/evas_object_text.c index 5542342..3e8b00f 100644 --- a/src/lib/canvas/evas_object_text.c +++ b/src/lib/canvas/evas_object_text.c @@ -643,7 +643,7 @@ _evas_object_text_layout(Evas_Object *obj, Evas_Object_Text *o, const Eina_Unico cutoff = evas_common_language_script_end_of_run_get( text, o->bidi_par_props, - pos, len); + pos, len - pos); if (cutoff > 0) { #ifdef BIDI_SUPPORT diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index 4eff07c..d75653a 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -2589,14 +2589,14 @@ skip: while (str && *str) { /* if this is the first line item and it starts with spaces - remove them */ - int tmp_len = 0; + int tmp_len; wrap = 0; white_stripped = 0; ti = _layout_text_item_new(c, fmt, str); ti->parent.text_node = n; ti->parent.text_pos = start + str - tbase; - tmp_len = eina_unicode_strlen(ti->text); + tmp_len = off - (str - tbase); if (ti->parent.text_node) { int tmp_cut; diff --git a/src/lib/engines/common/language/evas_language_utils.c b/src/lib/engines/common/language/evas_language_utils.c index 385ddf4..8cdf709 100644 --- a/src/lib/engines/common/language/evas_language_utils.c +++ b/src/lib/engines/common/language/evas_language_utils.c @@ -59,7 +59,7 @@ evas_common_language_script_end_of_run_get(const Eina_Unicode *str, { Evas_Script_Type first = EVAS_SCRIPT_UNKNOWN; int i; - for (i = start, str += start ; (i < len) ; i++, str++) + for (i = 0 ; i < len ; i++, str++) { Evas_Script_Type tmp; tmp = _get_script(*str); @@ -75,11 +75,11 @@ evas_common_language_script_end_of_run_get(const Eina_Unicode *str, break; } } - i = i - start; #ifdef BIDI_SUPPORT { int bidi_end; - bidi_end = evas_bidi_end_of_run_get(bidi_props, start, len); + bidi_end = evas_bidi_end_of_run_get(bidi_props, start, + start + len); if (bidi_end > 0) { i = (i < bidi_end) ? i : bidi_end; @@ -94,7 +94,7 @@ evas_common_language_script_end_of_run_get(const Eina_Unicode *str, else { #ifdef BIDI_SUPPORT - return evas_bidi_end_of_run_get(bidi_props, start, len); + return evas_bidi_end_of_run_get(bidi_props, start, start + len); #endif } return 0;