Fix bug #6351: Crash when editing the unit on a number

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32211 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2009-11-26 01:56:50 +00:00
parent 9e5f3a9423
commit ae40a33202

View File

@ -42,7 +42,9 @@ InsetMathFracBase::InsetMathFracBase(Buffer * buf, idx_type ncells)
bool InsetMathFracBase::idxUpDown(Cursor & cur, bool up) const
{
InsetMath::idx_type target = !up; // up ? 0 : 1, since upper cell has idx 0
// If we only have one cell, target = 0, otherwise
// target = up ? 0 : 1, since upper cell has idx 0
InsetMath::idx_type target = nargs() > 1 ? !up : 0;
if (cur.idx() == target)
return false;
cur.idx() = target;