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



commit c3e6a6c153ae5daaabfe7ec015599c1f8e042218
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 8dea516..59f006c 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -13785,7 +13785,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);
 
@@ -13799,18 +13798,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]