[evolution] Bug 759046 - Undo deletes the wrong text and redo does not add it back



commit 73a8ecd9b0c0c5cd1569d7fad8b266e68efa516a
Author: Tomas Popela <tpopela redhat com>
Date:   Sun Dec 6 15:00:41 2015 +0100

    Bug 759046 - Undo deletes the wrong text and redo does not add it back
    
    Undoing the 'Paste Quotation' action will remove is deleting the block where is
    was done which later leads to broken undo/redo stack.

 e-util/e-html-editor-view.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 9f67b0c..5835f0b 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -13819,7 +13819,6 @@ undo_redo_paste (EHTMLEditorView *view,
                if (event->type == HISTORY_PASTE_QUOTED) {
                        WebKitDOMElement *tmp;
                        WebKitDOMNode *parent;
-                       WebKitDOMNode *sibling;
 
                        restore_selection_to_history_event_state (view, event->after);
 
@@ -13833,18 +13832,12 @@ undo_redo_paste (EHTMLEditorView *view,
                        while (!WEBKIT_DOM_IS_HTML_BODY_ELEMENT (webkit_dom_node_get_parent_node (parent)))
                                parent = webkit_dom_node_get_parent_node (parent);
 
-                       sibling = webkit_dom_node_get_previous_sibling (parent);
-                       if (sibling) {
-                               add_selection_markers_into_element_end (document, WEBKIT_DOM_ELEMENT 
(sibling), NULL, NULL);
+                       webkit_dom_node_replace_child (
+                               webkit_dom_node_get_parent_node (parent),
+                               WEBKIT_DOM_NODE (prepare_paragraph (selection, document, TRUE)),
+                               parent,
+                               NULL);
 
-                               remove_node (parent);
-                       } else {
-                               webkit_dom_node_replace_child (
-                                       webkit_dom_node_get_parent_node (parent),
-                                       WEBKIT_DOM_NODE (prepare_paragraph (selection, document, TRUE)),
-                                       parent,
-                                       NULL);
-                       }
                        e_html_editor_selection_restore (selection);
                } else {
                        WebKitDOMDOMWindow *dom_window;


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