summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_object_textblock.c
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2019-07-29 14:00:04 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-07-29 14:09:32 +0200
commit0bab8be791b7454f19d6b813fb005cd78333bd67 (patch)
tree3d08e5b25500f8e7b646c7f38991cc0acaec9aa2 /src/lib/evas/canvas/evas_object_textblock.c
parent444a068c05f772a1c01cd965c8ed1e0c5035eabb (diff)
evas_textblock: markup: handle invalid/missing escape characters
Summary: T8088 if escape character sequence not found for example **&123;** : * (Old Behaviour) : Draw nothing * (New Behaviour) : Draw Text like it plain text I think this is the right behaviour since: 1- We print output as it is, so user can detect what was the problem. For example user write &gf; (by mistake, he wanted to write &gt;) == if we nothing is printed he would not know exactly where is the real problem. it can be font file, textblock is not visible, he may think bug in efl == if we printed &gf; as it is, it will direclty show that this is not valid escape char. 2- If user made mistake in text, it is better to show it instead of hide it, maybe there are new sequences that we do not know about. This behaviour was checked on multible systems: 1- Web Browsers like chrome 2- Qt 3- Android They all have same as our new behaviour Example : markup text = "&gt;&gf; Old : > New : >&gf; Test Plan: ``` #define EFL_EO_API_SUPPORT 1 #define EFL_BETA_API_SUPPORT 1 #include <Eina.h> #include <Elementary.h> #include <Efl_Ui.h> static void _gui_quit_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED) { efl_exit(0); } static void _gui_setup() { Eo *win, *box; win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Hello World"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); // when the user clicks "close" on a window there is a request to delete efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _gui_quit_cb, NULL); box = efl_add(EFL_UI_BOX_CLASS, win, efl_content_set(win, efl_added), efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(360, 240))); efl_add(EFL_UI_TEXT_CLASS, box, efl_text_markup_set(efl_added, "&gt;&gf;"), efl_text_interactive_selection_allowed_set(efl_added, EINA_FALSE), efl_gfx_hint_weight_set(efl_added, 1.0, 0.9), efl_gfx_hint_align_set(efl_added, 0.5, 0.5), efl_text_multiline_set(efl_added,EINA_FALSE), efl_pack(box, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Quit"), efl_gfx_hint_weight_set(efl_added, 1.0, 0.1), efl_pack(box, efl_added), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _gui_quit_cb, efl_added)); } EAPI_MAIN void efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { _gui_setup(); } EFL_MAIN() ``` Reviewers: woohyun, bowonryu, segfaultxavi, bu5hm4n Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9428
Diffstat (limited to 'src/lib/evas/canvas/evas_object_textblock.c')
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 2210c95..510f6ce 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -7931,6 +7931,8 @@ _prepend_escaped_char(Efl_Text_Cursor_Cursor *cur_obj, const char *s,
7931 escape = _escaped_char_get(s, s_end); 7931 escape = _escaped_char_get(s, s_end);
7932 if (escape) 7932 if (escape)
7933 evas_textblock_cursor_text_prepend(cur_obj, escape); 7933 evas_textblock_cursor_text_prepend(cur_obj, escape);
7934 else /* Use same text input if no escape was found */
7935 _prepend_text_run(cur_obj, s, s_end);
7934} 7936}
7935 7937
7936 7938