Good catch. :)

Annoying that I missed that one. We need more tests!

--
Tom.

On 20/08/14 04:05, Carsten Haitzler wrote:
> raster pushed a commit to branch master.
>
> http://git.enlightenment.org/core/efl.git/commit/?id=9a91261a4eb2b9868cec1efd89426c1b4d9e8554
>
> commit 9a91261a4eb2b9868cec1efd89426c1b4d9e8554
> Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
> Date:   Wed Aug 20 12:03:14 2014 +0900
>
>      Revert "evas textblock: fixed ellipsis character cut off issue with 
> complex markup text."
>
>      This reverts commit d408408283dd4ece9023d792753fd63422b80cb1.
>
>      this breaks mult-line "long" filenames in efm. 2nd line is just ...
>      for almost all of them (ones that are actually in need of 3 or more
>      lines). break break! REVERT!
> ---
>   src/lib/evas/canvas/evas_object_textblock.c | 71 
> ++++++-----------------------
>   src/tests/evas/evas_test_textblock.c        | 23 ----------
>   2 files changed, 13 insertions(+), 81 deletions(-)
>
> diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
> b/src/lib/evas/canvas/evas_object_textblock.c
> index 9f14cb5..fb59cee 100644
> --- a/src/lib/evas/canvas/evas_object_textblock.c
> +++ b/src/lib/evas/canvas/evas_object_textblock.c
> @@ -4373,7 +4373,7 @@ _layout_ellipsis_item_new(Ctxt *c, const 
> Evas_Object_Textblock_Item *cur_it)
>   static inline void
>   _layout_handle_ellipsis(Ctxt *c, Evas_Object_Textblock_Item *it, Eina_List 
> *i)
>   {
> -   Evas_Object_Textblock_Text_Item *ti, *ellip_ti;
> +   Evas_Object_Textblock_Text_Item *ellip_ti;
>      Evas_Object_Textblock_Item *last_it;
>      Evas_Coord save_cx;
>      int wrap;
> @@ -4383,70 +4383,25 @@ _layout_handle_ellipsis(Ctxt *c, 
> Evas_Object_Textblock_Item *it, Eina_List *i)
>      save_cx = c->x;
>      c->w -= ellip_ti->parent.w;
>
> -   /* If there is no enough space for ellipsis item, remove all of items */
> -   if (c->w <= 0)
> -     {
> -        while (c->ln->items)
> -          {
> -             last_it = _ITEM(EINA_INLIST_GET(c->ln->items)->last);
> -             c->ln->items = _ITEM(eina_inlist_remove(
> -                   EINA_INLIST_GET(c->ln->items),
> -                   EINA_INLIST_GET(last_it)));
> -          }
> -        last_it = NULL;
> -     }
> -
> -   while (last_it)
> +   if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT)
>        {
> -        if (last_it->type == EVAS_TEXTBLOCK_ITEM_TEXT)
> -          {
> -             ti = _ITEM_TEXT(last_it);
> -
> -             wrap = _layout_text_cutoff_get(c, last_it->format, ti);
> -
> -             if ((wrap > 0) && !IS_AT_END(ti, (size_t) wrap))
> -               {
> -                  _layout_item_text_split_strip_white(c, ti, i, wrap);
> -               }
> -             else if (wrap < 0)
> -               {
> -                  break;
> -               }
> -          }
> -        else
> -          {
> -             /* We will ignore format items. ex) tab
> -              * But, if there is <item> tag and size is acceptable, we have 
> to insert it to line. */
> -             if (!strncmp(_ITEM_FORMAT(last_it)->item, "item", 4) &&
> -                 (c->w - c->o->style_pad.l - c->o->style_pad.r - c->marginl 
> - c->marginr >= c->x + last_it->adv))
> -               {
> -                  break;
> -               }
> -          }
> +        Evas_Object_Textblock_Text_Item *ti = _ITEM_TEXT(it);
>
> -        if (c->ln->items && last_it != it)
> +        wrap = _layout_text_cutoff_get(c, last_it->format, ti);
> +        if ((wrap > 0) && !IS_AT_END(ti, (size_t) wrap))
>             {
> -             c->ln->items = _ITEM(eina_inlist_remove(
> -                   EINA_INLIST_GET(c->ln->items),
> -                   EINA_INLIST_GET(last_it)));
> +             _layout_item_text_split_strip_white(c, ti, i, wrap);
>             }
> -
> -        last_it = (c->ln->items) ? 
> _ITEM(EINA_INLIST_GET(c->ln->items)->last) : NULL;
> -
> -        if (last_it)
> +        else if ((wrap == 0) && (c->ln->items))
>             {
> -             /* We need to renew ellipsis item.
> -              * Because, base format is changed to last_it.
> -              * We can't reuse it. */
> -             c->w += ellip_ti->parent.w;
> -             ellip_ti = _layout_ellipsis_item_new(c, last_it);
> -             c->w -= ellip_ti->parent.w;
> -             c->x -= last_it->adv;
> -             if (c->x < 0)
> -               c->x = 0;
> -             save_cx = c->x;
> +             last_it = _ITEM(EINA_INLIST_GET(c->ln->items)->last);
>             }
>        }
> +   else if (it->type == EVAS_TEXTBLOCK_ITEM_FORMAT)
> +     {
> +        /* We don't want to add this format item. */
> +        last_it = NULL;
> +     }
>
>      c->x = save_cx;
>      c->w += ellip_ti->parent.w;
> diff --git a/src/tests/evas/evas_test_textblock.c 
> b/src/tests/evas/evas_test_textblock.c
> index 13462e3..78d83ef 100644
> --- a/src/tests/evas/evas_test_textblock.c
> +++ b/src/tests/evas/evas_test_textblock.c
> @@ -1574,7 +1574,6 @@ END_TEST
>   START_TEST(evas_textblock_wrapping)
>   {
>      Evas_Coord bw, bh, w, h, nw, nh;
> -   Evas_Coord ellip_w, ellip_h;
>      int i;
>      START_TB_TEST();
>      evas_object_textblock_text_markup_set(tb, "a");
> @@ -1760,28 +1759,6 @@ START_TEST(evas_textblock_wrapping)
>      evas_object_textblock_size_formatted_get(tb, &w, &h);
>      ck_assert_int_le(w, (nw / 2));
>
> -   evas_object_textblock_text_markup_set(tb, "a<b>b</b>a<b>b</b>a<b>b</b>");
> -   evas_textblock_cursor_format_prepend(cur, "+ font_size=50 ellipsis=1.0");
> -   evas_object_textblock_size_native_get(tb, &nw, &nh);
> -   evas_object_resize(tb, nw / 2, nh * 2);
> -   evas_object_textblock_size_formatted_get(tb, &w, &h);
> -   ck_assert_int_le(w, (nw / 2));
> -
> -   evas_object_textblock_text_markup_set(tb, "<item absize=100x100 
> href=item1></item><item absize=100x100 href=item2></item>");
> -   evas_textblock_cursor_format_prepend(cur, "+ ellipsis=1.0");
> -   evas_object_resize(tb, 101, 100);
> -   evas_object_textblock_size_formatted_get(tb, &w, &h);
> -   ck_assert_int_le(w, 100);
> -
> -   evas_object_textblock_text_markup_set(tb, "…");
> -   evas_object_textblock_size_native_get(tb, &ellip_w, &ellip_h);
> -   evas_object_textblock_text_markup_set(tb, "ab");
> -   evas_textblock_cursor_format_prepend(cur, "+ ellipsis=1.0");
> -   evas_object_textblock_size_native_get(tb, &nw, &nh);
> -   evas_object_resize(tb, nw / 2, nh * 2);
> -   evas_object_textblock_size_formatted_get(tb, &w, &h);
> -   ck_assert_int_le(w, ellip_w);
> -
>      {
>         double ellip;
>         for(ellip = 0.0; ellip <= 1.0; ellip = ellip + 0.1)
>




------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to