thiep pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9128b9001fec4cbf4e70841f4af8d105d79cd62e

commit 9128b9001fec4cbf4e70841f4af8d105d79cd62e
Author: Shilpa Singh <[email protected]>
Date:   Mon Dec 11 11:44:15 2017 +0900

    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
---
 src/lib/elementary/efl_ui_text.c | 10 +++++-----
 src/lib/elementary/elm_entry.c   | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index 6224676333..6077a1f810 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -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;
diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c
index b48c4a9020..854f234029 100644
--- a/src/lib/elementary/elm_entry.c
+++ b/src/lib/elementary/elm_entry.c
@@ -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;

-- 


Reply via email to