diff options
author | Tom Hacohen <tom@stosb.com> | 2014-12-15 11:58:30 +0000 |
---|---|---|
committer | Tom Hacohen <tom@stosb.com> | 2015-01-14 08:45:41 +0000 |
commit | 62d1ab87cf35f624d30df59b3635b25b41fa0af6 (patch) | |
tree | 95a9ed4eb21dadcf4cd0acde610d58495af6b606 | |
parent | 31290bf1aeaa0b9fb3b5d111da8a17e5a09c8b94 (diff) | |
download | efl-62d1ab87cf35f624d30df59b3635b25b41fa0af6.tar.gz |
Fix deletion of PS.
-rw-r--r-- | src/lib/evas/canvas/evas_textblock2.c | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/src/lib/evas/canvas/evas_textblock2.c b/src/lib/evas/canvas/evas_textblock2.c index e0207405ed..a2f757ddf4 100644 --- a/src/lib/evas/canvas/evas_textblock2.c +++ b/src/lib/evas/canvas/evas_textblock2.c @@ -3941,38 +3941,25 @@ _evas_textblock2_efl_text_text_get(Eo *obj, Evas_Textblock2_Data *pd) EAPI void evas_textblock2_cursor_char_delete(Evas_Textblock2_Cursor *cur) { - Evas_Object_Textblock2_Node_Text *n, *n2; + Evas_Object_Textblock2_Node_Text *n; const Eina_Unicode *text; - int chr, ind, ppos; + int ind, ppos; if (!cur || !cur->node) return; Evas_Textblock2_Data *o = eo_data_scope_get(cur->obj, MY_CLASS); n = cur->node; text = eina_ustrbuf_string_get(n->unicode); - ind = cur->pos; - if (text[ind]) - chr = text[ind++]; - else - chr = 0; + ppos = ind = cur->pos; - if (chr == 0) return; - ppos = cur->pos; - eina_ustrbuf_remove(n->unicode, cur->pos, ind); - - if (chr == _PARAGRAPH_SEPARATOR) + if (text[ind]) { - _evas_textblock2_cursor_nodes_merge(cur); + ind++; + eina_ustrbuf_remove(n->unicode, cur->pos, ind); } - - if (cur->pos == eina_ustrbuf_length_get(n->unicode)) + else { - n2 = _NODE_TEXT(EINA_INLIST_GET(n)->next); - if (n2) - { - cur->node = n2; - cur->pos = 0; - } + _evas_textblock2_cursor_nodes_merge(cur); } _evas_textblock2_cursors_update_offset(cur, n, ppos, -(ind - ppos)); |