Make Helge happy: no more crash on arrow up/down in math macro

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9792 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2005-04-08 12:15:28 +00:00
parent f7d7a58f78
commit 331824c537
2 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2005-04-07 Martin Vermeer <martin.vermeer@hut.fi>
* math_nestinset.C (doDispatch): Fix arrow up/down inside
macro crashing bug (Helge Hafting report)
2005-04-07 Martin Vermeer <martin.vermeer@hut.fi> 2005-04-07 Martin Vermeer <martin.vermeer@hut.fi>
* math_gridinset.C (getStatus): allow C-Tab to split cell * math_gridinset.C (getStatus): allow C-Tab to split cell

View File

@ -496,6 +496,12 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd)
case LFUN_UPSEL: case LFUN_UPSEL:
case LFUN_UP: case LFUN_UP:
// FIXME Tried to use clearTargetX and macroModeClose, crashed on cur.up()
if (cur.inMacroMode()) {
// Make Helge happy
cur.macroModeClose();
break;
}
cur.selHandle(cmd.action == LFUN_UPSEL); cur.selHandle(cmd.action == LFUN_UPSEL);
if (!cur.up()) if (!cur.up())
cmd = FuncRequest(LFUN_FINISHED_UP); cmd = FuncRequest(LFUN_FINISHED_UP);
@ -505,6 +511,10 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd)
case LFUN_DOWNSEL: case LFUN_DOWNSEL:
case LFUN_DOWN: case LFUN_DOWN:
if (cur.inMacroMode()) {
cur.macroModeClose();
break;
}
cur.selHandle(cmd.action == LFUN_DOWNSEL); cur.selHandle(cmd.action == LFUN_DOWNSEL);
if (!cur.down()) if (!cur.down())
cmd = FuncRequest(LFUN_FINISHED_DOWN); cmd = FuncRequest(LFUN_FINISHED_DOWN);