-
#include <config.h>
#include "math_iterator.h"
return;
}
- // otherwise move on one cell if possible
- if (top.idx_ + 1 < top.par_->nargs()) {
+ // otherwise try to move on one cell if possible
+ while (top.idx_ + 1 < top.par_->nargs()) {
// idx() == nargs() is _not_ valid!
++top.idx_;
- top.pos_ = 0;
- return;
+ if (top.par_->validCell(top.idx_)) {
+ top.pos_ = 0;
+ return;
+ }
}
// otherwise leave array, move on one position
// this might yield pos() == size(), but that's a ok.
- pop();
+ pop();
// it certainly invalidates top
++position().pos_;
}
//lyxerr << "==: " << it.cursor().size() << " " << jt.cursor().size() << endl;
if (it.cursor().size() != jt.cursor().size())
return false;
- return it.cursor() == jt.cursor();
+ return it.cursor() == jt.cursor();
}
//lyxerr << "!=: " << it.cursor().size() << " " << jt.cursor().size() << endl;
if (it.cursor().size() != jt.cursor().size())
return true;
- return it.cursor() != jt.cursor();
+ return it.cursor() != jt.cursor();
}