#include "math_undersetinset.h"
#include "math_data.h"
#include "math_mathmlstream.h"
-
+#include "cursor.h"
using std::max;
using std::auto_ptr;
+
auto_ptr<InsetBase> MathUndersetInset::clone() const
{
return auto_ptr<InsetBase>(new MathUndersetInset(*this));
}
-bool MathUndersetInset::idxFirst(idx_type & i, pos_type & pos) const
+bool MathUndersetInset::idxFirst(LCursor & cur) const
{
- i = 1;
- pos = 0;
+ cur.idx() = 1;
+ cur.pos() = 0;
return true;
}
-bool MathUndersetInset::idxLast(idx_type & i, pos_type & pos) const
+bool MathUndersetInset::idxLast(LCursor & cur) const
{
- i = 1;
- pos = cell(i).size();
+ cur.idx() = 1;
+ cur.pos() = cur.lastpos();
return true;
}
-bool MathUndersetInset::idxUpDown(idx_type & idx, pos_type & pos, bool up,
- int targetx) const
+bool MathUndersetInset::idxUpDown(LCursor & cur, bool up) const
{
idx_type target = up; // up ? 1 : 0, since upper cell has idx 1
- if (idx == target)
+ if (cur.idx() == target)
return false;
- idx = target;
- pos = cell(idx).x2pos(targetx);
+ cur.idx() = target;
+ cur.pos() = cur.cell().x2pos(cur.x_target());
return true;
}