]> git.lyx.org Git - features.git/commitdiff
fix old off-by-one bug resulting in a coordcache assert
authorAndré Pönitz <poenitz@gmx.net>
Sat, 16 Jul 2005 17:55:49 +0000 (17:55 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sat, 16 Jul 2005 17:55:49 +0000 (17:55 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10256 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_gridinset.C

index 56720c61dda02f059d52a566ec924b7cb4e5b86a..ece8d90158973779c70c3862d9c54241de2c1bdc 100644 (file)
@@ -776,11 +776,11 @@ int MathGridInset::cellYOffset(idx_type idx) const
 bool MathGridInset::idxUpDown(LCursor & cur, bool up) const
 {
        if (up) {
-               if (cur.idx() < ncols())
+               if (cur.row() == 0)
                        return false;
                cur.idx() -= ncols();
        } else {
-               if (cur.row() >= nrows())
+               if (cur.row() + 1 >= nrows())
                        return false;
                cur.idx() += ncols();
        }