Entry: Fix behaviour of markup filters when setting entry text.

The issue was introduced in 28e6878f7cce36efae1438b5e032eb9c0878016a.
While this is a fix in the sense that it reverts to the previously
defined behaviour (defined both in docs and code), the previous
behaviour was stupid and inconsistent. So now we are back to stupid and
inconsistent.

I can't fix this further, because unfortunately, the fix requires
intrusive changes that are just too dangerous to make this late in the
release cycle. Luckily for us, the issues only surface in a very
specific case that is quite uncommon. In order to trigger the bug you
need to set a very long piece of text on an entry that has text filters
set.

Fixes T2561

@fix
This commit is contained in:
Tom Hacohen 2015-07-13 17:38:45 +01:00
parent a2704f98bc
commit f3be634e87
1 changed files with 11 additions and 6 deletions

View File

@ -2875,7 +2875,7 @@ _elm_entry_elm_container_content_unset(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED,
}
static void
_entry_text_append(Evas_Object* obj, const char* entry)
_entry_text_append(Evas_Object* obj, const char* entry, Eina_Bool set)
{
int len = 0;
if (!entry) return;
@ -2913,9 +2913,14 @@ _entry_text_append(Evas_Object* obj, const char* entry)
}
else
{
/* For the case of text set, append will have similar behaviour
* as entry text is cleared first */
edje_object_part_text_append(sd->entry_edje, "elm.text", entry);
if (set)
{
edje_object_part_text_set(sd->entry_edje, "elm.text", entry);
}
else
{
edje_object_part_text_append(sd->entry_edje, "elm.text", entry);
}
eo_do(obj, eo_event_callback_call(ELM_ENTRY_EVENT_TEXT_SET_DONE, NULL));
}
}
@ -2958,7 +2963,7 @@ _elm_entry_elm_layout_text_set(Eo *obj, Elm_Entry_Data *sd, const char *part, co
/* Need to clear the entry first */
edje_object_part_text_set(sd->entry_edje, "elm.text", "");
_entry_text_append(obj, entry);
_entry_text_append(obj, entry, EINA_TRUE);
if (len > 0)
_elm_entry_guide_update(obj, EINA_TRUE);
@ -3863,7 +3868,7 @@ _elm_entry_entry_append(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, const char *ent
if (!entry) entry = "";
sd->changed = EINA_TRUE;
_entry_text_append(obj, entry);
_entry_text_append(obj, entry, EINA_FALSE);
}
EOLIAN static Eina_Bool