aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2014-07-01 21:11:30 +0800
committerTomas Popela <tpopela@redhat.com>2014-07-01 21:11:30 +0800
commitadd3b70e366538292b970c8e44dc15bd8a004f3e (patch)
tree3618dccafeddd6ebcf8ad9a9f9891864bd90842d /e-util
parent9b5c2022d7d8921084e0e29f966bd4d384cc5cea (diff)
downloadgsoc2013-evolution-add3b70e366538292b970c8e44dc15bd8a004f3e.tar
gsoc2013-evolution-add3b70e366538292b970c8e44dc15bd8a004f3e.tar.gz
gsoc2013-evolution-add3b70e366538292b970c8e44dc15bd8a004f3e.tar.bz2
gsoc2013-evolution-add3b70e366538292b970c8e44dc15bd8a004f3e.tar.lz
gsoc2013-evolution-add3b70e366538292b970c8e44dc15bd8a004f3e.tar.xz
gsoc2013-evolution-add3b70e366538292b970c8e44dc15bd8a004f3e.tar.zst
gsoc2013-evolution-add3b70e366538292b970c8e44dc15bd8a004f3e.zip
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.
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-html-editor-view.c15
1 files changed, 12 insertions, 3 deletions
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);
}
/**