From add3b70e366538292b970c8e44dc15bd8a004f3e Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Tue, 1 Jul 2014 15:11:30 +0200 Subject: When setting some content into the composer body we have to specify if it is a HTML content Code paths for HTML content and plain text content are different. When we will try to load plain text content as a HTML content we will lose the new line characters. In the opposite case when HTML content is load as a plain text at least the whole structure is lost. --- e-util/e-html-editor-view.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'e-util/e-html-editor-view.c') diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c index 8039a5ce52..19f5758bd1 100644 --- a/e-util/e-html-editor-view.c +++ b/e-util/e-html-editor-view.c @@ -6126,6 +6126,16 @@ convert_and_load_html_to_plain_text (EHTMLEditorView *view, view->priv->convertor_web_view, html, NULL, NULL, "file://"); } +static void +convert_and_load_plain_text (EHTMLEditorView *view, + const gchar *text) +{ + view->priv->convertor_insert = FALSE; + + webkit_web_view_load_string ( + view->priv->convertor_web_view, text, "text/plain", NULL, "file://"); +} + void e_html_editor_view_convert_and_insert_plain_text (EHTMLEditorView *view, const gchar *text) @@ -6170,7 +6180,7 @@ e_html_editor_view_set_text_html (EHTMLEditorView *view, } convert_and_load_html_to_plain_text (view, text); } else { - convert_and_load_html_to_plain_text (view, text); + convert_and_load_plain_text (view, text); } } else { webkit_web_view_load_string ( @@ -6191,8 +6201,7 @@ e_html_editor_view_set_text_plain (EHTMLEditorView *view, { view->priv->reload_in_progress = TRUE; - webkit_web_view_load_string ( - WEBKIT_WEB_VIEW (view), text, "text/plain", NULL, "file://"); + convert_and_load_plain_text (view, text); } /** -- cgit v1.2.3