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



commit 33db93fc60717a23031b8c535712ff2ea96b6940
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Jun 29 12:12:52 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 |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 2599603..24e3917 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -9260,6 +9260,7 @@ process_list_to_plain_text (EHTMLEditorView *view,
        EHTMLEditorSelectionBlockFormat format;
        EHTMLEditorSelectionAlignment alignment;
        gint counter = 1;
+       gboolean empty = TRUE;
        gchar *indent_per_level = g_strnfill (SPACES_PER_LIST_LEVEL, ' ');
        WebKitDOMNode *item;
        gint word_wrap_length = e_html_editor_selection_get_word_wrap_length (
@@ -9279,6 +9280,8 @@ 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));
 
@@ -9476,7 +9479,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]