Fix bug 5666: assertion when an inset is outside of workwidth

http://bugzilla.lyx.org/show_bug.cgi?id=5666

Check whether an inset is in the coordcache before reading this cache (doh!)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28439 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2009-02-10 22:27:43 +00:00
parent fb3d47a14d
commit 2d66dbb678

View File

@ -655,15 +655,17 @@ void RowPainter::paintLast()
void RowPainter::paintOnlyInsets() void RowPainter::paintOnlyInsets()
{ {
CoordCache const & cache = pi_.base.bv->coordCache();
pos_type const end = row_.endpos(); pos_type const end = row_.endpos();
for (pos_type pos = row_.pos(); pos != end; ++pos) { for (pos_type pos = row_.pos(); pos != end; ++pos) {
// If outer row has changed, nested insets are repaint completely. // If outer row has changed, nested insets are repaint completely.
Inset const * inset = par_.getInset(pos); Inset const * inset = par_.getInset(pos);
if (!inset) if (!inset)
continue; continue;
if (x_ > pi_.base.bv->workWidth()) if (x_ > pi_.base.bv->workWidth()
|| !cache.getInsets().has(inset))
continue; continue;
x_ = pi_.base.bv->coordCache().getInsets().x(inset); x_ = cache.getInsets().x(inset);
bool const pi_selected = pi_.selected; bool const pi_selected = pi_.selected;
Cursor const & cur = pi_.base.bv->cursor(); Cursor const & cur = pi_.base.bv->cursor();