elm_entry: if cnp mode is PLAINTEXT, & do not get pasted

Summary:
if cnp mode is PLAINTEXT mode, & do not get pasted issue fix and
conversion(markup to utf8) should happen only for PLAINTEXT mode

Test Plan:
Set PLAINTEXT cnp mode to entry and paste text consisting
of &

Reviewers: thiepha, herdsman

Subscribers: cedric, govi, rajeshps, jpeg

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D5470
This commit is contained in:
Shilpa Singh 2017-12-11 11:44:15 +09:00 committed by Thiep Ha
parent b8b183bfcb
commit 9128b9001f
2 changed files with 10 additions and 10 deletions

View File

@ -700,11 +700,7 @@ _selection_data_cb(void *data EINA_UNUSED,
snprintf(entry_tag, len + 1, tag_string, buf);
_edje_entry_user_insert(obj, entry_tag);
}
else if (sel_data->format & ELM_SEL_FORMAT_MARKUP)
{
_edje_entry_user_insert(obj, buf);
}
else
else if (sd->cnp_mode == ELM_CNP_MODE_PLAINTEXT)
{
Efl_Text_Cursor_Cursor *cur, *start, *end;
efl_ui_text_interactive_selection_cursors_get(obj, &start, &end);
@ -715,6 +711,10 @@ _selection_data_cb(void *data EINA_UNUSED,
cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
efl_text_cursor_text_insert(obj, cur, buf);
}
else
{
_edje_entry_user_insert(obj, buf);
}
free(buf);
return EINA_TRUE;

View File

@ -700,11 +700,7 @@ _selection_data_cb(void *data EINA_UNUSED,
snprintf(entry_tag, len + 1, tag_string, buf);
_edje_entry_user_insert(obj, entry_tag);
}
else if (sel_data->format & ELM_SEL_FORMAT_MARKUP)
{
_edje_entry_user_insert(obj, buf);
}
else
else if (sd->cnp_mode == ELM_CNP_MODE_PLAINTEXT)
{
char *txt = _elm_util_text_to_mkup(buf);
if (txt)
@ -717,6 +713,10 @@ _selection_data_cb(void *data EINA_UNUSED,
ERR("Failed to convert text to markup text!");
}
}
else
{
_edje_entry_user_insert(obj, buf);
}
free(buf);
return EINA_TRUE;