[evolution] EHTMLEditorView - Nodes from undo/redo history could be modified
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] EHTMLEditorView - Nodes from undo/redo history could be modified
- Date: Wed, 10 Jun 2015 07:53:30 +0000 (UTC)
commit 991a7e7ee5a94c1fc68743d1b9a708487723c0da
Author: Tomas Popela <tpopela redhat com>
Date: Wed Jun 10 09:07:44 2015 +0200
EHTMLEditorView - Nodes from undo/redo history could be modified
When doing the undo/redo operations always insert the clones and not the original
nodes as later when the nodes that are in active DOM are modified the changes will
apply to the nodes in the history as well.
e-util/e-html-editor-view.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index b57db83..b7a3241 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -11631,7 +11631,7 @@ undo_redo_hrule_dialog (EHTMLEditorView *view,
else
webkit_dom_node_replace_child (
webkit_dom_node_get_parent_node (node),
- event->data.dom.from,
+ webkit_dom_node_clone_node (event->data.dom.from, TRUE),
node,
NULL);
}
@@ -11647,13 +11647,13 @@ undo_redo_hrule_dialog (EHTMLEditorView *view,
if (node && WEBKIT_DOM_IS_HTMLHR_ELEMENT (node))
webkit_dom_node_replace_child (
webkit_dom_node_get_parent_node (node),
- event->data.dom.to,
+ webkit_dom_node_clone_node (event->data.dom.to, TRUE),
node,
NULL);
} else {
webkit_dom_node_insert_before (
webkit_dom_node_get_parent_node (WEBKIT_DOM_NODE (parent)),
- event->data.dom.to,
+ webkit_dom_node_clone_node (event->data.dom.to, TRUE),
webkit_dom_node_get_next_sibling (WEBKIT_DOM_NODE (parent)),
NULL);
}
@@ -11708,7 +11708,7 @@ undo_redo_image_dialog (EHTMLEditorView *view,
webkit_dom_node_replace_child (
webkit_dom_node_get_parent_node (image),
- undo ? event->data.dom.from : event->data.dom.to,
+ webkit_dom_node_clone_node (undo ? event->data.dom.from : event->data.dom.to, TRUE),
image,
NULL);
@@ -11748,7 +11748,7 @@ undo_redo_table_dialog (EHTMLEditorView *view,
parent = get_parent_block_element (WEBKIT_DOM_NODE (element));
webkit_dom_node_insert_before (
webkit_dom_node_get_parent_node (WEBKIT_DOM_NODE (parent)),
- undo ? event->data.dom.from : event->data.dom.to,
+ webkit_dom_node_clone_node (undo ? event->data.dom.from : event->data.dom.to,
TRUE),
WEBKIT_DOM_NODE (parent),
NULL);
restore_selection_to_history_event_state (view, event->before);
@@ -11763,7 +11763,7 @@ undo_redo_table_dialog (EHTMLEditorView *view,
else
webkit_dom_node_replace_child (
webkit_dom_node_get_parent_node (WEBKIT_DOM_NODE (table)),
- event->data.dom.from,
+ webkit_dom_node_clone_node (event->data.dom.from, TRUE),
WEBKIT_DOM_NODE (table),
NULL);
} else {
@@ -11772,7 +11772,7 @@ undo_redo_table_dialog (EHTMLEditorView *view,
else
webkit_dom_node_replace_child (
webkit_dom_node_get_parent_node (WEBKIT_DOM_NODE (table)),
- event->data.dom.to,
+ webkit_dom_node_clone_node (event->data.dom.to, TRUE),
WEBKIT_DOM_NODE (table),
NULL);
}
@@ -11828,7 +11828,7 @@ undo_redo_table_input (EHTMLEditorView *view,
webkit_dom_node_replace_child (
webkit_dom_node_get_parent_node (WEBKIT_DOM_NODE (element)),
- undo ? event->data.dom.from : event->data.dom.to,
+ webkit_dom_node_clone_node (undo ? event->data.dom.from : event->data.dom.to, TRUE),
WEBKIT_DOM_NODE (element),
NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]