aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2014-08-07 17:30:53 +0800
committerTomas Popela <tpopela@redhat.com>2014-08-07 17:30:53 +0800
commit56f8ae3a3f68dfebe4d6f226fc63f6de438c64e0 (patch)
tree566ec8ca83861ee0ba2f787f012a0cc4beb915bc
parent96ec70c850fbbc2b8110c75d801d85eaf5ca8213 (diff)
downloadgsoc2013-evolution-56f8ae3a3f68dfebe4d6f226fc63f6de438c64e0.tar
gsoc2013-evolution-56f8ae3a3f68dfebe4d6f226fc63f6de438c64e0.tar.gz
gsoc2013-evolution-56f8ae3a3f68dfebe4d6f226fc63f6de438c64e0.tar.bz2
gsoc2013-evolution-56f8ae3a3f68dfebe4d6f226fc63f6de438c64e0.tar.lz
gsoc2013-evolution-56f8ae3a3f68dfebe4d6f226fc63f6de438c64e0.tar.xz
gsoc2013-evolution-56f8ae3a3f68dfebe4d6f226fc63f6de438c64e0.tar.zst
gsoc2013-evolution-56f8ae3a3f68dfebe4d6f226fc63f6de438c64e0.zip
EHTMLEditorSelection - Fix the unindentation of the list
-rw-r--r--e-util/e-html-editor-selection.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c
index aadcef5171..47aeecf0e3 100644
--- a/e-util/e-html-editor-selection.c
+++ b/e-util/e-html-editor-selection.c
@@ -1709,6 +1709,15 @@ remove_quoting_from_element (WebKitDOMElement *element)
}
static gboolean
+node_is_list_or_item (WebKitDOMNode *node)
+{
+ return node && (
+ WEBKIT_DOM_IS_HTMLO_LIST_ELEMENT (node) ||
+ WEBKIT_DOM_IS_HTMLU_LIST_ELEMENT (node) ||
+ WEBKIT_DOM_IS_HTMLLI_ELEMENT (node));
+}
+
+static gboolean
node_is_list (WebKitDOMNode *node)
{
return node && (
@@ -2810,7 +2819,7 @@ e_html_editor_selection_indent (EHTMLEditorSelection *selection)
block, WEBKIT_DOM_NODE (selection_end_marker));
length = webkit_dom_node_list_get_length (list);
- if (length == 0 && node_is_list (block)) {
+ if (length == 0 && node_is_list_or_item (block)) {
indent_list (selection, document);
if (!after_selection_end) {
block = next_block;
@@ -3150,7 +3159,7 @@ e_html_editor_selection_unindent (EHTMLEditorSelection *selection)
block, WEBKIT_DOM_NODE (selection_end_marker));
length = webkit_dom_node_list_get_length (list);
- if (length == 0 && node_is_list (block)) {
+ if (length == 0 && node_is_list_or_item (block)) {
unindent_list (selection, document);
if (!after_selection_end) {
block = next_block;
@@ -5722,9 +5731,7 @@ e_html_editor_selection_wrap_paragraph (EHTMLEditorSelection *selection,
indentation_level = get_indentation_level (paragraph);
citation_level = get_citation_level (WEBKIT_DOM_NODE (paragraph));
- if (node_is_list (WEBKIT_DOM_NODE (paragraph)) ||
- WEBKIT_DOM_IS_HTMLLI_ELEMENT (paragraph)) {
-
+ if (node_is_list_or_item (WEBKIT_DOM_NODE (paragraph))) {
gint list_level = get_list_level (WEBKIT_DOM_NODE (paragraph));
indentation_level = 0;