From ae40a33202579647c815206e5e676b3f72008a23 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Thu, 26 Nov 2009 01:56:50 +0000 Subject: [PATCH] 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 --- src/mathed/InsetMathFrac.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp index 7f5323b8d6..3a1fac1227 100644 --- a/src/mathed/InsetMathFrac.cpp +++ b/src/mathed/InsetMathFrac.cpp @@ -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; -- 2.39.5