[evolution] EHTMLEditorView - When writing into the citation rewrap and requote just when it is necessary



commit 45cc08a6bef1e312a45037cb7584635e6b0c3536
Author: Tomas Popela <tpopela redhat com>
Date:   Mon Jul 21 14:15:28 2014 +0200

    EHTMLEditorView - When writing into the citation rewrap and requote just when it is necessary

 e-util/e-html-editor-view.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 30f07af..493fa74 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -738,6 +738,8 @@ body_input_event_cb (WebKitDOMElement *element,
                length = word_wrap_length - 2 * citation_level;
 
                if (element && citation_level > 0) {
+                       gchar *content;
+                       gint text_length;
                        WebKitDOMElement *block;
                        gboolean remove_quoting = FALSE;
 
@@ -762,8 +764,12 @@ body_input_event_cb (WebKitDOMElement *element,
                                block = webkit_dom_node_get_parent_element (
                                        WEBKIT_DOM_NODE (block));
 
+                       content = webkit_dom_node_get_text_content (WEBKIT_DOM_NODE (block));
+                       text_length = g_utf8_strlen (content, -1);
+                       g_free (content);
+
                        /* Wrap and quote the line */
-                       if (!remove_quoting) {
+                       if (!remove_quoting && text_length >= word_wrap_length) {
                                remove_quoting_from_element (block);
 
                                block = e_html_editor_selection_wrap_paragraph_length (


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