Evas bidi: Add len parameter to evas_bidi_paragraph_props_get
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 13 Apr 2011 12:21:54 +0000 (12:21 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 13 Apr 2011 12:21:54 +0000 (12:21 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@58631 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_text.c
src/lib/canvas/evas_object_textblock.c
src/lib/engines/common/language/evas_bidi_utils.c
src/lib/engines/common/language/evas_bidi_utils.h

index b396345..bc26c60 100644 (file)
@@ -563,7 +563,7 @@ _evas_object_text_layout(Evas_Object *obj, Evas_Object_Text *o, const Eina_Unico
    int len = eina_unicode_strlen(text);
 #ifdef BIDI_SUPPORT
    evas_bidi_paragraph_props_unref(o->bidi_par_props);
-   o->bidi_par_props = evas_bidi_paragraph_props_get(text);
+   o->bidi_par_props = evas_bidi_paragraph_props_get(text, len);
    evas_bidi_props_reorder_line(NULL, 0, len, o->bidi_par_props, &v_to_l);
 #endif
    visual_pos = pos = 0;
index 191c33a..6b8ed68 100644 (file)
@@ -4721,7 +4721,8 @@ _evas_textblock_nodes_merge(Evas_Object_Textblock *o, Evas_Object_Textblock_Node
 #ifdef BIDI_SUPPORT
    evas_bidi_paragraph_props_unref(to->bidi_props);
    to->bidi_props = evas_bidi_paragraph_props_get(
-         eina_ustrbuf_string_get(to->unicode));
+         eina_ustrbuf_string_get(to->unicode),
+         eina_ustrbuf_length_get(to->unicode));
 #endif
 
    _evas_textblock_cursors_set_node(o, from, to);
@@ -6082,11 +6083,13 @@ _evas_textblock_cursor_break_paragraph(Evas_Textblock_Cursor *cur,
 #ifdef BIDI_SUPPORT
    evas_bidi_paragraph_props_unref(n->bidi_props);
    n->bidi_props = evas_bidi_paragraph_props_get(
-         eina_ustrbuf_string_get(n->unicode));
+         eina_ustrbuf_string_get(n->unicode),
+         eina_ustrbuf_length_get(n->unicode));
 
    evas_bidi_paragraph_props_unref(cur->node->bidi_props);
    cur->node->bidi_props = evas_bidi_paragraph_props_get(
-         eina_ustrbuf_string_get(cur->node->unicode));
+         eina_ustrbuf_string_get(cur->node->unicode),
+         eina_ustrbuf_length_get(cur->node->unicode));
 #endif
      }
    else
@@ -6278,7 +6281,9 @@ evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *_text)
      fnode->offset += len;
 #ifdef BIDI_SUPPORT
    evas_bidi_paragraph_props_unref(n->bidi_props);
-   n->bidi_props = evas_bidi_paragraph_props_get(eina_ustrbuf_string_get(n->unicode));
+   n->bidi_props = evas_bidi_paragraph_props_get(
+         eina_ustrbuf_string_get(n->unicode),
+         eina_ustrbuf_length_get(n->unicode));
 #endif
    _evas_textblock_changed(o, cur->obj);
    n->dirty = EINA_TRUE;
@@ -6453,7 +6458,8 @@ evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *form
 #ifdef BIDI_SUPPORT
              evas_bidi_paragraph_props_unref(cur->node->bidi_props);
              cur->node->bidi_props = evas_bidi_paragraph_props_get(
-                   eina_ustrbuf_string_get(cur->node->unicode));
+                   eina_ustrbuf_string_get(cur->node->unicode),
+                   eina_ustrbuf_length_get(cur->node->unicode));
 #endif
           }
      }
@@ -6542,7 +6548,9 @@ evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur)
      }
 #ifdef BIDI_SUPPORT
    evas_bidi_paragraph_props_unref(n->bidi_props);
-   n->bidi_props = evas_bidi_paragraph_props_get(eina_ustrbuf_string_get(n->unicode));
+   n->bidi_props = evas_bidi_paragraph_props_get(
+         eina_ustrbuf_string_get(n->unicode),
+         eina_ustrbuf_length_get(n->unicode));
 #endif
 
    if (cur->pos == eina_ustrbuf_length_get(n->unicode))
@@ -6645,7 +6653,8 @@ evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_C
 #ifdef BIDI_SUPPORT
    evas_bidi_paragraph_props_unref(n1->bidi_props);
    n1->bidi_props = evas_bidi_paragraph_props_get(
-         eina_ustrbuf_string_get(n1->unicode));
+         eina_ustrbuf_string_get(n1->unicode),
+         eina_ustrbuf_length_get(n1->unicode));
 #endif
 
    evas_textblock_cursor_copy(cur1, cur2);
index 52964a4..71c6a94 100644 (file)
@@ -155,14 +155,13 @@ evas_bidi_shape_string(Eina_Unicode *eina_ustr, const Evas_BiDi_Paragraph_Props
  */
 
 Evas_BiDi_Paragraph_Props *
-evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr)
+evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len)
 {
    Evas_BiDi_Paragraph_Props *bidi_props = NULL;
    EvasBiDiCharType *char_types = NULL;
    EvasBiDiLevel *embedding_levels = NULL;
    const FriBidiChar *ustr;
    FriBidiChar *base_ustr = NULL;
-   size_t len;
 
    if (!eina_ustr)
       return NULL;
index 971c2c4..be32d22 100644 (file)
@@ -120,7 +120,7 @@ Eina_Bool
 evas_bidi_props_reorder_line(Eina_Unicode *eina_ustr, size_t start, size_t len, const Evas_BiDi_Paragraph_Props *props, EvasBiDiStrIndex **_v_to_l);
 
 Evas_BiDi_Paragraph_Props *
-evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr) EINA_ARG_NONNULL(1) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
+evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len) EINA_ARG_NONNULL(1) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
 
 void
 evas_bidi_props_copy_and_ref(const Evas_BiDi_Props *src, Evas_BiDi_Props *dst);