evas: fix crash issue due to wrongly created new line 86/114886/2
authorYoungbok Shin <youngb.shin@samsung.com>
Wed, 15 Feb 2017 10:55:52 +0000 (19:55 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Wed, 15 Feb 2017 11:43:52 +0000 (03:43 -0800)
A line's min text pos could have previous invisible (visually deleted) item's text pos.
Because of this, Textblock could create empty new line. When Textblock's cursor tried to move
on the empty line, process will be crashed.

@tizen_fix

Change-Id: Id32f4d950839646ce7eda4804d7335762a4d6065

src/lib/evas/canvas/evas_object_textblock.c

index bd845a0..68715ac 100644 (file)
@@ -5307,12 +5307,6 @@ _layout_par(Ctxt *c)
 
         it = _ITEM(eina_list_data_get(i));
 
-        /* TIZEN_ONLY(20170201): Fix RTL + LTR word wrap issue caused by wrong line start pos */
-        if ((c->ln_min_text_pos == -1) ||
-            (c->ln_min_text_pos > it->text_pos))
-          c->ln_min_text_pos = it->text_pos;
-        /* END */
-
         /* Skip visually deleted items */
         if (it->visually_deleted ||
             ((it->type == EVAS_TEXTBLOCK_ITEM_TEXT) && !it->format->font.font))
@@ -5325,6 +5319,12 @@ _layout_par(Ctxt *c)
              continue;
           }
 
+        /* TIZEN_ONLY(20170201): Fix RTL + LTR word wrap issue caused by wrong line start pos */
+        if ((c->ln_min_text_pos == -1) ||
+            (c->ln_min_text_pos > it->text_pos))
+          c->ln_min_text_pos = it->text_pos;
+        /* END */
+
         it->x = c->x;
         if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT)
           {