diff options
| author | Neil <nyamatongwe@gmail.com> | 2020-07-16 09:16:44 +1000 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2020-07-16 09:16:44 +1000 | 
| commit | 47aa162ca1136d96dea71ceab3ad440f16ede1fb (patch) | |
| tree | 4c42aa032f7d258226b463bdb3dd20efc96b3277 | |
| parent | f75ba31174a71b506182c7d29d31fc2c4a29ebbd (diff) | |
| download | scintilla-mirror-47aa162ca1136d96dea71ceab3ad440f16ede1fb.tar.gz | |
Rename typeOfFold to FoldPart and make an enum class.
| -rw-r--r-- | src/LineMarker.cxx | 24 | ||||
| -rw-r--r-- | src/LineMarker.h | 4 | ||||
| -rw-r--r-- | src/MarginView.cxx | 14 | 
3 files changed, 21 insertions, 21 deletions
| diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index 4223181e3..6c61d6d51 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -110,9 +110,9 @@ static void DrawMinus(Surface *surface, int centreX, int centreY, int armSize, C  	surface->FillRectangle(rcH, fore);  } -void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, typeOfFold tFold, int marginStyle) const { +void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, FoldPart part, int marginStyle) const {  	if (customDraw) { -		customDraw(surface, rcWhole, fontForCharacter, tFold, marginStyle, this); +		customDraw(surface, rcWhole, fontForCharacter, static_cast<int>(part), marginStyle, this);  		return;  	} @@ -120,22 +120,22 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac  	ColourDesired colourBody = back;  	ColourDesired colourTail = back; -	switch (tFold) { -	case LineMarker::head: -	case LineMarker::headWithTail: +	switch (part) { +	case FoldPart::head: +	case FoldPart::headWithTail:  		colourHead = backSelected;  		colourTail = backSelected;  		break; -	case LineMarker::body: +	case FoldPart::body:  		colourHead = backSelected;  		colourBody = backSelected;  		break; -	case LineMarker::tail: +	case FoldPart::tail:  		colourBody = backSelected;  		colourTail = backSelected;  		break;  	default: -		// LineMarker::undefined +		// FoldPart::undefined  		break;  	} @@ -316,7 +316,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac  		break;  	case SC_MARK_BOXPLUSCONNECTED: { -			if (tFold == LineMarker::headWithTail) +			if (part == FoldPart::headWithTail)  				surface->PenColour(colourTail);  			else  				surface->PenColour(colourBody); @@ -330,7 +330,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac  			DrawBox(surface, centreX, centreY, blobSize, fore, colourHead);  			DrawPlus(surface, centreX, centreY, blobSize, colourTail); -			if (tFold == LineMarker::body) { +			if (part == FoldPart::body) {  				surface->PenColour(colourTail);  				surface->MoveTo(centreX + 1, centreY + blobSize);  				surface->LineTo(centreX + blobSize + 1, centreY + blobSize); @@ -366,7 +366,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac  			surface->MoveTo(centreX, ircWhole.top);  			surface->LineTo(centreX, centreY - blobSize); -			if (tFold == LineMarker::body) { +			if (part == FoldPart::body) {  				surface->PenColour(colourTail);  				surface->MoveTo(centreX + 1, centreY + blobSize);  				surface->LineTo(centreX + blobSize + 1, centreY + blobSize); @@ -387,7 +387,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac  		break;  	case SC_MARK_CIRCLEPLUSCONNECTED: { -			if (tFold == LineMarker::headWithTail) +			if (part == FoldPart::headWithTail)  				surface->PenColour(colourTail);  			else  				surface->PenColour(colourBody); diff --git a/src/LineMarker.h b/src/LineMarker.h index 8a15327d2..4173f065e 100644 --- a/src/LineMarker.h +++ b/src/LineMarker.h @@ -19,7 +19,7 @@ typedef void (*DrawLineMarkerFn)(Surface *surface, PRectangle &rcWhole, Font &fo   */  class LineMarker {  public: -	enum typeOfFold { undefined, head, body, tail, headWithTail }; +	enum class FoldPart { undefined, head, body, tail, headWithTail };  	int markType = SC_MARK_CIRCLE;  	ColourDesired fore = ColourDesired(0, 0, 0); @@ -44,7 +44,7 @@ public:  	void SetXPM(const char *textForm);  	void SetXPM(const char *const *linesForm);  	void SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage); -	void Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, typeOfFold tFold, int marginStyle) const; +	void Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, FoldPart part, int marginStyle) const;  };  } diff --git a/src/MarginView.cxx b/src/MarginView.cxx index dc4cd165c..5aadd4831 100644 --- a/src/MarginView.cxx +++ b/src/MarginView.cxx @@ -432,25 +432,25 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc,  				if (marks) {  					for (int markBit = 0; (markBit < 32) && marks; markBit++) {  						if (marks & 1) { -							LineMarker::typeOfFold tFold = LineMarker::undefined; +							LineMarker::FoldPart part = LineMarker::FoldPart::undefined;  							if ((vs.ms[margin].mask & SC_MASK_FOLDERS) && highlightDelimiter.IsFoldBlockHighlighted(lineDoc)) {  								if (highlightDelimiter.IsBodyOfFoldBlock(lineDoc)) { -									tFold = LineMarker::body; +									part = LineMarker::FoldPart::body;  								} else if (highlightDelimiter.IsHeadOfFoldBlock(lineDoc)) {  									if (firstSubLine) { -										tFold = headWithTail ? LineMarker::headWithTail : LineMarker::head; +										part = headWithTail ? LineMarker::FoldPart::headWithTail : LineMarker::FoldPart::head;  									} else {  										if (model.pcs->GetExpanded(lineDoc) || headWithTail) { -											tFold = LineMarker::body; +											part = LineMarker::FoldPart::body;  										} else { -											tFold = LineMarker::undefined; +											part = LineMarker::FoldPart::undefined;  										}  									}  								} else if (highlightDelimiter.IsTailOfFoldBlock(lineDoc)) { -									tFold = LineMarker::tail; +									part = LineMarker::FoldPart::tail;  								}  							} -							vs.markers[markBit].Draw(surface, rcMarker, fontLineNumber, tFold, vs.ms[margin].style); +							vs.markers[markBit].Draw(surface, rcMarker, fontLineNumber, part, vs.ms[margin].style);  						}  						marks >>= 1;  					} | 
