[evolution] Bug 744373 - Delete whole line with selection lefts empty line



commit 9dad5b76590aaae1fa5d4718e30c2c8be7770c00
Author: Tomas Popela <tpopela redhat com>
Date:   Thu Feb 12 09:20:49 2015 +0100

    Bug 744373 - Delete whole line with selection lefts empty line
    
    The selection end marker was saved to wrong position when the selection
    ended in the beginning of the paragraph.

 e-util/e-html-editor-selection.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c
index 7a1e773..1fbf479 100644
--- a/e-util/e-html-editor-selection.c
+++ b/e-util/e-html-editor-selection.c
@@ -6180,10 +6180,17 @@ e_html_editor_selection_save (EHTMLEditorSelection *selection)
                parent_node = webkit_dom_node_get_parent_node (split_node);
 
                if (WEBKIT_DOM_IS_HTML_BODY_ELEMENT (parent_node)) {
-                       webkit_dom_node_append_child (
-                               webkit_dom_node_get_previous_sibling (split_node),
-                               marker_node,
-                               NULL);
+                       if (offset == 0)
+                               webkit_dom_node_insert_before (
+                                       split_node,
+                                       marker_node,
+                                       webkit_dom_node_get_first_child (split_node),
+                                       NULL);
+                       else
+                               webkit_dom_node_append_child (
+                                       webkit_dom_node_get_previous_sibling (split_node),
+                                       marker_node,
+                                       NULL);
                } else
                        webkit_dom_node_insert_before (
                                parent_node, marker_node, split_node, NULL);


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