fix out-of-bounds bug

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2864 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-10-12 07:52:13 +00:00
parent cdc0cab2bc
commit 739f74c54a

View File

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