forked from enlightenment/efl
efl - edje entry - dont emit changed on markup set unless text changed
if the text didnt actually change we generat a lot of noise in changed signals for no change at all in text. shortcut this and check the new and old text and compare ptrs, 0 length and strings etc. this fixes T4045 @fix
This commit is contained in:
parent
94af40b3b6
commit
dd584b9f79
|
@ -3112,11 +3112,22 @@ void
|
|||
_edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text)
|
||||
{
|
||||
Entry *en;
|
||||
const char *ptext;
|
||||
|
||||
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
||||
(!rp->typedata.text)) return;
|
||||
en = rp->typedata.text->entry_data;
|
||||
if (!en) return;
|
||||
ptext = evas_object_textblock_text_markup_get(rp->object);
|
||||
// some simple "do nothing if the text is the same" logic
|
||||
if (ptext == text) return;
|
||||
// if prev and cur is empty
|
||||
if (!ptext) ptext = "";
|
||||
if (!text) text = "";
|
||||
if ((!ptext[0]) && (!text[0])) return;
|
||||
// same content
|
||||
if (!strcmp(ptext, text)) return;
|
||||
|
||||
_edje_entry_imf_context_reset(rp);
|
||||
// set text as markup
|
||||
_sel_clear(en->ed, en->cursor, rp->object, en);
|
||||
|
|
Loading…
Reference in New Issue