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/ui/tools/rect-tool.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/ui/tools/rect-tool.cpp')
| -rw-r--r-- | src/ui/tools/rect-tool.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ui/tools/rect-tool.cpp b/src/ui/tools/rect-tool.cpp index 7442c6eca..cedf43962 100644 --- a/src/ui/tools/rect-tool.cpp +++ b/src/ui/tools/rect-tool.cpp @@ -58,7 +58,7 @@ const std::string RectTool::prefsPath = "/tools/shapes/rect"; RectTool::RectTool() : ToolBase(cursor_rect_xpm) - , rect(NULL) + , rect(nullptr) , rx(0) , ry(0) { @@ -79,7 +79,7 @@ RectTool::~RectTool() { this->sel_changed_connection.disconnect(); delete this->shape_editor; - this->shape_editor = NULL; + this->shape_editor = nullptr; /* fixme: This is necessary because we do not grab */ if (this->rect) { @@ -199,7 +199,7 @@ bool RectTool::root_handler(GdkEvent* event) { GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK ), - NULL, event->button.time); + nullptr, event->button.time); ret = TRUE; } @@ -256,7 +256,7 @@ bool RectTool::root_handler(GdkEvent* event) { selection->clear(); } - this->item_to_select = NULL; + this->item_to_select = nullptr; ret = TRUE; sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), event->button.time); @@ -276,7 +276,7 @@ bool RectTool::root_handler(GdkEvent* event) { sp_event_show_modifier_tip (this->defaultMessageContext(), event, _("<b>Ctrl</b>: make square or integer-ratio rect, lock a rounded corner circular"), _("<b>Shift</b>: draw around the starting point"), - NULL); + nullptr); } break; case GDK_KEY_x: @@ -450,14 +450,14 @@ void RectTool::drag(Geom::Point const pt, guint state) { void RectTool::finishItem() { this->message_context->clear(); - if (this->rect != NULL) { + if (this->rect != nullptr) { if (this->rect->width.computed == 0 || this->rect->height.computed == 0) { this->cancel(); // Don't allow the creating of zero sized rectangle, for example when the start and and point snap to the snap grid point return; } this->rect->updateRepr(); - this->rect->doWriteTransform(this->rect->transform, NULL, true); + this->rect->doWriteTransform(this->rect->transform, nullptr, true); this->desktop->canvas->endForcedFullRedraws(); @@ -469,7 +469,7 @@ void RectTool::finishItem() { DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_RECT, _("Create rectangle")); - this->rect = NULL; + this->rect = nullptr; } } @@ -477,15 +477,15 @@ void RectTool::cancel(){ this->desktop->getSelection()->clear(); sp_canvas_item_ungrab(SP_CANVAS_ITEM(this->desktop->acetate), 0); - if (this->rect != NULL) { + if (this->rect != nullptr) { this->rect->deleteObject(); - this->rect = NULL; + this->rect = nullptr; } this->within_tolerance = false; this->xp = 0; this->yp = 0; - this->item_to_select = NULL; + this->item_to_select = nullptr; this->desktop->canvas->endForcedFullRedraws(); |
