fix old off-by-one bug resulting in a coordcache assert

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10256 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2005-07-16 17:55:49 +00:00
parent 73024d44b0
commit 6d8ce8c308

View 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();
}