forked from enlightenment/efl
efl.ui.textbox: fix crash when toggle scroll mode
Reviewers: eagleeye, bu5hm4n, cedric, woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10924
This commit is contained in:
parent
cf37047a7c
commit
7c71dc4e2d
|
@ -2451,7 +2451,10 @@ _efl_ui_textbox_scrollable_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Ein
|
|||
}
|
||||
else
|
||||
{
|
||||
efl_content_set(sd->scroller, NULL);
|
||||
/* sd->text_table should not be deleted, so we need to use content_unset
|
||||
* instead of efl_content_set(sd->scroller, NULL)
|
||||
*/
|
||||
efl_content_unset(sd->scroller);
|
||||
edje_object_part_swallow(sd->entry_edje, "efl.text", sd->text_table);
|
||||
efl_del(sd->scroller);
|
||||
sd->scroller = NULL;
|
||||
|
|
|
@ -132,10 +132,32 @@ EFL_START_TEST(text_user_change)
|
|||
}
|
||||
EFL_END_TEST
|
||||
|
||||
EFL_START_TEST(text_scroll_mode)
|
||||
{
|
||||
Eo *txt, *win, *cur;
|
||||
win = win_add();
|
||||
txt = efl_add(EFL_UI_TEXTBOX_CLASS, win);
|
||||
cur = efl_text_interactive_main_cursor_get(txt);
|
||||
efl_text_set(txt, "Hello");
|
||||
/*scroll mode is false by default*/
|
||||
fail_if(efl_ui_textbox_scrollable_get(txt));
|
||||
efl_ui_textbox_scrollable_set(txt, !efl_ui_textbox_scrollable_get(txt));
|
||||
efl_text_cursor_text_insert(cur, "World");
|
||||
fail_if(!efl_ui_textbox_scrollable_get(txt));
|
||||
efl_ui_textbox_scrollable_set(txt, !efl_ui_textbox_scrollable_get(txt));
|
||||
efl_text_cursor_text_insert(cur, "!!!");
|
||||
|
||||
ck_assert_str_eq(efl_text_get(txt),"HelloWorld!!!");
|
||||
efl_del(txt);
|
||||
efl_del(win);
|
||||
}
|
||||
EFL_END_TEST
|
||||
|
||||
void efl_ui_test_text(TCase *tc)
|
||||
{
|
||||
tcase_add_test(tc, text_cnp);
|
||||
tcase_add_test(tc, text_all_select_all_unselect);
|
||||
tcase_add_test(tc, text_selection);
|
||||
tcase_add_test(tc, text_user_change);
|
||||
tcase_add_test(tc, text_scroll_mode);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue