From a0334366488989ef25fb812d7030d298c0917c96 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Thu, 22 Nov 2007 23:16:00 +0000 Subject: [PATCH] fix bug caused by rev. 16540 --- src/live_effects/effect.cpp | 16 ++++++++-------- src/live_effects/effect.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 2035d301f..b892c520e 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -97,7 +97,7 @@ Effect::Effect(LivePathEffectObject *lpeobject) vbox = NULL; tooltips = NULL; lpeobj = lpeobject; - oncanvasedit_it = param_vector.begin(); + oncanvasedit_it = 0; } Effect::~Effect() @@ -297,19 +297,19 @@ Parameter * Effect::getNextOncanvasEditableParam() { oncanvasedit_it++; - if (oncanvasedit_it == param_vector.end()) { - oncanvasedit_it = param_vector.begin(); + if (oncanvasedit_it == param_vector.size()) { + oncanvasedit_it = 0; } - std::vector::iterator old_it = oncanvasedit_it; + int old_it = oncanvasedit_it; do { - Parameter * param = *oncanvasedit_it; - if(param->oncanvas_editable) { + Parameter * param = param_vector[oncanvasedit_it]; + if(param && param->oncanvas_editable) { return param; } else { oncanvasedit_it++; - if (oncanvasedit_it == param_vector.end()) { // loop round the map - oncanvasedit_it = param_vector.begin(); + if (oncanvasedit_it == param_vector.size()) { // loop round the map + oncanvasedit_it = 0; } } } while (oncanvasedit_it != old_it); // iterate until complete loop through map has been made diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index f30590693..98cb746c5 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -106,7 +106,7 @@ protected: Parameter * getNextOncanvasEditableParam(); std::vector param_vector; - std::vector::iterator oncanvasedit_it; + int oncanvasedit_it; Inkscape::UI::Widget::Registry wr; -- 2.30.2