]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_undersetinset.C
revert Buffer LyxText->InsetText commit
[lyx.git] / src / mathed / math_undersetinset.C
index 8162266a1792bbace92936be30c37b67ef4dda1a..74b8f0494d1b092e0557417fc84b8e2931867221 100644 (file)
 #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));
@@ -47,30 +48,29 @@ void MathUndersetInset::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-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;
 }