Evas textblock: Fixed a selection issue.

The issue happens when selecting in strings that have both bidi and different
scripts in the same bidi run. E.g: "עבריתenglishрусскийעברית".

SVN revision: 83786
This commit is contained in:
Tom Hacohen 2013-02-08 15:31:25 +00:00
parent dbaf2b8fde
commit 548e548632
4 changed files with 32 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2013-02-08 Tom Hacohen (TAsn)
* Evas textblock: Fixed a selection issue with different scripts and
bidi.
2013-02-08 Guillaume Friloux
* Fix usage of Ecore_Con_Server's internal buffer.
@ -38,7 +43,6 @@
* ecore_wayland: Add ecore_wl_globals_get
2013-02-04 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
* evas: Stop initializing and shutting Fontconfig down
2013-02-04 Cedric Bail

1
NEWS
View File

@ -158,3 +158,4 @@ Fixes:
* Fix memleak in Eina_File.
* Fix ecore_x_screen_is_composited/set() to work on multihead.
* Fix memory usage of Ecore_Con_Server
* Evas textblock: Fixed a selection issue with different scripts and bidi.

View File

@ -9574,7 +9574,10 @@ _evas_textblock_cursor_range_in_line_geometry_get(
while (it && (it != it2))
{
max_x = it->x + it->adv;
if ((start <= it->text_pos) && (it->text_pos <= end))
{
max_x = it->x + it->adv;
}
it = (Evas_Object_Textblock_Item *) EINA_INLIST_GET(it)->next;
}
if (min_x != max_x)

View File

@ -1381,6 +1381,11 @@ START_TEST(evas_textblock_geometries)
fail_if((tr->x != tr2->x) || (tr->y != tr2->y) || (tr->w != tr2->w) ||
(tr->h != tr2->h));
EINA_LIST_FREE(rects, tr)
free(tr);
EINA_LIST_FREE(rects2, tr2)
free(tr2);
/* Multiline range */
evas_textblock_cursor_pos_set(cur, 0);
evas_textblock_cursor_pos_set(main_cur, 14);
@ -1414,6 +1419,23 @@ START_TEST(evas_textblock_geometries)
tr2 = eina_list_data_get(eina_list_next(rects));
fail_if(tr->y >= tr2->y);
EINA_LIST_FREE(rects, tr)
free(tr);
EINA_LIST_FREE(rects2, tr2)
free(tr2);
/* Same run different scripts */
evas_object_textblock_text_markup_set(tb, "עבריתenglishрусскийעברית");
evas_textblock_cursor_pos_set(cur, 3);
evas_textblock_cursor_pos_set(main_cur, 7);
rects = evas_textblock_cursor_range_geometry_get(cur, main_cur);
fail_if(eina_list_count(rects) != 2);
EINA_LIST_FREE(rects, tr)
free(tr);
END_TB_TEST();
}
END_TEST