[evolution] EHTMLEditorSelection - Correctly wrap long anchors that are on the beginning of the line in plain te



commit 76a6b305aee03dbf397b40a384b101786371fd6c
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Oct 15 14:58:39 2014 +0200

    EHTMLEditorSelection - Correctly wrap long anchors that are on the beginning of the line in plain text 
mode
    
    We have to insert the BR that is used for wrapping after the link and
    not before it.

 e-util/e-html-editor-selection.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c
index 893992f..6bb0dc4 100644
--- a/e-util/e-html-editor-selection.c
+++ b/e-util/e-html-editor-selection.c
@@ -5262,14 +5262,16 @@ wrap_lines (EHTMLEditorSelection *selection,
                                text_content = webkit_dom_node_get_text_content (node);
                                anchor_length = g_utf8_strlen (text_content, -1);
                                if (len + anchor_length > word_wrap_length) {
-                                       element = webkit_dom_document_create_element (
-                                               document, "BR", NULL);
-                                       element_add_class (element, "-x-evo-wrap-br");
-                                       webkit_dom_node_insert_before (
-                                               webkit_dom_node_get_parent_node (node),
-                                               WEBKIT_DOM_NODE (element),
-                                               node,
-                                               NULL);
+                                       if (webkit_dom_node_get_previous_sibling (node)) {
+                                               element = webkit_dom_document_create_element (
+                                                       document, "BR", NULL);
+                                               element_add_class (element, "-x-evo-wrap-br");
+                                               webkit_dom_node_insert_before (
+                                                       webkit_dom_node_get_parent_node (node),
+                                                       WEBKIT_DOM_NODE (element),
+                                                       node,
+                                                       NULL);
+                                       }
                                        len = anchor_length;
                                } else
                                        len += anchor_length;


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