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
This commit is contained in:
André Pönitz 2004-01-07 08:36:30 +00:00
parent 4ad759dbc4
commit 6c2ebc8c1a
2 changed files with 3 additions and 1 deletions

View 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);

View 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;