* text2.C: tiny optimisation in LyXText::editXY()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15878
a592a061-630c-0410-9148-
cb99ea01b6c8
// Add contribution of initial rows of outermost paragraph
CursorSlice const & sl = dit[0];
Paragraph const & par = sl.text()->getPar(sl.pit());
- // FIXME: I wonder if a case exists where this could happen:
+ if (par.rows().empty())
+ // FIXME: The special case below happens for empty paragraph creation
+ const_cast<LyXText *>(sl.text())->redoParagraph(const_cast<BufferView &>(bv), sl.pit());
BOOST_ASSERT(!par.rows().empty());
y -= par.rows()[0].ascent();
#if 1
return 0;
}
- InsetBase * insetBefore = pars_[pit].getInset(pos - 1);
+ InsetBase * insetBefore = pos? pars_[pit].getInset(pos - 1): 0;
//InsetBase * insetBehind = pars_[pit].getInset(pos);
// This should be just before or just behind the