]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_fracbase.C
Make Helge happy: no more crash on arrow up/down in math macro
[lyx.git] / src / mathed / math_fracbase.C
index 24b79f40b20a92527a30037b0e77c59214da53f1..f55f7fe8d402f212a06fe5c3b0b664607ea7b744 100644 (file)
@@ -11,6 +11,8 @@
 #include <config.h>
 
 #include "math_fracbase.h"
+#include "math_data.h"
+#include "cursor.h"
 
 
 MathFracbaseInset::MathFracbaseInset()
@@ -18,25 +20,24 @@ MathFracbaseInset::MathFracbaseInset()
 {}
 
 
-bool MathFracbaseInset::idxRight(idx_type &, pos_type &) const
+bool MathFracbaseInset::idxRight(LCursor &) const
 {
        return false;
 }
 
 
-bool MathFracbaseInset::idxLeft(idx_type &, pos_type &) const
+bool MathFracbaseInset::idxLeft(LCursor &) const
 {
        return false;
 }
 
 
-bool MathFracbaseInset::idxUpDown(idx_type & idx, pos_type & pos, bool up,
-       int targetx) const
+bool MathFracbaseInset::idxUpDown(LCursor & cur, bool up) const
 {
        MathInset::idx_type target = !up; // up ? 0 : 1, since upper cell has idx 0
-       if (idx == target)
+       if (cur.idx() == target)
                return false;
-       idx = target;
-       pos = cell(idx).x2pos(targetx);
+       cur.idx() = target;
+       cur.pos() = cell(target).x2pos(cur.x_target());
        return true;
 }