fix insert from code to replace selection

SVN revision: 36723
This commit is contained in:
Carsten Haitzler 2008-10-16 14:22:19 +00:00
parent 0bc5d8fa1f
commit bb20ba07b4
1 changed files with 4 additions and 0 deletions

View File

@ -826,6 +826,7 @@ _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text)
Entry *en = rp->entry_data;
if (!en) return;
// set text as markup
_sel_clear(en->cursor, rp->object, en);
evas_object_textblock_text_markup_set(rp->object, text);
evas_textblock_cursor_node_last(en->cursor);
if ((!evas_textblock_cursor_node_format_get(en->cursor)) ||
@ -842,7 +843,10 @@ _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text)
Entry *en = rp->entry_data;
if (!en) return;
// prepend markup @ cursor pos
if (en->have_selection)
evas_textblock_cursor_range_delete(en->sel_start, en->sel_end);
evas_object_textblock_text_markup_prepend(en->cursor, text);
_sel_clear(en->cursor, rp->object, en);
_curs_update_from_curs(en->cursor, rp->object, en);
_edje_emit(rp->edje, "entry,changed", rp->part->name);
}