aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2014-06-13 20:18:14 +0800
committerTomas Popela <tpopela@redhat.com>2014-06-13 20:57:25 +0800
commit93d897d8c1bbe3094ca95a3d840475b14af0a488 (patch)
treee8dcdfc801bd70db1b4235003e85b6d6131d6f47
parentc4e218018b271cb3d70ea5b7cbe70be42fb9ae92 (diff)
downloadgsoc2013-evolution-93d897d8c1bbe3094ca95a3d840475b14af0a488.tar
gsoc2013-evolution-93d897d8c1bbe3094ca95a3d840475b14af0a488.tar.gz
gsoc2013-evolution-93d897d8c1bbe3094ca95a3d840475b14af0a488.tar.bz2
gsoc2013-evolution-93d897d8c1bbe3094ca95a3d840475b14af0a488.tar.lz
gsoc2013-evolution-93d897d8c1bbe3094ca95a3d840475b14af0a488.tar.xz
gsoc2013-evolution-93d897d8c1bbe3094ca95a3d840475b14af0a488.tar.zst
gsoc2013-evolution-93d897d8c1bbe3094ca95a3d840475b14af0a488.zip
EMsgComposer - Return body's innerText instead of plain text in e_msg_composer_get_raw_message_text
The only consumer of e_msg_composer_get_raw_message_text is the Attachment Reminder plugin that is just searching for given words in message's text. For this purpose the innerText is enough and getting it is a lot faster than generating the plain text version of composer's content.
-rw-r--r--composer/e-msg-composer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index d3891beb4e..45e8d9a507 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -4851,14 +4851,18 @@ e_msg_composer_get_raw_message_text (EMsgComposer *composer)
EHTMLEditorView *view;
GByteArray *array;
gchar *text;
+ WebKitDOMDocument *document;
+ WebKitDOMHTMLElement *body;
g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), NULL);
editor = e_msg_composer_get_editor (composer);
view = e_html_editor_get_view (editor);
+ document = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view));
+ body = webkit_dom_document_get_body (document);
array = g_byte_array_new ();
- text = e_html_editor_view_get_text_plain (view);
+ text = webkit_dom_html_element_get_inner_text (body);
g_byte_array_append (array, (guint8 *) text, strlen (text));
g_free (text);