raster pushed a commit to branch master.

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

commit c490c711196e551973ae8dbb57a0588da5b3ccd6
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Thu Nov 8 17:12:35 2018 +0000

    efl ui text - stop being brain damaged with cnp mode
    
    cnp mode type was a mess. thankfully it was a bit simpler than it
    seemed. cleaned up code to deal with it sanely and keep it a single
    type  as intended byt he api too.
---
 src/lib/elementary/efl_ui_text.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index ece5d39830..9825e98eb6 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -86,7 +86,7 @@ struct _Efl_Ui_Text_Data
         const char  *hover_style; /**< style of a hover object */
      } anchor_hover;
 
-   Elm_Cnp_Mode                          cnp_mode;
+   Elm_Sel_Format                        cnp_mode;
    Elm_Sel_Format                        drop_format;
 
    struct {
@@ -1989,7 +1989,7 @@ _efl_ui_text_efl_object_constructor(Eo *obj, 
Efl_Ui_Text_Data *sd)
    efl_composite_attach(obj, text_obj);
 
    sd->entry_edje = wd->resize_obj;
-   sd->cnp_mode = ELM_CNP_MODE_PLAINTEXT;
+   sd->cnp_mode = EFL_SELECTION_FORMAT_TEXT;
    sd->line_wrap = ELM_WRAP_WORD;
    sd->context_menu = EINA_TRUE;
    sd->auto_save = EINA_TRUE;
@@ -2394,10 +2394,7 @@ _efl_ui_text_efl_file_file_get(const Eo *obj 
EINA_UNUSED, Efl_Ui_Text_Data *sd,
 EOLIAN static void
 _efl_ui_text_cnp_mode_set(Eo *obj, Efl_Ui_Text_Data *sd, Efl_Selection_Format 
cnp_mode)
 {
-   /* FIXME: CnP format handling really odd... */
-
    Elm_Sel_Format dnd_format = EFL_SELECTION_FORMAT_MARKUP;
-   Elm_Sel_Format cnp_format = cnp_mode;
 
    if (cnp_mode != EFL_SELECTION_FORMAT_TARGETS)
      {
@@ -2409,8 +2406,8 @@ _efl_ui_text_cnp_mode_set(Eo *obj, Efl_Ui_Text_Data *sd, 
Efl_Selection_Format cn
         cnp_mode &= ~EFL_SELECTION_FORMAT_HTML;
      }
 
-   if (sd->cnp_mode == cnp_format) return;
-   sd->cnp_mode = cnp_format;
+   if (sd->cnp_mode == cnp_mode) return;
+   sd->cnp_mode = cnp_mode;
    if (sd->cnp_mode == EFL_SELECTION_FORMAT_TEXT)
      dnd_format = EFL_SELECTION_FORMAT_TEXT;
    else if (cnp_mode == EFL_SELECTION_FORMAT_IMAGE)

-- 


Reply via email to