From 6c2ebc8c1ab971d7fb8e9d7ae9d417d5cb7ea9cd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 7 Jan 2004 08:36:30 +0000 Subject: [PATCH] prevent crash in cursorX when row cache is empty git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8311 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_scriptinset.C | 2 +- src/text.C | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mathed/math_scriptinset.C b/src/mathed/math_scriptinset.C index 3c226e2ab3..1118070fe7 100644 --- a/src/mathed/math_scriptinset.C +++ b/src/mathed/math_scriptinset.C @@ -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); diff --git a/src/text.C b/src/text.C index f7bb174469..4f20575b5a 100644 --- a/src/text.C +++ b/src/text.C @@ -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; -- 2.39.2