Evas textblock: Set cursor position if not already set when inserting text.
authorTom Hacohen <tom@stosb.com>
Sun, 15 May 2011 15:36:04 +0000 (15:36 +0000)
committerTom Hacohen <tom@stosb.com>
Sun, 15 May 2011 15:36:04 +0000 (15:36 +0000)
This was always the meaning of cur->node=NULL, but here it explicitly
does it, which makes things easier in the long run.

SVN revision: 59406

legacy/evas/src/lib/canvas/evas_object_textblock.c

index 4102ce2d91dfdc6d7aa09f6e7192663b13fc7d5b..fc1eff758f33f6e5a3ccbc6aa349279fc129e381 100644 (file)
@@ -6489,6 +6489,9 @@ evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *_text)
    _evas_textblock_changed(o, cur->obj);
    n->dirty = EINA_TRUE;
    free(text);
+
+   if (!o->cursor->node)
+      o->cursor->node = o->text_nodes;
    return len;
 }
 
@@ -6692,6 +6695,8 @@ evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *form
 
    _evas_textblock_changed(o, cur->obj);
 
+   if (!o->cursor->node)
+      o->cursor->node = o->text_nodes;
    return is_visible;
 }