diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-08 18:17:19 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-08 18:17:19 +0100 |
commit | 16614be0a5dea0613fedb6bbbb9f0dd8879905a2 (patch) | |
tree | a942507f90d669a3432f0177592e6e59345483f2 /undo.h | |
parent | 779bb1654d20af6139f17bdaf9a38bcb75d20965 (diff) | |
download | sciteco-16614be0a5dea0613fedb6bbbb9f0dd8879905a2.tar.gz |
set UndoToken position only when it is required (undo enabled)
Diffstat (limited to 'undo.h')
-rw-r--r-- | undo.h | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -14,8 +14,6 @@ public: gint pos; - UndoToken(); - virtual void run() = 0; }; @@ -75,25 +73,18 @@ public: }; extern class UndoStack { - SLIST_HEAD(undo_head, UndoToken) head; + SLIST_HEAD(Head, UndoToken) head; public: bool enabled; - UndoStack(bool _enabled = true) : enabled(_enabled) + UndoStack(bool _enabled = false) : enabled(_enabled) { SLIST_INIT(&head); } ~UndoStack(); - inline void - push(UndoToken *token) - { - if (enabled) - SLIST_INSERT_HEAD(&head, token, tokens); - else - delete token; - } + void push(UndoToken *token); void push_msg(unsigned int iMessage, uptr_t wParam = 0, sptr_t lParam = 0); |