aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-04-27 17:36:58 +1000
committerNeil <nyamatongwe@gmail.com>2018-04-27 17:36:58 +1000
commit8be9093b44cb988c477a3ef3b32e84eab2218600 (patch)
treeb702acb24c1b262226525e69d3e559fd8bafd999
parent35775912a5e5cce323187172b84653d43f070916 (diff)
downloadscintilla-mirror-8be9093b44cb988c477a3ef3b32e84eab2218600.tar.gz
Use nullptr for custom draw functions.
-rw-r--r--src/EditView.cxx15
-rw-r--r--src/MarginView.cxx4
2 files changed, 10 insertions, 9 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 7a2225e2e..51bd0f634 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);