diff options
| author | gustav_b <gustav_b@users.sourceforge.net> | 2007-03-28 20:38:10 +0000 |
|---|---|---|
| committer | gustav_b <gustav_b@users.sourceforge.net> | 2007-03-28 20:38:10 +0000 |
| commit | a719dcb0e9b591316d3fd3914a5835858befd911 (patch) | |
| tree | aa96733ddde2364f48a95663023ffbdd219f8f84 /src | |
| parent | Add shift+click to union new fill with old selection (diff) | |
| download | inkscape-a719dcb0e9b591316d3fd3914a5835858befd911.tar.gz inkscape-a719dcb0e9b591316d3fd3914a5835858befd911.zip | |
Fix for #1684042 (undo while adding a shape with the mouse results in a crash.)
(bzr r2774)
Diffstat (limited to 'src')
| -rw-r--r-- | src/document-undo.cpp | 2 | ||||
| -rw-r--r-- | src/event-log.cpp | 7 | ||||
| -rw-r--r-- | src/event-log.h | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/document-undo.cpp b/src/document-undo.cpp index 0462ff374..47d56ca66 100644 --- a/src/document-undo.cpp +++ b/src/document-undo.cpp @@ -201,7 +201,7 @@ void finish_incomplete_transaction(SPDocument &doc) { g_warning ("Incomplete undo transaction:"); priv.partial = sp_repr_coalesce_log(priv.partial, log); sp_repr_debug_print_log(priv.partial); - priv.undo = g_slist_prepend(priv.undo, priv.partial); + priv.undo = g_slist_prepend(priv.undo, new Inkscape::Event(priv.partial)); priv.partial = NULL; } } 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; diff --git a/src/event-log.h b/src/event-log.h index 259731de2..02cfa4b9a 100644 --- a/src/event-log.h +++ b/src/event-log.h @@ -53,13 +53,14 @@ public: struct EventModelColumns : public Gtk::TreeModelColumnRecord { + Gtk::TreeModelColumn<Event *> event; Gtk::TreeModelColumn<unsigned int> type; Gtk::TreeModelColumn<Glib::ustring> description; Gtk::TreeModelColumn<int> child_count; EventModelColumns() { - add(type); add(description); add(child_count); + add(event); add(type); add(description); add(child_count); } }; |
