]> git.lyx.org Git - features.git/commitdiff
prevent crash in cursorX when row cache is empty
authorAndré Pönitz <poenitz@gmx.net>
Wed, 7 Jan 2004 08:36:30 +0000 (08:36 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Wed, 7 Jan 2004 08:36:30 +0000 (08:36 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8311 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_scriptinset.C
src/text.C

index 3c226e2ab3f04ece5185d0e314c26dd27d669c03..1118070fe76bf63b34a64b20214b594673d123a0 100644 (file)
@@ -525,7 +525,7 @@ MathScriptInset::priv_dispatch(FuncRequest const & cmd,
                        else
                                limits_ = 0;
                } else if (limits_ == 0)
-                       limits_ =  (hasLimits()) ? -1 : 1;
+                       limits_ = hasLimits() ? -1 : 1;
                else
                        limits_ = 0;
                return DispatchResult(true, true);
index f7bb174469445ea0859dfa76f0a9c1433a7cbdd1..4f20575b5ae9025d16974dd453c41258a88adef1 100644 (file)
@@ -1870,6 +1870,8 @@ int LyXText::cursorY() const
 int LyXText::cursorX(LyXCursor const & cur) const
 {
        ParagraphList::iterator pit = getPar(cur);
+       if (pit->rows.empty())
+               return 0;
        Row const & row         = *pit->getRow(cur.pos());
        pos_type pos            = cur.pos();
        pos_type cursor_vpos    = 0;