diff options
Diffstat (limited to 'src/LineMarker.cxx')
| -rw-r--r-- | src/LineMarker.cxx | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index d2c906d08..e026e4a17 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -18,7 +18,6 @@ #include "Scintilla.h" -#include "StringCopy.h" #include "IntegerRectangle.h" #include "XPM.h" #include "LineMarker.h" @@ -33,11 +32,11 @@ LineMarker::LineMarker(const LineMarker &other) { backSelected = other.backSelected; alpha = other.alpha; if (other.pxpm) - pxpm.reset(new XPM(*other.pxpm)); + pxpm = Sci::make_unique<XPM>(*other.pxpm); else pxpm = nullptr; if (other.image) - image.reset(new RGBAImage(*other.image)); + image = Sci::make_unique<RGBAImage>(*other.image); else image = nullptr; customDraw = other.customDraw; @@ -52,11 +51,11 @@ LineMarker &LineMarker::operator=(const LineMarker &other) { backSelected = other.backSelected; alpha = other.alpha; if (other.pxpm) - pxpm.reset(new XPM(*other.pxpm)); + pxpm = Sci::make_unique<XPM>(*other.pxpm); else pxpm = nullptr; if (other.image) - image.reset(new RGBAImage(*other.image)); + image = Sci::make_unique<RGBAImage>(*other.image); else image = nullptr; customDraw = other.customDraw; @@ -65,17 +64,17 @@ LineMarker &LineMarker::operator=(const LineMarker &other) { } void LineMarker::SetXPM(const char *textForm) { - pxpm.reset(new XPM(textForm)); + pxpm = Sci::make_unique<XPM>(textForm); markType = SC_MARK_PIXMAP; } void LineMarker::SetXPM(const char *const *linesForm) { - pxpm.reset(new XPM(linesForm)); + pxpm = Sci::make_unique<XPM>(linesForm); markType = SC_MARK_PIXMAP; } void LineMarker::SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage) { - image.reset(new RGBAImage(static_cast<int>(sizeRGBAImage.x), static_cast<int>(sizeRGBAImage.y), scale, pixelsRGBAImage)); + image = Sci::make_unique<RGBAImage>(static_cast<int>(sizeRGBAImage.x), static_cast<int>(sizeRGBAImage.y), scale, pixelsRGBAImage); markType = SC_MARK_RGBAIMAGE; } @@ -185,7 +184,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac Point::FromInts(centreX - dimOn4, centreY + dimOn2), Point::FromInts(centreX + dimOn2 - dimOn4, centreY), }; - surface->Polygon(pts, ELEMENTS(pts), fore, back); + surface->Polygon(pts, Sci::size(pts), fore, back); } else if (markType == SC_MARK_ARROWDOWN) { Point pts[] = { @@ -193,7 +192,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac Point::FromInts(centreX + dimOn2, centreY - dimOn4), Point::FromInts(centreX, centreY + dimOn2 - dimOn4), }; - surface->Polygon(pts, ELEMENTS(pts), fore, back); + surface->Polygon(pts, Sci::size(pts), fore, back); } else if (markType == SC_MARK_PLUS) { Point pts[] = { @@ -210,7 +209,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac Point::FromInts(centreX - 1, centreY + 1), Point::FromInts(centreX - armSize, centreY + 1), }; - surface->Polygon(pts, ELEMENTS(pts), fore, back); + surface->Polygon(pts, Sci::size(pts), fore, back); } else if (markType == SC_MARK_MINUS) { Point pts[] = { @@ -219,7 +218,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac Point::FromInts(centreX + armSize, centreY +1), Point::FromInts(centreX - armSize, centreY + 1), }; - surface->Polygon(pts, ELEMENTS(pts), fore, back); + surface->Polygon(pts, Sci::size(pts), fore, back); } else if (markType == SC_MARK_SMALLRECT) { PRectangle rcSmall; @@ -415,7 +414,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac Point::FromInts(centreX, centreY + dimOn4), Point::FromInts(centreX, centreY + dimOn2), }; - surface->Polygon(pts, ELEMENTS(pts), fore, back); + surface->Polygon(pts, Sci::size(pts), fore, back); } else if (markType == SC_MARK_LEFTRECT) { PRectangle rcLeft = rcWhole; rcLeft.right = rcLeft.left + 4; @@ -429,7 +428,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac Point::FromInts(ircWhole.right - 3, centreY + halfHeight), Point::FromInts(ircWhole.left, centreY + halfHeight), }; - surface->Polygon(pts, ELEMENTS(pts), fore, back); + surface->Polygon(pts, Sci::size(pts), fore, back); } else if (markType == SC_MARK_VERTICALBOOKMARK) { const int halfWidth = minDim / 3; Point pts[] = { @@ -439,7 +438,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac Point::FromInts(centreX, centreY + dimOn2 - halfWidth), Point::FromInts(centreX - halfWidth, centreY + dimOn2), }; - surface->Polygon(pts, ELEMENTS(pts), fore, back); + surface->Polygon(pts, Sci::size(pts), fore, back); } else { // SC_MARK_FULLRECT surface->FillRectangle(rcWhole, back); } |
