From a719dcb0e9b591316d3fd3914a5835858befd911 Mon Sep 17 00:00:00 2001 From: gustav_b Date: Wed, 28 Mar 2007 20:38:10 +0000 Subject: Fix for #1684042 (undo while adding a shape with the mouse results in a crash.) (bzr r2774) --- src/event-log.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/event-log.cpp') diff --git a/src/event-log.cpp b/src/event-log.cpp index 08fb45f9b..d6bc99bea 100644 --- a/src/event-log.cpp +++ b/src/event-log.cpp @@ -42,6 +42,9 @@ EventLog::notifyUndoEvent(Event* log) { if ( !_notifications_blocked ) { + // make sure the supplied event matches the next undoable event + g_return_if_fail ( _getUndoEvent() && (*(_getUndoEvent()))[_columns.event] == log ); + // if we're on the first child event... if ( _curr_event->parent() && _curr_event == _curr_event->parent()->children().begin() ) @@ -93,6 +96,9 @@ EventLog::notifyRedoEvent(Event* log) { if ( !_notifications_blocked ) { + // make sure the supplied event matches the next redoable event + g_return_if_fail ( _getRedoEvent() && (*(_getRedoEvent()))[_columns.event] == log ); + // if we're on a parent event... if ( !_curr_event->children().empty() ) { @@ -207,6 +213,7 @@ EventLog::notifyUndoCommitEvent(Event* log) _curr_event = _last_event = curr_row; + curr_row[_columns.event] = log; curr_row[_columns.type] = event_type; curr_row[_columns.description] = log->description; -- cgit v1.2.3