From c7dc78c98b606947917a3869974cfabd70612c10 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 15 Jan 2013 14:49:31 +0000 Subject: [PATCH] Evas text props: Fixed bug with no-harfbuzz bidi. SVN revision: 82814 --- ChangeLog | 1 + NEWS | 1 + src/lib/evas/common/evas_text_utils.c | 14 ++++++++------ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index dcbafe9fff..d8997ebdb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * Evas textblock: Fixed issue and simplified cursor_geometry_get. * Evas text: Fixed issue with horiz advance. + * Evas text utils: Fixed issue with no-harfbuzz bidi. 2013-01-14 Daniel Willmann diff --git a/NEWS b/NEWS index 5e941372bb..71325bdcee 100644 --- a/NEWS +++ b/NEWS @@ -115,3 +115,4 @@ Fixes: * Fix SIGFPE in evas map update if image is 0. * Evas textblock: Fixed issue and simplified cursor_geometry_get. * Evas text: Fixed issue with horiz advance. + * Evas text utils: Fixed issue with no-harfbuzz bidi. diff --git a/src/lib/evas/common/evas_text_utils.c b/src/lib/evas/common/evas_text_utils.c index 7dc9485378..bad68b20bb 100644 --- a/src/lib/evas/common/evas_text_utils.c +++ b/src/lib/evas/common/evas_text_utils.c @@ -234,8 +234,14 @@ evas_common_text_props_index_find(const Evas_Text_Props *props, int _cutoff) return mid; #else - return _cutoff; - (void) props; + if (props->bidi_dir == EVAS_BIDI_DIRECTION_RTL) + { + return props->len - _cutoff - 1; + } + else + { + return _cutoff; + } #endif } @@ -249,7 +255,6 @@ evas_common_text_props_split(Evas_Text_Props *base, size_t cutoff; /* Translate text cutoff pos to string object cutoff point */ -#ifdef OT_SUPPORT _cutoff = evas_common_text_props_index_find(base, _cutoff); if (_cutoff >= 0) @@ -261,9 +266,6 @@ evas_common_text_props_split(Evas_Text_Props *base, ERR("Couldn't find the cutoff position. Is it inside a cluster?"); return EINA_FALSE; } -#else - cutoff = (size_t) _cutoff; -#endif evas_common_text_props_content_copy_and_ref(ext, base); if (base->bidi_dir == EVAS_BIDI_DIRECTION_RTL) -- 2.34.1