]> git.lyx.org Git - lyx.git/blobdiff - src/rowpainter.cpp
header ordering.
[lyx.git] / src / rowpainter.cpp
index 46544b3256826cbc9ee808a309e2255a7066e3ee..a0b554e676ae0e5a59a1934c6f602af1a3b22ad2 100644 (file)
@@ -655,15 +655,17 @@ void RowPainter::paintLast()
 
 void RowPainter::paintOnlyInsets()
 {
+       CoordCache const & cache = pi_.base.bv->coordCache();
        pos_type const end = row_.endpos();
        for (pos_type pos = row_.pos(); pos != end; ++pos) {
                // If outer row has changed, nested insets are repaint completely.
                Inset const * inset = par_.getInset(pos);
                if (!inset)
                        continue;
-               if (x_ > pi_.base.bv->workWidth())
+               if (x_ > pi_.base.bv->workWidth() 
+                   || !cache.getInsets().has(inset))
                        continue;
-               x_ = pi_.base.bv->coordCache().getInsets().x(inset);
+               x_ = cache.getInsets().x(inset);
 
                bool const pi_selected = pi_.selected;
                Cursor const & cur = pi_.base.bv->cursor();