//lyxerr << "searching '" << str << "' in " << this << ar << endl;
for (MathIterator it = current; it != iend(par().nucleus()); ++it) {
- if (it.cell().matchpart(ar, it.back().pos_)) {
+ CursorSlice & top = it.back();
+ MathArray const & a = top.asMathInset()->cell(top.idx_);
+ if (a.matchpart(ar, top.pos_)) {
delete mathcursor;
mathcursor = new MathCursor(this, true);
//metrics(bv);
mathcursor->setSelection(it, ar.size());
current = it;
- it.back().pos_ += ar.size();
+ top.pos_ += ar.size();
bv->update();
return true;
}
MathIterator it = Cursor_;
it.back().setPos(0);
MathIterator et = Cursor_;
- et.back().setPos(it.cell().size());
+ int n = et.back().asMathInset()->cell(et.back().idx_).size();
+ et.back().setPos(n);
for (int i = 0; ; ++i) {
int xo, yo;
it.back().getPos(xo, yo);
#include <boost/assert.hpp>
-MathArray const & MathIterator::cell() const
-{
- CursorSlice const & top = back();
- return top.asMathInset()->cell(top.idx_);
-}
-
-
void MathIterator::operator++()
{
CursorSlice & top = back();
{
MathIterator it;
it.push_back(CursorSlice(p));
- return it;
CursorSlice & top = it.back();
top.idx_ = top.asMathInset()->nargs() - 1;
- top.pos_ = it.cell().size();
+ top.pos_ = top.asMathInset()->cell(top.idx_).size();
return it;
}