summaryrefslogtreecommitdiffstats
path: root/src/composite-undo-stack-observer.cpp
diff options
context:
space:
mode:
authorAndrew Higginson <at.higginson@gmail.com>2011-12-27 21:04:47 +0000
committerAndrew <at.higginson@gmail.com>2011-12-27 21:04:47 +0000
commit80960b623a99aae1402ab651b2974ef544ed3b03 (patch)
treeba49d42c2789e9e11f805e2d5263e10f9fedeef8 /src/composite-undo-stack-observer.cpp
parenttry to fix bug (diff)
parentGDL: Cherry-pick upstream patch 73852 (2011-03-23) - Add missing return value. (diff)
downloadinkscape-80960b623a99aae1402ab651b2974ef544ed3b03.tar.gz
inkscape-80960b623a99aae1402ab651b2974ef544ed3b03.zip
merged with trunk so I can build again...
(bzr r10092.1.36)
Diffstat (limited to 'src/composite-undo-stack-observer.cpp')
-rw-r--r--src/composite-undo-stack-observer.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/composite-undo-stack-observer.cpp b/src/composite-undo-stack-observer.cpp
index 03e4796bd..81a0b27c7 100644
--- a/src/composite-undo-stack-observer.cpp
+++ b/src/composite-undo-stack-observer.cpp
@@ -1,6 +1,4 @@
-/**
- * Aggregates undo stack observers for convenient management and triggering in SPDocument
- *
+/*
* Heavily inspired by Inkscape::XML::CompositeNodeObserver.
*
* Authors:
@@ -139,16 +137,22 @@ CompositeUndoStackObserver::_unlock()
if (!--this->_iterating) {
// Remove marked observers
UndoObserverRecordList::iterator i = this->_active.begin();
- for(; i != this->_active.begin(); i++) {
+ for(; i != this->_active.begin(); ) {
if (i->to_remove) {
- this->_active.erase(i);
+ i = this->_active.erase(i);
+ }
+ else{
+ ++i;
}
}
i = this->_pending.begin();
- for(; i != this->_pending.begin(); i++) {
+ for(; i != this->_pending.begin(); ) {
if (i->to_remove) {
- this->_active.erase(i);
+ i = this->_active.erase(i);
+ }
+ else {
+ ++i;
}
}