[evolution/wip/webkit2] EHTMLEditorView - Avoid extra selection save/restore in list manipulation



commit b5494509ee15906d4110afd489fbdedfd585bcd1
Author: Tomas Popela <tpopela redhat com>
Date:   Thu Mar 3 17:12:13 2016 +0100

    EHTMLEditorView - Avoid extra selection save/restore in list manipulation

 .../composer/e-html-editor-view-dom-functions.c    |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/web-extensions/composer/e-html-editor-view-dom-functions.c 
b/web-extensions/composer/e-html-editor-view-dom-functions.c
index 8626e4c..3ad9e33 100644
--- a/web-extensions/composer/e-html-editor-view-dom-functions.c
+++ b/web-extensions/composer/e-html-editor-view-dom-functions.c
@@ -9150,8 +9150,6 @@ return_pressed_in_empty_list_item (WebKitDOMDocument *document,
                manager = e_html_editor_web_extension_get_undo_redo_manager (extension);
 
                if (!e_html_editor_undo_redo_manager_is_operation_in_progress (manager)) {
-                       /* Insert new history event for Return to have the right coordinates.
-                        * The fragment will be added later. */
                        ev = g_new0 (EHTMLEditorHistoryEvent, 1);
                        ev->type = HISTORY_INPUT;
 
@@ -9187,8 +9185,6 @@ return_pressed_in_empty_list_item (WebKitDOMDocument *document,
                        list,
                        NULL);
 
-               dom_selection_restore (document);
-
                if (ev) {
                        dom_selection_get_coordinates (
                                document,
@@ -9202,6 +9198,8 @@ return_pressed_in_empty_list_item (WebKitDOMDocument *document,
                        e_html_editor_undo_redo_manager_insert_history_event (manager, ev);
                }
 
+               dom_selection_restore (document);
+
                e_html_editor_web_extension_set_content_changed (extension);
 
                return TRUE;


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