From 6bc8b8c592b6d5fa44e5037b25ff04e01e78d7ff Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Tue, 18 Aug 2009 18:34:22 +0000 Subject: [PATCH] Fix bug #6158: Crash when entering math in tabular. We have to determine whether we are in an empty cell before we dispatch the lfun to the inset. Otherwise we determine whether the math is empty and if so, we then go to the next cell in the math inset. This cell doesn't exist probably. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31121 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetTabular.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 1738869e18..7b13e010bc 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3510,11 +3510,11 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) && cur.pos() == cur.lastpos()) || (!next_cell && cur.pit() == 0 && cur.pos() == 0)); + bool const empty_cell = cur.lastpos() == 0 && cur.lastpit() == 0; + // ...try to dispatch to the cell's inset. cell(cur.idx())->dispatch(cur, cmd); - bool const empty_cell = cur.lastpos() == 0 && cur.lastpit() == 0; - // When we already have a selection we want to select the whole cell // before going to the next cell. if (select_whole && !empty_cell){