[evolution/gnome-3-16] EHTMLEditorSelection - Anchors that don't fit inside a line are not correctly wrapped



commit 824106fb81cfaa0d4f6cee286930b319a6749419
Author: Tomas Popela <tpopela redhat com>
Date:   Fri Aug 7 10:57:31 2015 +0200

    EHTMLEditorSelection - Anchors that don't fit inside a line are not correctly wrapped
    
    If the anchor don't fit inside a line we have to always split it.

 e-util/e-html-editor-selection.c |   19 ++-----------------
 1 files changed, 2 insertions(+), 17 deletions(-)
---
diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c
index 699b5fd..d2a6f4f 100644
--- a/e-util/e-html-editor-selection.c
+++ b/e-util/e-html-editor-selection.c
@@ -6643,7 +6643,7 @@ wrap_lines (EHTMLEditorSelection *selection,
                                next_sibling = webkit_dom_node_get_next_sibling (node);
                                /* If the anchor doesn't fit on the line move the inner
                                 * nodes out of it and start to wrap them. */
-                               if (anchor_length > length_to_wrap) {
+                               if ((line_length + anchor_length) > length_to_wrap) {
                                        WebKitDOMNode *inner_node;
 
                                        while ((inner_node = webkit_dom_node_get_first_child (node))) {
@@ -6663,22 +6663,7 @@ wrap_lines (EHTMLEditorSelection *selection,
                                        continue;
                                }
 
-                               if (line_length + anchor_length > length_to_wrap) {
-                                       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);
-                                       }
-                                       line_length = anchor_length;
-                                       compensated = FALSE;
-                               } else
-                                       line_length += anchor_length;
-
+                               line_length += anchor_length;
                                node = next_sibling;
                                continue;
                        }


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