From cda15af9657880e91ccf65603e109b202d9e78bf Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 6 Apr 2017 21:04:37 +1000 Subject: Added const where possible. --- src/MarginView.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/MarginView.cxx') diff --git a/src/MarginView.cxx b/src/MarginView.cxx index be743213d..27bf1e10d 100644 --- a/src/MarginView.cxx +++ b/src/MarginView.cxx @@ -64,10 +64,10 @@ void DrawWrapMarker(Surface *surface, PRectangle rcPlace, enum { xa = 1 }; // gap before start int w = static_cast(rcPlace.right - rcPlace.left) - xa - 1; - bool xStraight = isEndMarker; // x-mirrored symbol for start marker + const bool xStraight = isEndMarker; // x-mirrored symbol for start marker - int x0 = static_cast(xStraight ? rcPlace.left : rcPlace.right - 1); - int y0 = static_cast(rcPlace.top); + const int x0 = static_cast(xStraight ? rcPlace.left : rcPlace.right - 1); + const int y0 = static_cast(rcPlace.top); int dy = static_cast(rcPlace.bottom - rcPlace.top) / 5; int y = static_cast(rcPlace.bottom - rcPlace.top) / 2 + dy; @@ -205,7 +205,7 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, // Required because of special way brush is created for selection margin // Ensure patterns line up when scrolling with separate margin view // by choosing correctly aligned variant. - bool invertPhase = static_cast(ptOrigin.y) & 1; + const bool invertPhase = static_cast(ptOrigin.y) & 1; surface->FillRectangle(rcSelMargin, invertPhase ? *pixmapSelPattern : *pixmapSelPatternOffset1); } else { @@ -238,7 +238,7 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, // be displayed until the last of a sequence of whitespace. bool needWhiteClosure = false; if (vs.ms[margin].mask & SC_MASK_FOLDERS) { - int level = model.pdoc->GetLevel(model.cs.DocFromDisplay(visibleLine)); + const int level = model.pdoc->GetLevel(model.cs.DocFromDisplay(visibleLine)); if (level & SC_FOLDLEVELWHITEFLAG) { Sci::Line lineBack = model.cs.DocFromDisplay(visibleLine); int levelPrev = level; @@ -380,7 +380,7 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, sprintf(number, "%d", lineDoc + 1); if (model.foldFlags & (SC_FOLDFLAG_LEVELNUMBERS | SC_FOLDFLAG_LINESTATE)) { if (model.foldFlags & SC_FOLDFLAG_LEVELNUMBERS) { - int lev = model.pdoc->GetLevel(lineDoc); + const int lev = model.pdoc->GetLevel(lineDoc); sprintf(number, "%c%c %03X %03X", (lev & SC_FOLDLEVELHEADERFLAG) ? 'H' : '_', (lev & SC_FOLDLEVELWHITEFLAG) ? 'W' : '_', @@ -388,7 +388,7 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, lev >> 16 ); } else { - int state = model.pdoc->GetLineState(lineDoc); + const int state = model.pdoc->GetLineState(lineDoc); sprintf(number, "%0X", state); } } -- cgit v1.2.3