]> git.lyx.org Git - features.git/commitdiff
Better fix than revision 22553. Transfer the backup to RowPainter::paintInset().
authorAbdelrazak Younes <younes@lyx.org>
Mon, 14 Jan 2008 16:24:01 +0000 (16:24 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 14 Jan 2008 16:24:01 +0000 (16:24 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22554 a592a061-630c-0410-9148-cb99ea01b6c8

src/TextMetrics.cpp
src/rowpainter.cpp

index a57253ecc9b1567ea64f68eb4072eca542db57fc..360b3c772abf703f4075d20557e219641bd591fc 100644 (file)
@@ -1895,15 +1895,10 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type pit, int x, int y) co
                // Don't paint the row if a full repaint has not been requested
                // and if it has not changed.
                if (!pi.full_repaint && !row_has_changed) {
-                       // Backup full_repaint status because some Inset (InsetTabular)
-                       // requires a full repaint
-                       bool tmp = pi.full_repaint;
                        // Paint only the insets if the text itself is
                        // unchanged.
                        rp.paintOnlyInsets();
                        y += row.descent();
-                       // Restore full_repaint status.
-                       pi.full_repaint = tmp;
                        continue;
                }
 
index cd19b72389b3d7903cb01be77046c11e6ed2422c..dc0ed5f1cccb42fda054d70086308b5bffc25f25 100644 (file)
@@ -96,6 +96,10 @@ void RowPainter::paintInset(Inset const * inset, pos_type const pos)
        Font const font = text_metrics_.getDisplayFont(pit_, pos);
 
        BOOST_ASSERT(inset);
+       // Backup full_repaint status because some insets (InsetTabular)
+       // requires a full repaint
+       bool pi_full_repaint = pi_.full_repaint;
+
        // FIXME: We should always use font, see documentation of
        // noFontChange() in Inset.h.
        pi_.base.font = inset->noFontChange() ?
@@ -114,6 +118,9 @@ void RowPainter::paintInset(Inset const * inset, pos_type const pos)
 
        x_ += dim.width();
 
+       // Restore full_repaint status.
+       pi_.full_repaint = pi_full_repaint;
+
 #ifdef DEBUG_METRICS
        int const x1 = int(x_ - dim.width());
        Dimension dim2;