Evas language utils: fixed evas_common_language_script_end_of_run_get and adjusted...
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 30 Jan 2011 10:39:03 +0000 (10:39 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 30 Jan 2011 10:39:03 +0000 (10:39 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@56478 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_text.c
src/lib/canvas/evas_object_textblock.c
src/lib/engines/common/language/evas_language_utils.c

index 5542342..3e8b00f 100644 (file)
@@ -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
index 4eff07c..d75653a 100644 (file)
@@ -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;
index 385ddf4..8cdf709 100644 (file)
@@ -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;