diff options
author | Neil <nyamatongwe@gmail.com> | 2017-04-22 09:16:08 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2017-04-22 09:16:08 +1000 |
commit | b201e09daf251a0e3e5576b79643f6c4f841a4a9 (patch) | |
tree | bc7d0caf7e5a4d0635b7ee7ba593f4ee830a6072 /src/LineMarker.cxx | |
parent | 0801e0084a5cf87f424235d5947f5158474d5da4 (diff) | |
download | scintilla-mirror-b201e09daf251a0e3e5576b79643f6c4f841a4a9.tar.gz |
Using unique_ptr to simplify ownership of images, case folder, and list box.
Diffstat (limited to 'src/LineMarker.cxx')
-rw-r--r-- | src/LineMarker.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index 6bb9f4e9a..d80a3c78c 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -26,20 +26,17 @@ using namespace Scintilla; #endif void LineMarker::SetXPM(const char *textForm) { - delete pxpm; - pxpm = new XPM(textForm); + pxpm.reset(new XPM(textForm)); markType = SC_MARK_PIXMAP; } void LineMarker::SetXPM(const char *const *linesForm) { - delete pxpm; - pxpm = new XPM(linesForm); + pxpm.reset(new XPM(linesForm)); markType = SC_MARK_PIXMAP; } void LineMarker::SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage) { - delete image; - image = new RGBAImage(static_cast<int>(sizeRGBAImage.x), static_cast<int>(sizeRGBAImage.y), scale, pixelsRGBAImage); + image.reset(new RGBAImage(static_cast<int>(sizeRGBAImage.x), static_cast<int>(sizeRGBAImage.y), scale, pixelsRGBAImage)); markType = SC_MARK_RGBAIMAGE; } @@ -74,7 +71,7 @@ static void DrawMinus(Surface *surface, int centreX, int centreY, int armSize, C } void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, typeOfFold tFold, int marginStyle) const { - if (customDraw != NULL) { + if (customDraw) { customDraw(surface, rcWhole, fontForCharacter, tFold, marginStyle, this); return; } |