]> git.lyx.org Git - features.git/commitdiff
Reset the (running) change in PainterInfo
authorVincent van Ravesteijn <vfr@lyx.org>
Sun, 29 Apr 2012 11:44:58 +0000 (13:44 +0200)
committerVincent van Ravesteijn <vfr@lyx.org>
Sun, 29 Apr 2012 12:56:19 +0000 (14:56 +0200)
When an InsetText is deleted, all lines in the inset are painted as
deleted. This status should be restored afterwards. If not, insets will be
painted in the wrong color afterwards (e.g. tables).

src/rowpainter.cpp

index c5cc772fe8ecbdf5a4ef29a7298ce3b12844b34c..a9f8352df0fe2ad96cfdeb19cf120a94b0b5ae3e 100644 (file)
@@ -128,6 +128,7 @@ void RowPainter::paintInset(Inset const * inset, pos_type const pos)
        pi_.base.font = inset->inheritFont() ? font.fontInfo() :
                pi_.base.bv->buffer().params().getFont().fontInfo();
        pi_.ltr_pos = (bidi_.level(pos) % 2 == 0);
+       Change prev_change = change_;
        pi_.change_ = change_.changed() ? change_ : par_.lookupChange(pos);
 
        int const x1 = int(x_);
@@ -147,6 +148,7 @@ void RowPainter::paintInset(Inset const * inset, pos_type const pos)
 
        // Restore full_repaint status.
        pi_.full_repaint = pi_full_repaint;
+       pi_.change_ = prev_change;
 
 #ifdef DEBUG_METRICS
        int const x2 = x1 + dim.wid;