summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_object_textblock.c
diff options
context:
space:
mode:
authorDaniel Hirt <hirt.danny@gmail.com>2018-06-29 17:05:06 +0300
committerDaniel Hirt <hirt.danny@gmail.com>2018-07-02 12:50:14 +0300
commit27c677f1e088d9bece4169d9e717ae898d1bdb13 (patch)
treec5c1ff8fd8299d1c906c2745f05c1a255e38a12a /src/lib/evas/canvas/evas_object_textblock.c
parent3db6b94ec82a7c7a47ad1698b56e7d7970e389c7 (diff)
Evas textblock: clear ellipsis item at start of layout
The ellipsis item was tracked so it can be inserted at the correct position. It was not cleared properly, leading to a randomly failing test suite. Actually, it seems that there is no need to even store the ellipsis item as the object data, so it was also moved to be in the layout context, instead. A special shoutout to ManMower for lending me his machine, as the test suite didn't fail on mine. Fixes T6986 @fix
Diffstat (limited to 'src/lib/evas/canvas/evas_object_textblock.c')
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index d1f6123..b9712a2 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -606,7 +606,6 @@ struct _Evas_Object_Textblock
606 Evas_Object_Textblock_Paragraph *par_index[TEXTBLOCK_PAR_INDEX_SIZE]; 606 Evas_Object_Textblock_Paragraph *par_index[TEXTBLOCK_PAR_INDEX_SIZE];
607 607
608 Evas_Object_Textblock_Text_Item *ellip_ti; 608 Evas_Object_Textblock_Text_Item *ellip_ti;
609 Eina_List *ellip_prev_it; /* item that is placed before ellipsis item (0.0 <= ellipsis < 1.0), if required */
610 Eina_List *anchors_a; 609 Eina_List *anchors_a;
611 Eina_List *anchors_item; 610 Eina_List *anchors_item;
612 Eina_List *obstacles; 611 Eina_List *obstacles;
@@ -2887,6 +2886,7 @@ struct _Ctxt
2887 Evas_Object_Textblock_Format *fmt; 2886 Evas_Object_Textblock_Format *fmt;
2888 2887
2889 Eina_List *obs_infos; /**< Extra information for items in current line. */ 2888 Eina_List *obs_infos; /**< Extra information for items in current line. */
2889 Eina_List *ellip_prev_it; /* item that is placed before ellipsis item (0.0 <= ellipsis < 1.0), if required */
2890 2890
2891 int x, y; 2891 int x, y;
2892 int w, h; 2892 int w, h;
@@ -5472,7 +5472,7 @@ _layout_par_ellipsis_items(Ctxt *c, double ellip)
5472 Evas_Coord l, h, off; 5472 Evas_Coord l, h, off;
5473 int pos; 5473 int pos;
5474 5474
5475 c->o->ellip_prev_it = NULL; 5475 c->ellip_prev_it = NULL;
5476 5476
5477 /* calc exceed amount */ 5477 /* calc exceed amount */
5478 items_width = _calc_items_width(c); 5478 items_width = _calc_items_width(c);
@@ -5501,7 +5501,7 @@ _layout_par_ellipsis_items(Ctxt *c, double ellip)
5501 break; 5501 break;
5502 off += it->adv; 5502 off += it->adv;
5503 } 5503 }
5504 c->o->ellip_prev_it = i; 5504 c->ellip_prev_it = i;
5505 if (it) ellip_ti = _layout_ellipsis_item_new(c, it); 5505 if (it) ellip_ti = _layout_ellipsis_item_new(c, it);
5506 5506
5507 5507
@@ -5688,7 +5688,7 @@ _layout_par(Ctxt *c)
5688 ((it->type == EVAS_TEXTBLOCK_ITEM_TEXT) && !it->format->font.font)) 5688 ((it->type == EVAS_TEXTBLOCK_ITEM_TEXT) && !it->format->font.font))
5689 { 5689 {
5690 //one more chance for ellipsis special cases 5690 //one more chance for ellipsis special cases
5691 if (c->o->ellip_prev_it == i) 5691 if (c->ellip_prev_it == i)
5692 _layout_par_append_ellipsis(c); 5692 _layout_par_append_ellipsis(c);
5693 5693
5694 i = eina_list_next(i); 5694 i = eina_list_next(i);
@@ -6021,7 +6021,7 @@ _layout_par(Ctxt *c)
6021 } 6021 }
6022 } 6022 }
6023 if (!obs_info) c->x += it->adv; 6023 if (!obs_info) c->x += it->adv;
6024 if (c->o->ellip_prev_it == i) 6024 if (c->ellip_prev_it == i)
6025 _layout_par_append_ellipsis(c); 6025 _layout_par_append_ellipsis(c);
6026 i = eina_list_next(i); 6026 i = eina_list_next(i);
6027 item_preadv = EINA_FALSE; 6027 item_preadv = EINA_FALSE;
@@ -6651,6 +6651,7 @@ _layout_setup(Ctxt *c, const Eo *eo_obj, Evas_Coord w, Evas_Coord h)
6651 c->h = h; 6651 c->h = h;
6652 c->style_pad.r = c->style_pad.l = c->style_pad.t = c->style_pad.b = 0; 6652 c->style_pad.r = c->style_pad.l = c->style_pad.t = c->style_pad.b = 0;
6653 c->vertical_ellipsis = EINA_FALSE; 6653 c->vertical_ellipsis = EINA_FALSE;
6654 c->ellip_prev_it = NULL;
6654 6655
6655 /* Update all obstacles */ 6656 /* Update all obstacles */
6656 if (c->o->obstacle_changed || c->width_changed) 6657 if (c->o->obstacle_changed || c->width_changed)