[evolution/wip/tpopela/composer-dnd: 4/5] History could be saved twice if inserting HTML content



commit 387829c41b5ed52fd8797c80da6289f81b31cbc2
Author: Tomas Popela <tpopela redhat com>
Date:   Thu Mar 9 12:01:08 2017 +0100

    History could be saved twice if inserting HTML content

 .../web-extension/e-editor-dom-functions.c         |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c 
b/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
index ea34ec5..214f69d 100644
--- a/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
+++ b/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
@@ -8908,8 +8908,14 @@ e_editor_dom_insert_html (EEditorPage *editor_page,
                e_editor_dom_check_magic_links (editor_page, FALSE);
                e_editor_dom_scroll_to_caret (editor_page);
                e_editor_dom_force_spell_check_in_viewport (editor_page);
-       } else
+       } else {
+               /* Don't save history in the underlying function. */
+               if (!undo_redo_in_progress)
+                       e_editor_undo_redo_manager_set_operation_in_progress (manager, TRUE);
                e_editor_dom_convert_and_insert_html_into_selection (editor_page, html_text, TRUE);
+               if (!undo_redo_in_progress)
+                       e_editor_undo_redo_manager_set_operation_in_progress (manager, FALSE);
+       }
 
        remove_apple_interchange_newline_elements (document);
 


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