* bufferview_funcs.C: reconstruct par.rows() in case of empty par creation.

* text2.C: tiny optimisation in LyXText::editXY()


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15878 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2006-11-12 11:24:27 +00:00
parent 2625a23437
commit 5514cc9901
2 changed files with 4 additions and 2 deletions

View File

@ -177,7 +177,9 @@ Point coordOffset(BufferView const & bv, DocIterator const & dit,
// 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

View File

@ -986,7 +986,7 @@ InsetBase * LyXText::editXY(LCursor & cur, int x, int y)
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