[evolution] Cannot change order list to unordered for the first time
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Cannot change order list to unordered for the first time
- Date: Wed, 30 Mar 2016 12:42:50 +0000 (UTC)
commit 586419c12b92f855e6e50478834f537122b86cf1
Author: Tomas Popela <tpopela redhat com>
Date: Wed Mar 30 10:07:21 2016 +0200
Cannot change order list to unordered for the first time
Return E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_NONE when we are not able to
determine a type of list instead of returning -1.
e-util/e-html-editor-selection.c | 20 +++++++++++---------
e-util/e-html-editor-utils.c | 14 ++++++++------
2 files changed, 19 insertions(+), 15 deletions(-)
---
diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c
index 7294987..a0db9e5 100644
--- a/e-util/e-html-editor-selection.c
+++ b/e-util/e-html-editor-selection.c
@@ -2901,17 +2901,19 @@ format_change_list_to_list (EHTMLEditorSelection *selection,
prev = get_list_format_from_node (prev_list);
next = get_list_format_from_node (next_list);
- if (format == prev && format != -1 && prev != -1) {
- if (selection_starts_in_first_child && selection_ends_in_last_child) {
- done = TRUE;
- merge_list_into_list (current_list, prev_list, FALSE);
+ if (format != E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_NONE) {
+ if (format == prev && prev != E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_NONE) {
+ if (selection_starts_in_first_child && selection_ends_in_last_child) {
+ done = TRUE;
+ merge_list_into_list (current_list, prev_list, FALSE);
+ }
}
- }
- if (format == next && format != -1 && next != -1) {
- if (selection_starts_in_first_child && selection_ends_in_last_child) {
- done = TRUE;
- merge_list_into_list (next_list, prev_list, FALSE);
+ if (format == next && next != E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_NONE) {
+ if (selection_starts_in_first_child && selection_ends_in_last_child) {
+ done = TRUE;
+ merge_list_into_list (next_list, prev_list, FALSE);
+ }
}
}
diff --git a/e-util/e-html-editor-utils.c b/e-util/e-html-editor-utils.c
index 8cdd4ed..de0b72c 100644
--- a/e-util/e-html-editor-utils.c
+++ b/e-util/e-html-editor-utils.c
@@ -488,7 +488,7 @@ get_list_format_from_node (WebKitDOMNode *node)
E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_UNORDERED_LIST;
if (WEBKIT_DOM_IS_HTMLLI_ELEMENT (node))
- return -1;
+ return E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_NONE;
if (WEBKIT_DOM_IS_HTMLU_LIST_ELEMENT (node))
return format;
@@ -511,7 +511,7 @@ get_list_format_from_node (WebKitDOMNode *node)
return format;
}
- return -1;
+ return E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_NONE;
}
void
@@ -552,11 +552,13 @@ merge_lists_if_possible (WebKitDOMNode *list)
prev = get_list_format_from_node (prev_sibling);
next = get_list_format_from_node (next_sibling);
- if (format == prev && format != -1 && prev != -1)
- merge_list_into_list (prev_sibling, list, TRUE);
+ if (format != E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_NONE) {
+ if (format == prev && prev != E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_NONE)
+ merge_list_into_list (prev_sibling, list, TRUE);
- if (format == next && format != -1 && next != -1)
- merge_list_into_list (next_sibling, list, FALSE);
+ if (format == next && next != E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_NONE)
+ merge_list_into_list (next_sibling, list, FALSE);
+ }
lists = webkit_dom_element_query_selector_all (
WEBKIT_DOM_ELEMENT (list), "ol + ol, ul + ul", NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]