bool InsetMathUnderset::idxUpDown(Cursor & cur, bool up) const { idx_type target = up; // up ? 1 : 0, since upper cell has idx 1 if (cur.idx() == target) return false; cur.idx() = target; cur.pos() = cur.cell().x2pos(&cur.bv(), cur.x_target()); return true; }
bool InsetMathFracBase::idxUpDown(Cursor & cur, bool up) const { // If we only have one cell, target = 0, otherwise // target = up ? 0 : 1, since upper cell has idx 0 InsetMath::idx_type target = nargs() > 1 ? !up : 0; if (cur.idx() == target) return false; cur.idx() = target; cur.pos() = cell(target).x2pos(&cur.bv(), cur.x_target()); return true; }
bool InsetMathFrac::idxForward(Cursor & cur) const { InsetMath::idx_type target = 0; if (kind_ == UNIT || (kind_ == UNITFRAC && nargs() == 3)) { if (nargs() == 3) target = 0; else if (nargs() == 2) target = 1; } else return false; if (cur.idx() == target) return false; cur.idx() = target; cur.pos() = cell(target).x2pos(&cur.bv(), cur.x_target()); return true; }
bool InsetMathScript::idxLast(Cursor & cur) const { cur.idx() = 0; cur.pos() = nuc().size(); return true; }
bool InsetMathScript::idxFirst(Cursor & cur) const { cur.idx() = 0; cur.pos() = 0; return true; }
bool InsetMathUnderset::idxLast(Cursor & cur) const { cur.idx() = 1; cur.pos() = cur.lastpos(); return true; }
bool InsetMathUnderset::idxFirst(Cursor & cur) const { cur.idx() = 1; cur.pos() = 0; return true; }