Evas textblock: clean up text_append, and possibly solve infinite loop.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 30 May 2011 08:16:35 +0000 (08:16 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 30 May 2011 08:16:35 +0000 (08:16 +0000)
I removed the workaround that solved it, for this cleaner, solution that
should work.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@59802 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c

index 03b0428..d56ff50 100644 (file)
@@ -2824,13 +2824,13 @@ skip:
         return;
      }
 
-   do
+   while (cur_len > 0)
      {
         Evas_Font_Instance *script_fi = NULL;
         int script_len, tmp_cut;
         Evas_Script_Type script;
 
-        script_len = off - (str - tbase);
+        script_len = cur_len;
 
         tmp_cut = evas_common_language_script_end_of_run_get(str,
               c->par->bidi_props, start + str - tbase, script_len);
@@ -2838,18 +2838,12 @@ skip:
           {
              script_len = tmp_cut;
           }
-
-        /* FIXME: This is a possible fix for an infinite loops that happens
-         * if script_len < 0. Should find the source of the issue,
-         * i.e why (off - (str - tbase)) is ever < 0. I can't reproduce the
-         * issue so I can't really do anything about it. */
-        if (script_len < 0)
-           break;
+        cur_len -= script_len;
 
         script = evas_common_language_script_type_get(str, script_len);
 
 
-        do
+        while (script_len > 0)
           {
              Evas_Font_Instance *cur_fi;
              int run_len = script_len;
@@ -2875,15 +2869,11 @@ skip:
                         ti->parent.text_pos, run_len);
                }
              str += run_len;
-             cur_len -= run_len;
              script_len -= run_len;
 
              _layout_text_add_logical_item(c, ti, NULL);
           }
-        while (script_len > 0);
      }
-   while (*str);
-
 }
 
 /**