]> git.lyx.org Git - features.git/commitdiff
fix out-of-bounds bug
authorAndré Pönitz <poenitz@gmx.net>
Fri, 12 Oct 2001 07:52:13 +0000 (07:52 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 12 Oct 2001 07:52:13 +0000 (07:52 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2864 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_fracbase.C

index aa17ea7e82f5aa40003cd1bde0ec4e320f6ae856..0cb0086bb2fb93e0403091b9df4853d6a0062a7b 100644 (file)
@@ -25,20 +25,22 @@ bool MathFracbaseInset::idxLeft(MathInset::idx_type &,
 
 
 bool MathFracbaseInset::idxUp(MathInset::idx_type & idx,
-                             MathInset::pos_type &) const
+                             MathInset::pos_type & pos) const
 {
        if (idx == 0)
                return false;
        idx = 0;
+       pos = std::min(pos, cell(idx).size());
        return true;
 }
 
 
 bool MathFracbaseInset::idxDown(MathInset::idx_type & idx,
-                               MathInset::pos_type &) const
+                               MathInset::pos_type & pos) const
 {
        if (idx == 1)
                return false;
        idx = 1;
+       pos = std::min(pos, cell(idx).size());
        return true;
 }