aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LineMarker.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/LineMarker.h')
-rw-r--r--src/LineMarker.h28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/LineMarker.h b/src/LineMarker.h
index fde11da0d..2006fe8fb 100644
--- a/src/LineMarker.h
+++ b/src/LineMarker.h
@@ -25,8 +25,8 @@ public:
ColourDesired back;
ColourDesired backSelected;
int alpha;
- XPM *pxpm;
- RGBAImage *image;
+ std::unique_ptr<XPM> pxpm;
+ std::unique_ptr<RGBAImage> image;
/** Some platforms, notably PLAT_CURSES, do not support Scintilla's native
* Draw function for drawing line markers. Allow those platforms to override
* it instead of creating a new method(s) in the Surface class that existing
@@ -38,38 +38,32 @@ public:
back = ColourDesired(0xff,0xff,0xff);
backSelected = ColourDesired(0xff,0x00,0x00);
alpha = SC_ALPHA_NOALPHA;
- pxpm = NULL;
- image = NULL;
- customDraw = NULL;
+ customDraw = nullptr;
}
LineMarker(const LineMarker &) {
- // Defined to avoid pxpm being blindly copied, not as a complete copy constructor
+ // Defined to avoid pxpm and image being blindly copied, not as a complete copy constructor.
markType = SC_MARK_CIRCLE;
fore = ColourDesired(0,0,0);
back = ColourDesired(0xff,0xff,0xff);
backSelected = ColourDesired(0xff,0x00,0x00);
alpha = SC_ALPHA_NOALPHA;
- pxpm = NULL;
- image = NULL;
- customDraw = NULL;
+ pxpm.reset();
+ image.reset();
+ customDraw = nullptr;
}
~LineMarker() {
- delete pxpm;
- delete image;
}
LineMarker &operator=(const LineMarker &other) {
- // Defined to avoid pxpm being blindly copied, not as a complete assignment operator
+ // Defined to avoid pxpm and image being blindly copied, not as a complete assignment operator.
if (this != &other) {
markType = SC_MARK_CIRCLE;
fore = ColourDesired(0,0,0);
back = ColourDesired(0xff,0xff,0xff);
backSelected = ColourDesired(0xff,0x00,0x00);
alpha = SC_ALPHA_NOALPHA;
- delete pxpm;
- pxpm = NULL;
- delete image;
- image = NULL;
- customDraw = NULL;
+ pxpm.reset();
+ image.reset();
+ customDraw = nullptr;
}
return *this;
}