Evas text props: Fixed bug with no-harfbuzz bidi.
authorTom Hacohen <tom@stosb.com>
Tue, 15 Jan 2013 14:49:31 +0000 (14:49 +0000)
committerTom Hacohen <tom@stosb.com>
Tue, 15 Jan 2013 14:49:31 +0000 (14:49 +0000)
SVN revision: 82814

ChangeLog
NEWS
src/lib/evas/common/evas_text_utils.c

index dcbafe9..d8997eb 100644 (file)
--- 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 5e94137..71325bd 100644 (file)
--- 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.
index 7dc9485..bad68b2 100644 (file)
@@ -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)