From 47b55c0d9fccf3994f86fd764cefca3a2f734dbe Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sat, 15 Oct 2011 22:03:44 +0200 Subject: cppcheck (bzr r10678) --- src/composite-undo-stack-observer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/composite-undo-stack-observer.cpp') diff --git a/src/composite-undo-stack-observer.cpp b/src/composite-undo-stack-observer.cpp index 03e4796bd..6af34d92a 100644 --- a/src/composite-undo-stack-observer.cpp +++ b/src/composite-undo-stack-observer.cpp @@ -139,14 +139,14 @@ 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(); ++i) { if (i->to_remove) { this->_active.erase(i); } } i = this->_pending.begin(); - for(; i != this->_pending.begin(); i++) { + for(; i != this->_pending.begin(); ++i) { if (i->to_remove) { this->_active.erase(i); } -- cgit v1.2.3 From 7cd2a14069d9d39b42b19a87d9cc6ba238c71924 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 23 Oct 2011 01:01:33 -0700 Subject: Documentation update pass. (bzr r10692) --- src/composite-undo-stack-observer.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/composite-undo-stack-observer.cpp') diff --git a/src/composite-undo-stack-observer.cpp b/src/composite-undo-stack-observer.cpp index 6af34d92a..383e08cd8 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: -- cgit v1.2.3 From 7b1b14913ac759e86176d212afa6d90f67eb8bb6 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sat, 5 Nov 2011 08:20:36 +0100 Subject: Various fixes: initialization, memory leak, wrong iterator usage (bzr r10721) --- src/composite-undo-stack-observer.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/composite-undo-stack-observer.cpp') diff --git a/src/composite-undo-stack-observer.cpp b/src/composite-undo-stack-observer.cpp index 383e08cd8..81a0b27c7 100644 --- a/src/composite-undo-stack-observer.cpp +++ b/src/composite-undo-stack-observer.cpp @@ -137,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; } } -- cgit v1.2.3