diff options
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-06-15 10:46:15 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2018-06-18 12:27:01 +0000 |
| commit | f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43 (patch) | |
| tree | 7c6044fd3a17a2665841959dac9b3b2110b27924 /src/display/drawing-image.cpp | |
| parent | Run clang-tidy’s modernize-use-override pass. (diff) | |
| download | inkscape-f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43.tar.gz inkscape-f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43.zip | |
Run clang-tidy’s modernize-use-nullptr pass.
This replaces all NULL or 0 with nullptr when assigned to or returned as
a pointer.
Diffstat (limited to 'src/display/drawing-image.cpp')
| -rw-r--r-- | src/display/drawing-image.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/display/drawing-image.cpp b/src/display/drawing-image.cpp index 4be3099bf..2a3777e36 100644 --- a/src/display/drawing-image.cpp +++ b/src/display/drawing-image.cpp @@ -22,7 +22,7 @@ namespace Inkscape { DrawingImage::DrawingImage(Drawing &drawing) : DrawingItem(drawing) - , _pixbuf(NULL) + , _pixbuf(nullptr) {} DrawingImage::~DrawingImage() @@ -184,7 +184,7 @@ distance_to_segment (Geom::Point const &p, Geom::Point const &a1, Geom::Point co DrawingItem * DrawingImage::_pickItem(Geom::Point const &p, double delta, unsigned /*sticky*/) { - if (!_pixbuf) return NULL; + if (!_pixbuf) return nullptr; bool outline = _drawing.outline(); @@ -201,7 +201,7 @@ DrawingImage::_pickItem(Geom::Point const &p, double delta, unsigned /*sticky*/) } } } - return NULL; + return nullptr; } else { unsigned char *const pixels = _pixbuf->pixels(); @@ -213,7 +213,7 @@ DrawingImage::_pickItem(Geom::Point const &p, double delta, unsigned /*sticky*/) Geom::Rect r = bounds(); if (!r.contains(tp)) - return NULL; + return nullptr; double vw = width * _scale[Geom::X]; double vh = height * _scale[Geom::Y]; @@ -221,7 +221,7 @@ DrawingImage::_pickItem(Geom::Point const &p, double delta, unsigned /*sticky*/) int iy = floor((tp[Geom::Y] - _origin[Geom::Y]) / vh * height); if ((ix < 0) || (iy < 0) || (ix >= width) || (iy >= height)) - return NULL; + return nullptr; unsigned char *pix_ptr = pixels + iy * rowstride + ix * 4; // pick if the image is less than 99% transparent @@ -235,7 +235,7 @@ DrawingImage::_pickItem(Geom::Point const &p, double delta, unsigned /*sticky*/) throw std::runtime_error("Unrecognized pixel format"); } float alpha_f = (alpha / 255.0f) * _opacity; - return alpha_f > 0.01 ? this : NULL; + return alpha_f > 0.01 ? this : nullptr; } } |
