[evolution] EHTMLEditorView - Wrap just paragraphs that are not in the quoted content



commit 0ffb259cf8d24afdf4fa1f296e36773610226b8f
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Jul 30 12:56:38 2014 +0200

    EHTMLEditorView - Wrap just paragraphs that are not in the quoted content
    
    Paragraphs in the quoted content are already wrapped, so we were just
    waisting the time there.

 e-util/e-html-editor-view.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 132d6cb..bf1c3b5 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -6183,6 +6183,7 @@ convert_element_from_html_to_plain_text (EHTMLEditorView *view,
 static gchar *
 process_content_for_plain_text (EHTMLEditorView *view)
 {
+       EHTMLEditorSelection *selection;
        gboolean converted, wrap = FALSE, quote = FALSE, clean = FALSE;
        gint length, ii;
        GString *plain_text;
@@ -6198,6 +6199,8 @@ process_content_for_plain_text (EHTMLEditorView *view)
                WEBKIT_DOM_ELEMENT (body), "data-converted");
        source = webkit_dom_node_clone_node (WEBKIT_DOM_NODE (body), TRUE);
 
+       selection = e_html_editor_view_get_selection (view);
+
        /* If composer is in HTML mode we have to move the content to plain version */
        if (view->priv->html_mode) {
                if (converted) {
@@ -6246,7 +6249,7 @@ process_content_for_plain_text (EHTMLEditorView *view)
        }
 
        paragraphs = webkit_dom_element_query_selector_all (
-               WEBKIT_DOM_ELEMENT (source), ".-x-evo-paragraph", NULL);
+               WEBKIT_DOM_ELEMENT (source), "body > .-x-evo-paragraph", NULL);
 
        length = webkit_dom_node_list_get_length (paragraphs);
        for (ii = 0; ii < length; ii++) {
@@ -6264,15 +6267,13 @@ process_content_for_plain_text (EHTMLEditorView *view)
 
                                if (WEBKIT_DOM_IS_HTMLLI_ELEMENT (item)) {
                                        e_html_editor_selection_wrap_paragraph (
-                                               e_html_editor_view_get_selection (view),
-                                               WEBKIT_DOM_ELEMENT (item));
+                                               selection, WEBKIT_DOM_ELEMENT (item));
                                }
                                item = next_item;
                        }
                } else {
                        e_html_editor_selection_wrap_paragraph (
-                               e_html_editor_view_get_selection (view),
-                               WEBKIT_DOM_ELEMENT (paragraph));
+                               selection, WEBKIT_DOM_ELEMENT (paragraph));
                }
        }
 


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