diff options
| author | Neil <nyamatongwe@gmail.com> | 2018-03-01 11:03:37 +1100 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2018-03-01 11:03:37 +1100 | 
| commit | ae4b1d41a3e763240a5e9f60f76cedab55e1e5e2 (patch) | |
| tree | b201f21a3c0bcae634b8633c1c3d8ea704529b46 /src/MarginView.cxx | |
| parent | 5b88f2c8d74cdeab860dc8a009428f9474bc2c8b (diff) | |
| download | scintilla-mirror-ae4b1d41a3e763240a5e9f60f76cedab55e1e5e2.tar.gz | |
Mark variables as const where simple.
Diffstat (limited to 'src/MarginView.cxx')
| -rw-r--r-- | src/MarginView.cxx | 20 | 
1 files changed, 10 insertions, 10 deletions
| diff --git a/src/MarginView.cxx b/src/MarginView.cxx index 121f7ecf6..ff19840c4 100644 --- a/src/MarginView.cxx +++ b/src/MarginView.cxx @@ -60,15 +60,15 @@ void DrawWrapMarker(Surface *surface, PRectangle rcPlace,  	surface->PenColour(wrapColour);  	enum { xa = 1 }; // gap before start -	int w = static_cast<int>(rcPlace.right - rcPlace.left) - xa - 1; +	const int w = static_cast<int>(rcPlace.right - rcPlace.left) - xa - 1;  	const bool xStraight = isEndMarker;  // x-mirrored symbol for start marker  	const int x0 = static_cast<int>(xStraight ? rcPlace.left : rcPlace.right - 1);  	const int y0 = static_cast<int>(rcPlace.top); -	int dy = static_cast<int>(rcPlace.bottom - rcPlace.top) / 5; -	int y = static_cast<int>(rcPlace.bottom - rcPlace.top) / 2 + dy; +	const int dy = static_cast<int>(rcPlace.bottom - rcPlace.top) / 5; +	const int y = static_cast<int>(rcPlace.bottom - rcPlace.top) / 2 + dy;  	struct Relative {  		Surface *surface; @@ -137,7 +137,7 @@ void MarginView::RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const View  		// for scroll bars and Visual Studio for its selection margin. The colour of this pattern is half  		// way between the chrome colour and the chrome highlight colour making a nice transition  		// between the window chrome and the content area. And it works in low colour depths. -		PRectangle rcPattern = PRectangle::FromInts(0, 0, patternSize, patternSize); +		const PRectangle rcPattern = PRectangle::FromInts(0, 0, patternSize, patternSize);  		// Initialize default colours based on the chrome colour scheme.  Typically the highlight is white.  		ColourDesired colourFMFill = vsDraw.selbar; @@ -162,7 +162,7 @@ void MarginView::RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const View  		pixmapSelPatternOffset1->FillRectangle(rcPattern, colourFMStripes);  		for (int y = 0; y < patternSize; y++) {  			for (int x = y % 2; x < patternSize; x += 2) { -				PRectangle rcPixel = PRectangle::FromInts(x, y, x + 1, y + 1); +				const PRectangle rcPixel = PRectangle::FromInts(x, y, x + 1, y + 1);  				pixmapSelPattern->FillRectangle(rcPixel, colourFMStripes);  				pixmapSelPatternOffset1->FillRectangle(rcPixel, colourFMFill);  			} @@ -184,7 +184,7 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc,  	if (rcSelMargin.bottom < rc.bottom)  		rcSelMargin.bottom = rc.bottom; -	Point ptOrigin = model.GetVisibleOriginInMain(); +	const Point ptOrigin = model.GetVisibleOriginInMain();  	FontAlias fontLineNumber = vs.styles[STYLE_LINENUMBER].font;  	for (size_t margin = 0; margin < vs.ms.size(); margin++) {  		if (vs.ms[margin].width > 0) { @@ -244,7 +244,7 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc,  					}  				}  				if (highlightDelimiter.isEnabled) { -					Sci::Line lastLine = model.cs.DocFromDisplay(topLine + model.LinesOnScreen()) + 1; +					const Sci::Line lastLine = model.cs.DocFromDisplay(topLine + model.LinesOnScreen()) + 1;  					model.pdoc->GetHighlightDelimiters(highlightDelimiter,  						static_cast<Sci::Line>(model.pdoc->LineFromPosition(model.sel.MainCaret())), lastLine);  				} @@ -387,8 +387,8 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc,  						}  						PRectangle rcNumber = rcMarker;  						// Right justify -						XYPOSITION width = surface->WidthText(fontLineNumber, number, static_cast<int>(strlen(number))); -						XYPOSITION xpos = rcNumber.right - width - vs.marginNumberPadding; +						const XYPOSITION width = surface->WidthText(fontLineNumber, number, static_cast<int>(strlen(number))); +						const XYPOSITION xpos = rcNumber.right - width - vs.marginNumberPadding;  						rcNumber.left = xpos;  						DrawTextNoClipPhase(surface, rcNumber, vs.styles[STYLE_LINENUMBER],  							rcNumber.top + vs.maxAscent, number, static_cast<int>(strlen(number)), drawAll); @@ -409,7 +409,7 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc,  							surface->FillRectangle(rcMarker,  								vs.styles[stMargin.StyleAt(0) + vs.marginStyleOffset].back);  							if (vs.ms[margin].style == SC_MARGIN_RTEXT) { -								int width = WidestLineWidth(surface, vs, vs.marginStyleOffset, stMargin); +								const int width = WidestLineWidth(surface, vs, vs.marginStyleOffset, stMargin);  								rcMarker.left = rcMarker.right - width - 3;  							}  							DrawStyledText(surface, vs, vs.marginStyleOffset, rcMarker, | 
