]> git.lyx.org Git - features.git/commitdiff
Fix bug #6158: Crash when entering math in tabular.
authorVincent van Ravesteijn <vfr@lyx.org>
Tue, 18 Aug 2009 18:34:22 +0000 (18:34 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Tue, 18 Aug 2009 18:34:22 +0000 (18:34 +0000)
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

index 1738869e18062fe9a2805ca0df7e36ea982c9c85..7b13e010bcbfcbc9d6a8f7398b7f2c590541dcf7 100644 (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){