]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_fracbase.C
use stream-like syntax for LaTeX output
[lyx.git] / src / mathed / math_fracbase.C
index 9736d348fd368ea8437fd393a05bd27e0dc1bd54..0cb0086bb2fb93e0403091b9df4853d6a0062a7b 100644 (file)
@@ -10,63 +10,37 @@ MathFracbaseInset::MathFracbaseInset()
 {}
 
 
-bool MathFracbaseInset::idxRight(int &, int &) const
+bool MathFracbaseInset::idxRight(MathInset::idx_type &,
+                                MathInset::pos_type &) const
 {
        return false;
 }
 
 
-bool MathFracbaseInset::idxLeft(int &, int &) const
+bool MathFracbaseInset::idxLeft(MathInset::idx_type &,
+                               MathInset::pos_type &) const
 {
        return false;
 }
 
 
-bool MathFracbaseInset::idxUp(int & idx, int &) const
+bool MathFracbaseInset::idxUp(MathInset::idx_type & idx,
+                             MathInset::pos_type & pos) const
 {
        if (idx == 0)
                return false;
        idx = 0;
+       pos = std::min(pos, cell(idx).size());
        return true;
 }
 
 
-bool MathFracbaseInset::idxDown(int & idx, int &) const
+bool MathFracbaseInset::idxDown(MathInset::idx_type & idx,
+                               MathInset::pos_type & pos) const
 {
        if (idx == 1)
                return false;
        idx = 1;
-       return true;
-}
-
-
-bool MathFracbaseInset::idxFirstUp(int & idx, int & pos) const
-{
-       idx = 0;
-       pos = 0;
-       return true;
-}
-
-
-bool MathFracbaseInset::idxFirstDown(int & idx, int & pos) const
-{
-       idx = 1;
-       pos = 0;
-       return true;
-}
-
-
-bool MathFracbaseInset::idxLastUp(int & idx, int & pos) const
-{
-       idx = 0;
-       pos = cell(idx).size();
-       return true;
-}
-
-
-bool MathFracbaseInset::idxLastDown(int & idx, int & pos) const
-{
-       idx = 1;
-       pos = cell(idx).size();
+       pos = std::min(pos, cell(idx).size());
        return true;
 }