diff options
author | Neil <nyamatongwe@gmail.com> | 2018-04-27 17:36:58 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-04-27 17:36:58 +1000 |
commit | 6b3a28e0c2c85f7ca3376ac406913e57ac1878b4 (patch) | |
tree | 111badc8a848a9b0f675dc66e59969756b5f60fd | |
parent | 4f0df34e67c3595d9a630f05bc5ddf5a395ad6c7 (diff) | |
download | scintilla-mirror-6b3a28e0c2c85f7ca3376ac406913e57ac1878b4.tar.gz |
Backport: Use nullptr for custom draw functions.
Backport of changeset 6752:ad7b3c0b64e3.
-rw-r--r-- | src/EditView.cxx | 15 | ||||
-rw-r--r-- | src/MarginView.cxx | 4 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx index 0a14d582b..770fcac02 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -186,8 +186,8 @@ EditView::EditView() { llc.SetLevel(LineLayoutCache::llcCaret); posCache.SetSize(0x400); tabArrowHeight = 4; - customDrawTabArrow = NULL; - customDrawWrapMarker = NULL; + customDrawTabArrow = nullptr; + customDrawWrapMarker = nullptr; } EditView::~EditView() { @@ -1007,7 +1007,7 @@ void EditView::DrawEOL(Surface *surface, const EditModel &model, const ViewStyle rcPlace.right = rcLine.right; rcPlace.left = rcPlace.right - vsDraw.aveCharWidth; } - if (customDrawWrapMarker == NULL) { + if (!customDrawWrapMarker) { DrawWrapMarker(surface, rcPlace, true, vsDraw.WrapColour()); } else { customDrawWrapMarker(surface, rcPlace, true, vsDraw.WrapColour()); @@ -1427,7 +1427,7 @@ static void DrawWrapIndentAndMarker(Surface *surface, const ViewStyle &vsDraw, c else rcPlace.right = rcPlace.left + vsDraw.aveCharWidth; - if (customDrawWrapMarker == NULL) { + if (!customDrawWrapMarker) { DrawWrapMarker(surface, rcPlace, false, vsDraw.WrapColour()); } else { customDrawWrapMarker(surface, rcPlace, false, vsDraw.WrapColour()); @@ -1713,10 +1713,11 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi surface->PenColour(textFore); const PRectangle rcTab(rcSegment.left + 1, rcSegment.top + tabArrowHeight, rcSegment.right - 1, rcSegment.bottom - vsDraw.maxDescent); - if (customDrawTabArrow == NULL) - DrawTabArrow(surface, rcTab, static_cast<int>(rcSegment.top + vsDraw.lineHeight / 2), vsDraw); + const int segmentTop = static_cast<int>(rcSegment.top + vsDraw.lineHeight / 2); + if (!customDrawTabArrow) + DrawTabArrow(surface, rcTab, segmentTop, vsDraw); else - customDrawTabArrow(surface, rcTab, static_cast<int>(rcSegment.top + vsDraw.lineHeight / 2)); + customDrawTabArrow(surface, rcTab, segmentTop); } } } else { diff --git a/src/MarginView.cxx b/src/MarginView.cxx index 09f1b636d..2b40b10bc 100644 --- a/src/MarginView.cxx +++ b/src/MarginView.cxx @@ -100,7 +100,7 @@ void DrawWrapMarker(Surface *surface, PRectangle rcPlace, MarginView::MarginView() { wrapMarkerPaddingRight = 3; - customDrawWrapMarker = NULL; + customDrawWrapMarker = nullptr; } void MarginView::DropGraphics(bool freeObjects) { @@ -398,7 +398,7 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, PRectangle rcWrapMarker = rcMarker; rcWrapMarker.right -= wrapMarkerPaddingRight; rcWrapMarker.left = rcWrapMarker.right - vs.styles[STYLE_LINENUMBER].aveCharWidth; - if (customDrawWrapMarker == NULL) { + if (!customDrawWrapMarker) { DrawWrapMarker(surface, rcWrapMarker, false, vs.styles[STYLE_LINENUMBER].fore); } else { customDrawWrapMarker(surface, rcWrapMarker, false, vs.styles[STYLE_LINENUMBER].fore); |