[evolution] EHTMLEditorView - Process the plain text version the right way when sending the HTML mail



commit fe3a3c518bf39a4f01c2d4666d9f80708a67fe56
Author: Tomas Popela <tpopela redhat com>
Date:   Thu Aug 7 11:40:59 2014 +0200

    EHTMLEditorView - Process the plain text version the right way when sending the HTML mail

 e-util/e-html-editor-view.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 886c6fe..8b92b3d 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -6344,7 +6344,8 @@ static gchar *
 process_content_for_plain_text (EHTMLEditorView *view)
 {
        EHTMLEditorSelection *selection;
-       gboolean converted, wrap = FALSE, quote = FALSE, clean = FALSE;
+       gboolean wrap = FALSE, quote = FALSE, clean = FALSE;
+       gboolean converted, is_from_new_message;
        gint length, ii;
        GString *plain_text;
        WebKitDOMDocument *document;
@@ -6357,13 +6358,15 @@ process_content_for_plain_text (EHTMLEditorView *view)
        body = WEBKIT_DOM_NODE (webkit_dom_document_get_body (document));
        converted = webkit_dom_element_has_attribute (
                WEBKIT_DOM_ELEMENT (body), "data-converted");
+       is_from_new_message = webkit_dom_element_has_attribute (
+               WEBKIT_DOM_ELEMENT (body), "data-new-message");
        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) {
+               if (converted || is_from_new_message) {
                        toggle_paragraphs_style_in_element (
                                view, WEBKIT_DOM_ELEMENT (source), FALSE);
                        remove_images_in_element (
@@ -6395,8 +6398,8 @@ process_content_for_plain_text (EHTMLEditorView *view)
 
                                paragraph = webkit_dom_node_list_item (paragraphs, ii);
 
-                               webkit_dom_element_set_id (
-                                       WEBKIT_DOM_ELEMENT (paragraph), "");
+                               webkit_dom_element_remove_attribute (
+                                       WEBKIT_DOM_ELEMENT (paragraph), "id");
                        }
                        g_object_unref (paragraphs);
 


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