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
This commit is contained in:
Vincent van Ravesteijn 2009-08-18 18:34:22 +00:00
parent 6b6567a538
commit 6bc8b8c592

View File

@ -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){