[evolution/gnome-3-22] Cannot switch the list type when it has just one level
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-22] Cannot switch the list type when it has just one level
- Date: Thu, 22 Sep 2016 09:29:56 +0000 (UTC)
commit 42f3d73ad1af40328de55544a69af2963b72568a
Author: Tomas Popela <tpopela redhat com>
Date: Thu Sep 22 11:24:28 2016 +0200
Cannot switch the list type when it has just one level
Remove the original list after we insert a newly created one, otherwise
the newly created one won't be added to the DOM.
e-util/test-html-editor-units.c | 13 +++++++++++++
.../web-extension/e-editor-dom-functions.c | 3 +--
2 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/e-util/test-html-editor-units.c b/e-util/test-html-editor-units.c
index 9d53db5..1371c27 100644
--- a/e-util/test-html-editor-units.c
+++ b/e-util/test-html-editor-units.c
@@ -526,6 +526,18 @@ test_list_bullet_html (TestFixture *fixture)
}
static void
+test_list_bullet_change (TestFixture *fixture)
+{
+ if (!test_utils_run_simple_test (fixture,
+ "mode:plain\n"
+ "action:style-list-bullet\n"
+ "action:style-list-number\n",
+ NULL,
+ " 1. "))
+ g_test_fail ();
+}
+
+static void
test_list_bullet_html_from_block (TestFixture *fixture)
{
if (!test_utils_run_simple_test (fixture,
@@ -2643,6 +2655,7 @@ main (gint argc,
test_utils_add_test ("/font/color/typed", test_font_color_typed);
test_utils_add_test ("/list/bullet/plain", test_list_bullet_plain);
test_utils_add_test ("/list/bullet/html", test_list_bullet_html);
+ test_utils_add_test ("/list/bullet/change", test_list_bullet_change);
test_utils_add_test ("/list/bullet/html/from-block", test_list_bullet_html_from_block);
test_utils_add_test ("/list/alpha/html", test_list_alpha_html);
test_utils_add_test ("/list/alpha/plain", test_list_alpha_plain);
diff --git a/modules/webkit-editor/web-extension/e-editor-dom-functions.c
b/modules/webkit-editor/web-extension/e-editor-dom-functions.c
index 69cb4e4..3801b12 100644
--- a/modules/webkit-editor/web-extension/e-editor-dom-functions.c
+++ b/modules/webkit-editor/web-extension/e-editor-dom-functions.c
@@ -16714,7 +16714,6 @@ format_change_list_from_list (EEditorPage *editor_page,
if (selection_end) {
source_list_clone = webkit_dom_node_clone_node_with_error (current_list, FALSE, NULL);
- remove_node_if_empty (current_list);
after_selection_end = TRUE;
}
@@ -16752,8 +16751,8 @@ format_change_list_from_list (EEditorPage *editor_page,
NULL);
remove_node_if_empty (source_list);
-
remove_node_if_empty (source_list_clone);
+ remove_node_if_empty (current_list);
merge_lists_if_possible (WEBKIT_DOM_NODE (new_list));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]