[evolution/wip/webkit2] EHTMLEditorView - Correctly remove the HISTORY_AND events from history



commit 331e4856d2aae44dc43d7f7895276c5112450120
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Mar 2 18:07:11 2016 +0100

    EHTMLEditorView - Correctly remove the HISTORY_AND events from history

 .../composer/e-html-editor-undo-redo-manager.c     |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/web-extensions/composer/e-html-editor-undo-redo-manager.c 
b/web-extensions/composer/e-html-editor-undo-redo-manager.c
index 99a1959..7f4704d 100644
--- a/web-extensions/composer/e-html-editor-undo-redo-manager.c
+++ b/web-extensions/composer/e-html-editor-undo-redo-manager.c
@@ -2237,8 +2237,15 @@ e_html_editor_undo_redo_manager_insert_history_event (EHTMLEditorUndoRedoManager
 
        remove_forward_redo_history_events_if_needed (manager);
 
-       if (manager->priv->history_size >= HISTORY_SIZE_LIMIT)
+       if (manager->priv->history_size >= HISTORY_SIZE_LIMIT) {
                remove_history_event (manager, g_list_last (manager->priv->history)->prev);
+               /* FIXME WK2 - what if g_list_last (manager->priv->history) returns NULL? */
+               while (((EHTMLEditorHistoryEvent *) (g_list_last (manager->priv->history)->prev))->type == 
HISTORY_AND) {
+                       remove_history_event (manager, g_list_last (manager->priv->history)->prev);
+                       remove_history_event (manager, g_list_last (manager->priv->history)->prev);
+               }
+
+       }
 
        manager->priv->history = g_list_prepend (manager->priv->history, event);
        manager->priv->history_size++;


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