Code

fix bug caused by rev. 16540
authorjohanengelen <johanengelen@users.sourceforge.net>
Thu, 22 Nov 2007 23:16:00 +0000 (23:16 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Thu, 22 Nov 2007 23:16:00 +0000 (23:16 +0000)
src/live_effects/effect.cpp
src/live_effects/effect.h

index 2035d301fb663f341556f879877c5a32d587a6b1..b892c520e970123da3499229d9e155e13bb69ff6 100644 (file)
@@ -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<Parameter *>::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
index f305906939e6b3652d4875f4a1d02bc7013c9fcd..98cb746c5f1d41327429195d316583e2dbdc0f34 100644 (file)
@@ -106,7 +106,7 @@ protected:
     Parameter * getNextOncanvasEditableParam();
 
     std::vector<Parameter *> param_vector;
-    std::vector<Parameter *>::iterator oncanvasedit_it;
+    int oncanvasedit_it;
 
 
     Inkscape::UI::Widget::Registry wr;