summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/gradient-tool.cpp
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-15 10:46:15 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2018-06-18 12:27:01 +0000
commitf4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43 (patch)
tree7c6044fd3a17a2665841959dac9b3b2110b27924 /src/ui/tools/gradient-tool.cpp
parentRun clang-tidy’s modernize-use-override pass. (diff)
downloadinkscape-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/gradient-tool.cpp')
-rw-r--r--src/ui/tools/gradient-tool.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ui/tools/gradient-tool.cpp b/src/ui/tools/gradient-tool.cpp
index b0c2a0185..a443716d7 100644
--- a/src/ui/tools/gradient-tool.cpp
+++ b/src/ui/tools/gradient-tool.cpp
@@ -65,8 +65,8 @@ GradientTool::GradientTool()
, cursor_addnode(false)
, node_added(false)
// TODO: Why are these connections stored as pointers?
- , selcon(NULL)
- , subselcon(NULL)
+ , selcon(nullptr)
+ , subselcon(nullptr)
{
// TODO: This value is overwritten in the root handler
this->tolerance = 6;
@@ -105,7 +105,7 @@ void GradientTool::selection_changed(Inkscape::Selection*) {
GrDrag *drag = rc->_grdrag;
Inkscape::Selection *selection = this->desktop->getSelection();
- if (selection == NULL) {
+ if (selection == nullptr) {
return;
}
guint n_obj = (guint) boost::distance(selection->items());
@@ -168,7 +168,7 @@ void GradientTool::setup() {
this->subselcon = new sigc::connection(this->desktop->connectToolSubselectionChanged(
sigc::hide(sigc::bind(
sigc::mem_fun(this, &GradientTool::selection_changed),
- (Inkscape::Selection*)NULL
+ (Inkscape::Selection*)nullptr
))
));
@@ -259,7 +259,7 @@ sp_gradient_context_get_stop_intervals (GrDrag *drag, std::vector<SPStop *> &the
// if there's a next stop,
if (next_stop) {
- GrDragger *dnext = NULL;
+ GrDragger *dnext = nullptr;
// find its dragger
// (complex because it may have different types, and because in radial,
// more than one dragger may correspond to a stop, so we must distinguish)
@@ -307,7 +307,7 @@ sp_gradient_context_get_stop_intervals (GrDrag *drag, std::vector<SPStop *> &the
void
sp_gradient_context_add_stops_between_selected_stops (GradientTool *rc)
{
- SPDocument *doc = NULL;
+ SPDocument *doc = nullptr;
GrDrag *drag = rc->_grdrag;
std::vector<SPStop *> these_stops;
@@ -376,7 +376,7 @@ static double sqr(double x) {return x*x;}
static void
sp_gradient_simplify(GradientTool *rc, double tolerance)
{
- SPDocument *doc = NULL;
+ SPDocument *doc = nullptr;
GrDrag *drag = rc->_grdrag;
std::vector<SPStop *> these_stops;
@@ -471,7 +471,7 @@ bool GradientTool::root_handler(GdkEvent* event) {
case GDK_2BUTTON_PRESS:
if ( event->button.button == 1 ) {
bool over_line = false;
- SPCtrlLine *line = NULL;
+ SPCtrlLine *line = nullptr;
if (!drag->lines.empty()) {
for (std::vector<SPCtrlLine *>::const_iterator l = drag->lines.begin(); l != drag->lines.end() && (!over_line); ++l) {
@@ -602,7 +602,7 @@ bool GradientTool::root_handler(GdkEvent* event) {
if ( event->button.button == 1 && !this->space_panning ) {
bool over_line = false;
- SPCtrlLine *line = NULL;
+ SPCtrlLine *line = nullptr;
if (!drag->lines.empty()) {
for (std::vector<SPCtrlLine *>::const_iterator l = drag->lines.begin(); l != drag->lines.end() && (!over_line); ++l) {
@@ -659,7 +659,7 @@ bool GradientTool::root_handler(GdkEvent* event) {
}
}
- this->item_to_select = NULL;
+ this->item_to_select = nullptr;
ret = TRUE;
}
@@ -680,7 +680,7 @@ bool GradientTool::root_handler(GdkEvent* event) {
sp_event_show_modifier_tip (this->defaultMessageContext(), event,
_("<b>Ctrl</b>: snap gradient angle"),
_("<b>Shift</b>: draw gradient around the starting point"),
- NULL);
+ nullptr);
break;
case GDK_KEY_x: