[evolution/gnome-3-20] EHTMLEditorView - Don't add a new line for the empty list when generating a plain text version of th



commit b43b50f8aca03201b21676eb901815407c66acaa
Author: Tomas Popela <tpopela redhat com>
Date:   Mon Jun 27 10:51:42 2016 +0200

    EHTMLEditorView - Don't add a new line for the empty list when generating a plain text version of the 
content

 e-util/e-html-editor-view.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index e75f5dd..7dbd88a 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -9304,6 +9304,7 @@ process_list_to_plain_text (EHTMLEditorView *view,
 {
        EHTMLEditorSelectionBlockFormat format;
        EHTMLEditorSelectionAlignment alignment;
+       gboolean empty = TRUE;
        gint counter = 1;
        gchar *indent_per_level = g_strnfill (SPACES_PER_LIST_LEVEL, ' ');
        WebKitDOMNode *item;
@@ -9324,6 +9325,7 @@ process_list_to_plain_text (EHTMLEditorView *view,
                        WebKitDOMElement *wrapped;
                        GString *item_value = g_string_new ("");
 
+                       empty = FALSE;
                        alignment = e_html_editor_selection_get_list_alignment_from_node (
                                WEBKIT_DOM_NODE (item));
 
@@ -9521,7 +9523,7 @@ process_list_to_plain_text (EHTMLEditorView *view,
                }
        }
 
-       if (webkit_dom_node_get_next_sibling (WEBKIT_DOM_NODE (element)))
+       if (webkit_dom_node_get_next_sibling (WEBKIT_DOM_NODE (element)) && !empty)
                g_string_append (output, "\n");
 
        g_free (indent_per_level);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]