From a187cbeb64a9bb02d38d22f8a5249d149a224070 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 14 Jan 2020 11:50:44 +0100 Subject: [PATCH] Rename PainterMetrics::change_ to change This is not a private variable. --- src/MetricsInfo.cpp | 6 +++--- src/MetricsInfo.h | 2 +- src/RowPainter.cpp | 6 +++--- src/insets/InsetCollapsible.cpp | 16 ++++++++-------- src/insets/InsetText.cpp | 10 +++++----- src/insets/RenderGraphic.cpp | 4 ++-- src/insets/RenderPreview.cpp | 4 ++-- src/mathed/InsetMathHull.cpp | 4 ++-- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/MetricsInfo.cpp b/src/MetricsInfo.cpp index 93c6e396f1..537efd351b 100644 --- a/src/MetricsInfo.cpp +++ b/src/MetricsInfo.cpp @@ -131,7 +131,7 @@ MetricsInfo::MetricsInfo(BufferView * bv, FontInfo font, int textwidth, ///////////////////////////////////////////////////////////////////////// PainterInfo::PainterInfo(BufferView * bv, lyx::frontend::Painter & painter) - : pain(painter), ltr_pos(false), change_(), selected(false), + : pain(painter), ltr_pos(false), change(), selected(false), do_spellcheck(true), full_repaint(true), background_color(Color_background), leftx(0), rightx(0) { @@ -178,8 +178,8 @@ ColorCode PainterInfo::backgroundColor(Inset const * inset, bool sel) const Color PainterInfo::textColor(Color const & color) const { - if (change_.changed()) - return change_.color(); + if (change.changed()) + return change.color(); if (selected) return Color_selectiontext; return color; diff --git a/src/MetricsInfo.h b/src/MetricsInfo.h index 066d87ce3f..3ad59cd4c6 100644 --- a/src/MetricsInfo.h +++ b/src/MetricsInfo.h @@ -134,7 +134,7 @@ public: /// Whether the text at this point is right-to-left (for insets) bool ltr_pos; /// The change the parent is part of (change tracking) - Change change_; + Change change; /// Whether the parent is selected as a whole bool selected; /// Whether the spell checker is enabled for the parent diff --git a/src/RowPainter.cpp b/src/RowPainter.cpp index b36fab9e4c..13c3be0196 100644 --- a/src/RowPainter.cpp +++ b/src/RowPainter.cpp @@ -95,12 +95,12 @@ void RowPainter::paintInset(Row::Element const & e) const // requires a full repaint bool const pi_full_repaint = pi_.full_repaint; bool const pi_do_spellcheck = pi_.do_spellcheck; - Change const pi_change = pi_.change_; + Change const pi_change = pi_.change; pi_.base.font = e.inset->inheritFont() ? e.font.fontInfo() : pi_.base.bv->buffer().params().getFont().fontInfo(); pi_.ltr_pos = !e.font.isVisibleRightToLeft(); - pi_.change_ = pi_.change_.changed() ? pi_.change_ : e.change; + pi_.change = pi_.change.changed() ? pi_.change : e.change; pi_.do_spellcheck &= e.inset->allowSpellCheck(); int const x1 = int(x_); @@ -115,7 +115,7 @@ void RowPainter::paintInset(Row::Element const & e) const // Restore full_repaint status. pi_.full_repaint = pi_full_repaint; - pi_.change_ = pi_change; + pi_.change = pi_change; pi_.do_spellcheck = pi_do_spellcheck; pi_.selected = pi_selected; diff --git a/src/insets/InsetCollapsible.cpp b/src/insets/InsetCollapsible.cpp index d07123ba2f..cb9e23a33d 100644 --- a/src/insets/InsetCollapsible.cpp +++ b/src/insets/InsetCollapsible.cpp @@ -268,7 +268,7 @@ void InsetCollapsible::draw(PainterInfo & pi, int x, int y) const // Draw the change tracking cue on the label, unless RowPainter already // takes care of it. if (canPaintChange(bv)) - pi.change_.paintCue(pi, x, y, x + dimc.width(), labelfont); + pi.change.paintCue(pi, x, y, x + dimc.width(), labelfont); } else { view_[&bv].button_dim_.x1 = 0; view_[&bv].button_dim_.y1 = 0; @@ -292,8 +292,8 @@ void InsetCollapsible::draw(PainterInfo & pi, int x, int y) const } // Do not draw the cue for INSERTED -- it is already in the button and // that's enough. - Changer cdummy = (pi.change_.type == Change::INSERTED) - ? make_change(pi.change_, Change()) + Changer cdummy = (pi.change.type == Change::INSERTED) + ? make_change(pi.change, Change()) : Changer(); InsetText::draw(pi, textx, texty); break; @@ -312,7 +312,7 @@ void InsetCollapsible::draw(PainterInfo & pi, int x, int y) const // We will take care of the frame and the change tracking cue // ourselves, below. { - Changer cdummy = make_change(pi.change_, Change()); + Changer cdummy = make_change(pi.change, Change()); const_cast(this)->setDrawFrame(false); InsetText::draw(pi, textx, texty); const_cast(this)->setDrawFrame(true); @@ -323,7 +323,7 @@ void InsetCollapsible::draw(PainterInfo & pi, int x, int y) const desc -= 3; // Colour the frame according to the change type. (Like for tables.) - Color colour = pi.change_.changed() ? pi.change_.color() + Color colour = pi.change.changed() ? pi.change.color() : Color_foreground; const int xx1 = x + TEXT_TO_INSET_OFFSET - 1; const int xx2 = x + textdim.wid - TEXT_TO_INSET_OFFSET + 1; @@ -345,7 +345,7 @@ void InsetCollapsible::draw(PainterInfo & pi, int x, int y) const // the label below the text. Can be toggled. if (g == SubLabel) { FontInfo font(getLabelfont()); - if (pi.change_.changed()) + if (pi.change.changed()) font.setPaintColor(colour); font.realize(sane_font); font.decSize(); @@ -371,8 +371,8 @@ void InsetCollapsible::draw(PainterInfo & pi, int x, int y) const } // Strike through the inset if deleted and not already handled by // RowPainter. - if (pi.change_.deleted() && canPaintChange(bv)) - pi.change_.paintCue(pi, xx1, y1, xx2, y + desc); + if (pi.change.deleted() && canPaintChange(bv)) + pi.change.paintCue(pi, xx1, y1, xx2, y + desc); break; } } diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index f3e33f0267..e7ec78a8f9 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -228,7 +228,7 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const Changer dummy = make_change(pi.background_color, pi.backgroundColor(this, false)); // The change tracking cue must not be inherited - Changer dummy2 = make_change(pi.change_, Change()); + Changer dummy2 = make_change(pi.change, Change()); tm.draw(pi, x + TEXT_TO_INSET_OFFSET, y); } @@ -237,7 +237,7 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const // Only do so if the color is not custom. But do so even if RowPainter // handles the strike-through already. Color c; - if (pi.change_.changed() + if (pi.change.changed() // Originally, these are the colors with role Text, from role() in // ColorCache.cpp. The code is duplicated to avoid depending on Qt // types, and also maybe it need not match in the future. @@ -246,18 +246,18 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const || frameColor() == Color_preview || frameColor() == Color_tabularline || frameColor() == Color_previewframe)) { - c = pi.change_.color(); + c = pi.change.color(); change_drawn = true; } else c = frameColor(); pi.pain.rectangle(xframe, yframe, w, h, c); } - if (canPaintChange(*pi.base.bv) && (!change_drawn || pi.change_.deleted())) + if (canPaintChange(*pi.base.bv) && (!change_drawn || pi.change.deleted())) // Do not draw the change tracking cue if already done by RowPainter and // do not draw the cue for INSERTED if the information is already in the // color of the frame - pi.change_.paintCue(pi, xframe, yframe, xframe + w, yframe + h); + pi.change.paintCue(pi, xframe, yframe, xframe + w, yframe + h); } diff --git a/src/insets/RenderGraphic.cpp b/src/insets/RenderGraphic.cpp index e48a0fa391..743c60f7c2 100644 --- a/src/insets/RenderGraphic.cpp +++ b/src/insets/RenderGraphic.cpp @@ -199,7 +199,7 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const pi.pain.image(x1, y1, w, h, *loader_.image()); else { - Color c = pi.change_.changed() ? pi.change_.color() : Color_foreground; + Color c = pi.change.changed() ? pi.change.color() : Color_foreground; pi.pain.rectangle(x1, y1, w, h, c); // Print the file name. @@ -221,7 +221,7 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const pi.pain.text(x1 + 6, y - 4, msg, msgFont); } } - pi.change_.paintCue(pi, x1, y1, x1 + w, y1 + h); + pi.change.paintCue(pi, x1, y1, x1 + w, y1 + h); } diff --git a/src/insets/RenderPreview.cpp b/src/insets/RenderPreview.cpp index dc58eb93e6..d626b3c50c 100644 --- a/src/insets/RenderPreview.cpp +++ b/src/insets/RenderPreview.cpp @@ -183,8 +183,8 @@ void RenderPreview::draw(PainterInfo & pi, int x, int y) const y - theFontMetrics(font).maxAscent() - 4, stat, font); } - pi.change_.paintCue(pi, x, y - dim_.asc, - x + dim_.width(), y - dim_.asc + dim_.height()); + pi.change.paintCue(pi, x, y - dim_.asc, + x + dim_.width(), y - dim_.asc + dim_.height()); } diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 2413af3e86..b15594e19a 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -650,7 +650,7 @@ void InsetMathHull::draw(PainterInfo & pi, int x, int y) const if (previewState(bv)) { // Do not draw change tracking cue if taken care of by RowPainter // already. - Changer dummy = !canPaintChange(*bv) ? make_change(pi.change_, Change()) + Changer dummy = !canPaintChange(*bv) ? make_change(pi.change, Change()) : Changer(); if (previewTooSmall(pi.base, dim)) { // we have an extra frame @@ -700,7 +700,7 @@ void InsetMathHull::draw(PainterInfo & pi, int x, int y) const if (canPaintChange(*bv)) { // like in metrics() int const display_margin = display() ? pi.base.inPixels(Length(12, Length::PT)) : 0; - pi.change_.paintCue(pi, x + 1, y + 1 - dim.asc + display_margin, + pi.change.paintCue(pi, x + 1, y + 1 - dim.asc + display_margin, x + dim.wid, y + dim.des - display_margin); } } -- 2.39.5