summaryrefslogtreecommitdiffstats
path: root/src/ui/tools
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
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')
-rw-r--r--src/ui/tools/arc-tool.cpp22
-rw-r--r--src/ui/tools/box3d-tool.cpp16
-rw-r--r--src/ui/tools/calligraphic-tool.cpp34
-rw-r--r--src/ui/tools/connector-tool.cpp140
-rw-r--r--src/ui/tools/dropper-tool.cpp12
-rw-r--r--src/ui/tools/dynamic-base.cpp22
-rw-r--r--src/ui/tools/eraser-tool.cpp22
-rw-r--r--src/ui/tools/flood-tool.cpp10
-rw-r--r--src/ui/tools/freehand-base.cpp72
-rw-r--r--src/ui/tools/gradient-tool.cpp22
-rw-r--r--src/ui/tools/lpe-tool.cpp16
-rw-r--r--src/ui/tools/lpe-tool.h2
-rw-r--r--src/ui/tools/measure-tool.cpp38
-rw-r--r--src/ui/tools/measure-tool.h6
-rw-r--r--src/ui/tools/mesh-tool.cpp16
-rw-r--r--src/ui/tools/node-tool.cpp48
-rw-r--r--src/ui/tools/pen-tool.cpp70
-rw-r--r--src/ui/tools/pencil-tool.cpp48
-rw-r--r--src/ui/tools/rect-tool.cpp22
-rw-r--r--src/ui/tools/select-tool.cpp72
-rw-r--r--src/ui/tools/spiral-tool.cpp22
-rw-r--r--src/ui/tools/spray-tool.cpp16
-rw-r--r--src/ui/tools/star-tool.cpp26
-rw-r--r--src/ui/tools/text-tool.cpp90
-rw-r--r--src/ui/tools/tool-base.cpp78
-rw-r--r--src/ui/tools/tool-base.h6
-rw-r--r--src/ui/tools/tweak-tool.cpp26
-rw-r--r--src/ui/tools/zoom-tool.cpp8
28 files changed, 491 insertions, 491 deletions
diff --git a/src/ui/tools/arc-tool.cpp b/src/ui/tools/arc-tool.cpp
index 34b29f3bb..e0378ff03 100644
--- a/src/ui/tools/arc-tool.cpp
+++ b/src/ui/tools/arc-tool.cpp
@@ -64,7 +64,7 @@ const std::string ArcTool::prefsPath = "/tools/shapes/arc";
ArcTool::ArcTool()
: ToolBase(cursor_ellipse_xpm)
- , arc(NULL)
+ , arc(nullptr)
{
}
@@ -82,7 +82,7 @@ ArcTool::~ArcTool() {
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->arc) {
@@ -166,7 +166,7 @@ bool ArcTool::root_handler(GdkEvent* event) {
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
GDK_KEY_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK,
- NULL, event->button.time);
+ nullptr, event->button.time);
handled = true;
m.unSetup();
}
@@ -224,7 +224,7 @@ bool ArcTool::root_handler(GdkEvent* event) {
this->xp = 0;
this->yp = 0;
- this->item_to_select = NULL;
+ this->item_to_select = nullptr;
handled = true;
}
sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), event->button.time);
@@ -244,7 +244,7 @@ bool ArcTool::root_handler(GdkEvent* event) {
sp_event_show_modifier_tip(this->defaultMessageContext(), event,
_("<b>Ctrl</b>: make circle or integer-ratio ellipse, snap arc/segment angle"),
_("<b>Shift</b>: draw around the starting point"),
- NULL);
+ nullptr);
}
break;
@@ -412,14 +412,14 @@ void ArcTool::drag(Geom::Point pt, guint state) {
void ArcTool::finishItem() {
this->message_context->clear();
- if (this->arc != NULL) {
+ if (this->arc != nullptr) {
if (this->arc->rx.computed == 0 || this->arc->ry.computed == 0) {
this->cancel(); // Don't allow the creating of zero sized arc, for example when the start and and point snap to the snap grid point
return;
}
this->arc->updateRepr();
- this->arc->doWriteTransform(this->arc->transform, NULL, true);
+ this->arc->doWriteTransform(this->arc->transform, nullptr, true);
desktop->canvas->endForcedFullRedraws();
@@ -427,7 +427,7 @@ void ArcTool::finishItem() {
DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_ARC, _("Create ellipse"));
- this->arc = NULL;
+ this->arc = nullptr;
}
}
@@ -435,15 +435,15 @@ void ArcTool::cancel() {
desktop->getSelection()->clear();
sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), 0);
- if (this->arc != NULL) {
+ if (this->arc != nullptr) {
this->arc->deleteObject();
- this->arc = NULL;
+ this->arc = nullptr;
}
this->within_tolerance = false;
this->xp = 0;
this->yp = 0;
- this->item_to_select = NULL;
+ this->item_to_select = nullptr;
desktop->canvas->endForcedFullRedraws();
diff --git a/src/ui/tools/box3d-tool.cpp b/src/ui/tools/box3d-tool.cpp
index 52c66fb2b..f643fc356 100644
--- a/src/ui/tools/box3d-tool.cpp
+++ b/src/ui/tools/box3d-tool.cpp
@@ -61,8 +61,8 @@ const std::string Box3dTool::prefsPath = "/tools/shapes/3dbox";
Box3dTool::Box3dTool()
: ToolBase(cursor_3dbox_xpm)
- , _vpdrag(NULL)
- , box3d(NULL)
+ , _vpdrag(nullptr)
+ , box3d(nullptr)
, ctrl_dragged(false)
, extruded(false)
{
@@ -81,12 +81,12 @@ Box3dTool::~Box3dTool() {
this->enableGrDrag(false);
delete (this->_vpdrag);
- this->_vpdrag = NULL;
+ this->_vpdrag = nullptr;
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->box3d) {
@@ -236,7 +236,7 @@ bool Box3dTool::root_handler(GdkEvent* event) {
GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK ),
- NULL, event->button.time);
+ nullptr, event->button.time);
ret = TRUE;
}
break;
@@ -333,7 +333,7 @@ bool Box3dTool::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);
@@ -575,7 +575,7 @@ void Box3dTool::finishItem() {
this->ctrl_dragged = false;
this->extruded = false;
- if (this->box3d != NULL) {
+ if (this->box3d != nullptr) {
SPDocument *doc = this->desktop->getDocument();
if (!doc || !doc->getCurrentPersp3D()) {
@@ -595,7 +595,7 @@ void Box3dTool::finishItem() {
DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_3DBOX,
_("Create 3D box"));
- this->box3d = NULL;
+ this->box3d = nullptr;
}
}
diff --git a/src/ui/tools/calligraphic-tool.cpp b/src/ui/tools/calligraphic-tool.cpp
index c080571d0..5cd2514ba 100644
--- a/src/ui/tools/calligraphic-tool.cpp
+++ b/src/ui/tools/calligraphic-tool.cpp
@@ -96,12 +96,12 @@ CalligraphicTool::CalligraphicTool()
, keep_selected(true)
, hatch_spacing(0)
, hatch_spacing_step(0)
- , hatch_item(NULL)
- , hatch_livarot_path(NULL)
+ , hatch_item(nullptr)
+ , hatch_livarot_path(nullptr)
, hatch_last_nearest(Geom::Point(0,0))
, hatch_last_pointer(Geom::Point(0,0))
, hatch_escaped(false)
- , hatch_area(NULL)
+ , hatch_area(nullptr)
, just_started_drawing(false)
, trace_bg(false)
{
@@ -114,7 +114,7 @@ CalligraphicTool::CalligraphicTool()
CalligraphicTool::~CalligraphicTool() {
if (this->hatch_area) {
sp_canvas_item_destroy(this->hatch_area);
- this->hatch_area = NULL;
+ this->hatch_area = nullptr;
}
}
@@ -127,7 +127,7 @@ void CalligraphicTool::setup() {
this->cal1 = new SPCurve();
this->cal2 = new SPCurve();
- this->currentshape = sp_canvas_item_new(this->desktop->getSketch(), SP_TYPE_CANVAS_BPATH, NULL);
+ this->currentshape = sp_canvas_item_new(this->desktop->getSketch(), SP_TYPE_CANVAS_BPATH, nullptr);
sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(this->currentshape), DDC_RED_RGBA, SP_WIND_RULE_EVENODD);
sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(this->currentshape), 0x00000000, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
@@ -434,7 +434,7 @@ void CalligraphicTool::cancel() {
this->clear_current();
if (this->repr) {
- this->repr = NULL;
+ this->repr = nullptr;
}
}
@@ -451,7 +451,7 @@ bool CalligraphicTool::root_handler(GdkEvent* event) {
this->accumulated->reset();
if (this->repr) {
- this->repr = NULL;
+ this->repr = nullptr;
}
/* initialize first point */
@@ -462,7 +462,7 @@ bool CalligraphicTool::root_handler(GdkEvent* event) {
GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK |
GDK_BUTTON_PRESS_MASK ),
- NULL,
+ nullptr,
event->button.time);
ret = TRUE;
@@ -750,7 +750,7 @@ bool CalligraphicTool::root_handler(GdkEvent* event) {
this->clear_current();
if (this->repr) {
- this->repr = NULL;
+ this->repr = nullptr;
}
if (!this->hatch_pointer_past.empty()) this->hatch_pointer_past.clear();
@@ -760,8 +760,8 @@ bool CalligraphicTool::root_handler(GdkEvent* event) {
this->hatch_last_nearest = Geom::Point(0,0);
this->hatch_last_pointer = Geom::Point(0,0);
this->hatch_escaped = false;
- this->hatch_item = NULL;
- this->hatch_livarot_path = NULL;
+ this->hatch_item = nullptr;
+ this->hatch_livarot_path = nullptr;
this->just_started_drawing = false;
if (this->hatch_spacing != 0 && !this->keep_selected) {
@@ -891,7 +891,7 @@ bool CalligraphicTool::root_handler(GdkEvent* event) {
void CalligraphicTool::clear_current() {
/* reset bpath */
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->currentshape), NULL);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->currentshape), nullptr);
/* reset curve */
this->currentcurve->reset();
this->cal1->reset();
@@ -920,7 +920,7 @@ void CalligraphicTool::set_to_accumulated(bool unionize, bool subtract) {
Geom::PathVector pathv = this->accumulated->get_pathvector() * desktop->dt2doc();
gchar *str = sp_svg_write_path(pathv);
- g_assert( str != NULL );
+ g_assert( str != nullptr );
this->repr->setAttribute("d", str);
g_free(str);
@@ -942,19 +942,19 @@ void CalligraphicTool::set_to_accumulated(bool unionize, bool subtract) {
// Either there was no boolean op or it failed.
SPItem *result = SP_ITEM(desktop->doc()->getObjectByRepr(this->repr));
- if (result == NULL) {
+ if (result == nullptr) {
// The boolean operation succeeded.
// Now we fetch the single item, that has been set as selected by the boolean op.
// This is its result.
result = desktop->getSelection()->singleItem();
}
- result->doWriteTransform(result->transform, NULL, true);
+ result->doWriteTransform(result->transform, nullptr, true);
} else {
if (this->repr) {
sp_repr_unparent(this->repr);
}
- this->repr = NULL;
+ this->repr = nullptr;
}
DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_CALLIGRAPHIC,
@@ -1128,7 +1128,7 @@ void CalligraphicTool::fit_and_split(bool release) {
SPCanvasItem *cbp = sp_canvas_item_new(desktop->getSketch(),
SP_TYPE_CANVAS_BPATH,
- NULL);
+ nullptr);
SPCurve *curve = this->currentcurve->copy();
sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH (cbp), curve, true);
curve->unref();
diff --git a/src/ui/tools/connector-tool.cpp b/src/ui/tools/connector-tool.cpp
index c1175f592..7481e8470 100644
--- a/src/ui/tools/connector-tool.cpp
+++ b/src/ui/tools/connector-tool.cpp
@@ -128,19 +128,19 @@ static bool cc_item_is_shape(SPItem *item);
static bool connector_within_tolerance = false;*/
static Inkscape::XML::NodeEventVector shape_repr_events = {
- NULL, /* child_added */
- NULL, /* child_added */
+ nullptr, /* child_added */
+ nullptr, /* child_added */
shape_event_attr_changed,
- NULL, /* content_changed */
- NULL /* order_changed */
+ nullptr, /* content_changed */
+ nullptr /* order_changed */
};
static Inkscape::XML::NodeEventVector layer_repr_events = {
- NULL, /* child_added */
+ nullptr, /* child_added */
shape_event_attr_deleted,
- NULL, /* child_added */
- NULL, /* content_changed */
- NULL /* order_changed */
+ nullptr, /* child_added */
+ nullptr, /* content_changed */
+ nullptr /* order_changed */
};
std::string const& ConnectorTool::getPrefsPath()
@@ -152,35 +152,35 @@ std::string const ConnectorTool::prefsPath = "/tools/connector";
ConnectorTool::ConnectorTool()
: ToolBase(cursor_connector_xpm)
- , selection(NULL)
+ , selection(nullptr)
, npoints(0)
, state(SP_CONNECTOR_CONTEXT_IDLE)
- , red_bpath(NULL)
- , red_curve(NULL)
+ , red_bpath(nullptr)
+ , red_curve(nullptr)
, red_color(0xff00007f)
- , green_curve(NULL)
- , newconn(NULL)
- , newConnRef(NULL)
+ , green_curve(nullptr)
+ , newconn(nullptr)
+ , newConnRef(nullptr)
, curvature(0.0)
, isOrthogonal(false)
- , active_shape(NULL)
- , active_shape_repr(NULL)
- , active_shape_layer_repr(NULL)
- , active_conn(NULL)
- , active_conn_repr(NULL)
- , active_handle(NULL)
- , selected_handle(NULL)
- , clickeditem(NULL)
- , clickedhandle(NULL)
- , shref(NULL)
- , ehref(NULL)
- , c0(NULL)
- , c1(NULL)
- , cl0(NULL)
- , cl1(NULL)
+ , active_shape(nullptr)
+ , active_shape_repr(nullptr)
+ , active_shape_layer_repr(nullptr)
+ , active_conn(nullptr)
+ , active_conn_repr(nullptr)
+ , active_handle(nullptr)
+ , selected_handle(nullptr)
+ , clickeditem(nullptr)
+ , clickedhandle(nullptr)
+ , shref(nullptr)
+ , ehref(nullptr)
+ , c0(nullptr)
+ , c1(nullptr)
+ , cl0(nullptr)
+ , cl1(nullptr)
{
for (int i = 0; i < 2; ++i) {
- this->endpt_handle[i] = NULL;
+ this->endpt_handle[i] = nullptr;
this->endpt_handler_id[i] = 0;
}
}
@@ -193,21 +193,21 @@ ConnectorTool::~ConnectorTool()
if (this->endpt_handle[1]) {
//g_object_unref(this->endpt_handle[i]);
knot_unref(this->endpt_handle[i]);
- this->endpt_handle[i] = NULL;
+ this->endpt_handle[i] = nullptr;
}
}
if (this->shref) {
g_free(this->shref);
- this->shref = NULL;
+ this->shref = nullptr;
}
if (this->ehref) {
g_free(this->shref);
- this->shref = NULL;
+ this->shref = nullptr;
}
- g_assert( this->newConnRef == NULL );
+ g_assert( this->newConnRef == nullptr );
}
void ConnectorTool::setup()
@@ -222,7 +222,7 @@ void ConnectorTool::setup()
);
/* Create red bpath */
- this->red_bpath = sp_canvas_bpath_new(this->desktop->getSketch(), NULL);
+ this->red_bpath = sp_canvas_bpath_new(this->desktop->getSketch(), nullptr);
sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(this->red_bpath), this->red_color,
1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(this->red_bpath), 0x00000000,
@@ -272,7 +272,7 @@ void ConnectorTool::finish()
ToolBase::finish();
if (this->selection) {
- this->selection = NULL;
+ this->selection = nullptr;
}
this->cc_clear_active_shape();
@@ -287,22 +287,22 @@ void ConnectorTool::finish()
void ConnectorTool::cc_clear_active_shape()
{
- if (this->active_shape == NULL) {
+ if (this->active_shape == nullptr) {
return;
}
g_assert( this->active_shape_repr );
g_assert( this->active_shape_layer_repr );
- this->active_shape = NULL;
+ this->active_shape = nullptr;
if (this->active_shape_repr) {
sp_repr_remove_listener_by_data(this->active_shape_repr, this);
Inkscape::GC::release(this->active_shape_repr);
- this->active_shape_repr = NULL;
+ this->active_shape_repr = nullptr;
sp_repr_remove_listener_by_data(this->active_shape_layer_repr, this);
Inkscape::GC::release(this->active_shape_layer_repr);
- this->active_shape_layer_repr = NULL;
+ this->active_shape_layer_repr = nullptr;
}
cc_clear_active_knots(this->knots);
@@ -320,17 +320,17 @@ static void cc_clear_active_knots(SPKnotList k)
void ConnectorTool::cc_clear_active_conn()
{
- if (this->active_conn == NULL) {
+ if (this->active_conn == nullptr) {
return;
}
g_assert( this->active_conn_repr );
- this->active_conn = NULL;
+ this->active_conn = nullptr;
if (this->active_conn_repr) {
sp_repr_remove_listener_by_data(this->active_conn_repr, this);
Inkscape::GC::release(this->active_conn_repr);
- this->active_conn_repr = NULL;
+ this->active_conn_repr = nullptr;
}
// Hide the endpoint handles.
@@ -349,7 +349,7 @@ bool ConnectorTool::_ptHandleTest(Geom::Point& p, gchar **href)
*href = g_strdup_printf("#%s", this->active_handle->owner->getId());
return true;
}
- *href = NULL;
+ *href = nullptr;
return false;
}
@@ -726,7 +726,7 @@ bool ConnectorTool::_handleKeyPress(guint const keyval)
if (this->state == SP_CONNECTOR_CONTEXT_REROUTING) {
SPDocument *doc = desktop->getDocument();
- this->_reroutingFinish(NULL);
+ this->_reroutingFinish(nullptr);
DocumentUndo::undo(doc);
@@ -753,18 +753,18 @@ void ConnectorTool::_reroutingFinish(Geom::Point *const p)
// Clear the temporary path:
this->red_curve->reset();
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), NULL);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), nullptr);
- if (p != NULL) {
+ if (p != nullptr) {
// Test whether we clicked on a connection point
gchar *shape_label;
bool found = this->_ptHandleTest(*p, &shape_label);
if (found) {
if (this->clickedhandle == this->endpt_handle[0]) {
- this->clickeditem->setAttribute("inkscape:connection-start", shape_label, NULL);
+ this->clickeditem->setAttribute("inkscape:connection-start", shape_label, nullptr);
} else {
- this->clickeditem->setAttribute("inkscape:connection-end", shape_label, NULL);
+ this->clickeditem->setAttribute("inkscape:connection-end", shape_label, nullptr);
}
g_free(shape_label);
}
@@ -781,7 +781,7 @@ void ConnectorTool::_resetColors()
{
/* Red */
this->red_curve->reset();
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), NULL);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), nullptr);
this->green_curve->reset();
this->npoints = 0;
@@ -794,7 +794,7 @@ void ConnectorTool::_setInitialPoint(Geom::Point const p)
this->p[0] = p;
this->p[1] = p;
this->npoints = 2;
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), NULL);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), nullptr);
}
void ConnectorTool::_setSubsequentPoint(Geom::Point const p)
@@ -838,7 +838,7 @@ void ConnectorTool::_concatColorsAndFlush()
this->green_curve = new SPCurve();
this->red_curve->reset();
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), NULL);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), nullptr);
if (c->is_empty()) {
c->unref();
@@ -884,7 +884,7 @@ void ConnectorTool::_flushWhite(SPCurve *gc)
sp_desktop_apply_style_tool(desktop, repr, "/tools/connector", false);
gchar *str = sp_svg_write_path( c->get_pathvector() );
- g_assert( str != NULL );
+ g_assert( str != nullptr );
repr->setAttribute("d", str);
g_free(str);
@@ -894,16 +894,16 @@ void ConnectorTool::_flushWhite(SPCurve *gc)
bool connection = false;
this->newconn->setAttribute( "inkscape:connector-type",
- this->isOrthogonal ? "orthogonal" : "polyline", NULL );
+ this->isOrthogonal ? "orthogonal" : "polyline", nullptr );
this->newconn->setAttribute( "inkscape:connector-curvature",
- Glib::Ascii::dtostr(this->curvature).c_str(), NULL );
+ Glib::Ascii::dtostr(this->curvature).c_str(), nullptr );
if (this->shref) {
- this->newconn->setAttribute( "inkscape:connection-start", this->shref, NULL);
+ this->newconn->setAttribute( "inkscape:connection-start", this->shref, nullptr);
connection = true;
}
if (this->ehref) {
- this->newconn->setAttribute( "inkscape:connection-end", this->ehref, NULL);
+ this->newconn->setAttribute( "inkscape:connection-end", this->ehref, nullptr);
connection = true;
}
// Process pending updates.
@@ -916,7 +916,7 @@ void ConnectorTool::_flushWhite(SPCurve *gc)
this->newconn->updateRepr();
}
- this->newconn->doWriteTransform(this->newconn->transform, NULL, true);
+ this->newconn->doWriteTransform(this->newconn->transform, nullptr, true);
// Only set the selection after we are finished with creating the attributes of
// the connector. Otherwise, the selection change may alter the defaults for
@@ -956,14 +956,14 @@ void ConnectorTool::_finish()
if (this->newConnRef) {
this->newConnRef->router()->deleteConnector(this->newConnRef);
- this->newConnRef = NULL;
+ this->newConnRef = nullptr;
}
}
static gboolean cc_generic_knot_handler(SPCanvasItem *, GdkEvent *event, SPKnot *knot)
{
- g_assert (knot != NULL);
+ g_assert (knot != nullptr);
//g_object_ref(knot);
knot_ref(knot);
@@ -993,7 +993,7 @@ static gboolean cc_generic_knot_handler(SPCanvasItem *, GdkEvent *event, SPKnot
* It seems that a signal is not correctly disconnected, maybe
* something missing in cc_clear_active_conn()? */
if (cc) {
- cc->active_handle = NULL;
+ cc->active_handle = nullptr;
}
if (knot_tip) {
@@ -1062,7 +1062,7 @@ static gboolean endpt_handler(SPKnot */*knot*/, GdkEvent *event, ConnectorTool *
void ConnectorTool::_activeShapeAddKnot(SPItem* item)
{
- SPKnot *knot = new SPKnot(desktop, 0);
+ SPKnot *knot = new SPKnot(desktop, nullptr);
knot->owner = item;
knot->setShape(SP_KNOT_SHAPE_SQUARE);
@@ -1087,7 +1087,7 @@ void ConnectorTool::_activeShapeAddKnot(SPItem* item)
void ConnectorTool::_setActiveShape(SPItem *item)
{
- g_assert(item != NULL );
+ g_assert(item != nullptr );
if (this->active_shape != item) {
// The active shape has changed
@@ -1162,7 +1162,7 @@ void ConnectorTool::cc_set_active_conn(SPItem *item)
if (this->active_conn_repr) {
sp_repr_remove_listener_by_data(this->active_conn_repr, this);
Inkscape::GC::release(this->active_conn_repr);
- this->active_conn_repr = NULL;
+ this->active_conn_repr = nullptr;
}
// Listen in case the active conn changes
@@ -1174,7 +1174,7 @@ void ConnectorTool::cc_set_active_conn(SPItem *item)
for (int i = 0; i < 2; ++i) {
// Create the handle if it doesn't exist
- if ( this->endpt_handle[i] == NULL ) {
+ if ( this->endpt_handle[i] == nullptr ) {
SPKnot *knot = new SPKnot(this->desktop,
_("<b>Connector endpoint</b>: drag to reroute or connect to new shapes"));
@@ -1238,7 +1238,7 @@ void cc_create_connection_point(ConnectorTool* cc)
cc_deselect_handle( cc->selected_handle );
}
- SPKnot *knot = new SPKnot(cc->desktop, 0);
+ SPKnot *knot = new SPKnot(cc->desktop, nullptr);
// We do not process events on this knot.
g_signal_handler_disconnect(G_OBJECT(knot->item),
@@ -1289,7 +1289,7 @@ bool cc_item_is_connector(SPItem *item)
void cc_selection_set_avoid(bool const set_avoid)
{
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- if (desktop == NULL) {
+ if (desktop == nullptr) {
return;
}
@@ -1301,10 +1301,10 @@ void cc_selection_set_avoid(bool const set_avoid)
int changes = 0;
for (SPItem *item: selection->items()) {
- char const *value = (set_avoid) ? "true" : NULL;
+ char const *value = (set_avoid) ? "true" : nullptr;
if (cc_item_is_shape(item)) {
- item->setAttribute("inkscape:connector-avoid", value, NULL);
+ item->setAttribute("inkscape:connector-avoid", value, nullptr);
item->avoidRef->handleSettingChange();
changes++;
}
@@ -1331,7 +1331,7 @@ void ConnectorTool::_selectionChanged(Inkscape::Selection *selection)
return;
}
- if (item == NULL) {
+ if (item == nullptr) {
this->cc_clear_active_conn();
return;
}
diff --git a/src/ui/tools/dropper-tool.cpp b/src/ui/tools/dropper-tool.cpp
index 07fc4b719..0c81e179c 100644
--- a/src/ui/tools/dropper-tool.cpp
+++ b/src/ui/tools/dropper-tool.cpp
@@ -72,8 +72,8 @@ DropperTool::DropperTool()
, stroke(false)
, dropping(false)
, dragging(false)
- , grabbed(NULL)
- , area(NULL)
+ , grabbed(nullptr)
+ , area(nullptr)
, centre(0, 0)
{
}
@@ -113,12 +113,12 @@ void DropperTool::finish() {
if (this->grabbed) {
sp_canvas_item_ungrab(this->grabbed, GDK_CURRENT_TIME);
- this->grabbed = NULL;
+ this->grabbed = nullptr;
}
if (this->area) {
sp_canvas_item_destroy(this->area);
- this->area = NULL;
+ this->area = nullptr;
}
ToolBase::finish();
@@ -211,7 +211,7 @@ bool DropperTool::root_handler(GdkEvent* event) {
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK,
- NULL, event->button.time);
+ nullptr, event->button.time);
this->grabbed = SP_CANVAS_ITEM(desktop->acetate);
break;
@@ -299,7 +299,7 @@ bool DropperTool::root_handler(GdkEvent* event) {
if (this->grabbed) {
sp_canvas_item_ungrab(this->grabbed, event->button.time);
- this->grabbed = NULL;
+ this->grabbed = nullptr;
}
Inkscape::Selection *selection = desktop->getSelection();
diff --git a/src/ui/tools/dynamic-base.cpp b/src/ui/tools/dynamic-base.cpp
index 1026c26c6..8bc1ddb97 100644
--- a/src/ui/tools/dynamic-base.cpp
+++ b/src/ui/tools/dynamic-base.cpp
@@ -20,15 +20,15 @@ namespace Tools {
DynamicBase::DynamicBase(gchar const *const *cursor_shape)
: ToolBase(cursor_shape)
- , accumulated(NULL)
- , currentshape(NULL)
- , currentcurve(NULL)
- , cal1(NULL)
- , cal2(NULL)
+ , accumulated(nullptr)
+ , currentshape(nullptr)
+ , currentcurve(nullptr)
+ , cal1(nullptr)
+ , cal2(nullptr)
, point1()
, point2()
, npoints(0)
- , repr(NULL)
+ , repr(nullptr)
, cur(0, 0)
, vel(0, 0)
, vel_max(0)
@@ -58,7 +58,7 @@ DynamicBase::DynamicBase(gchar const *const *cursor_shape)
DynamicBase::~DynamicBase() {
if (this->accumulated) {
this->accumulated = this->accumulated->unref();
- this->accumulated = 0;
+ this->accumulated = nullptr;
}
for (auto i:segments) {
@@ -68,22 +68,22 @@ DynamicBase::~DynamicBase() {
if (this->currentcurve) {
this->currentcurve = this->currentcurve->unref();
- this->currentcurve = 0;
+ this->currentcurve = nullptr;
}
if (this->cal1) {
this->cal1 = this->cal1->unref();
- this->cal1 = 0;
+ this->cal1 = nullptr;
}
if (this->cal2) {
this->cal2 = this->cal2->unref();
- this->cal2 = 0;
+ this->cal2 = nullptr;
}
if (this->currentshape) {
sp_canvas_item_destroy(this->currentshape);
- this->currentshape = 0;
+ this->currentshape = nullptr;
}
}
diff --git a/src/ui/tools/eraser-tool.cpp b/src/ui/tools/eraser-tool.cpp
index 6d1c24f07..a76234aa4 100644
--- a/src/ui/tools/eraser-tool.cpp
+++ b/src/ui/tools/eraser-tool.cpp
@@ -115,7 +115,7 @@ void EraserTool::setup() {
this->cal1 = new SPCurve();
this->cal2 = new SPCurve();
- this->currentshape = sp_canvas_item_new(desktop->getSketch(), SP_TYPE_CANVAS_BPATH, NULL);
+ this->currentshape = sp_canvas_item_new(desktop->getSketch(), SP_TYPE_CANVAS_BPATH, nullptr);
sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(this->currentshape), ERC_RED_RGBA, SP_WIND_RULE_EVENODD);
sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(this->currentshape), 0x00000000, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
@@ -372,7 +372,7 @@ void EraserTool::cancel() {
this->accumulated->reset();
this->clear_current();
if (this->repr) {
- this->repr = NULL;
+ this->repr = nullptr;
}
}
@@ -397,7 +397,7 @@ bool EraserTool::root_handler(GdkEvent* event) {
this->accumulated->reset();
if (this->repr) {
- this->repr = NULL;
+ this->repr = nullptr;
}
if ( eraser_mode == ERASER_MODE_DELETE ) {
Inkscape::Rubberband::get(desktop)->start(desktop, button_dt);
@@ -411,7 +411,7 @@ bool EraserTool::root_handler(GdkEvent* event) {
GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK |
GDK_BUTTON_PRESS_MASK ),
- NULL,
+ nullptr,
event->button.time);
ret = TRUE;
@@ -482,7 +482,7 @@ bool EraserTool::root_handler(GdkEvent* event) {
this->clear_current();
if (this->repr) {
- this->repr = NULL;
+ this->repr = nullptr;
}
this->message_context->clear();
@@ -625,7 +625,7 @@ bool EraserTool::root_handler(GdkEvent* event) {
void EraserTool::clear_current() {
// reset bpath
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->currentshape), NULL);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->currentshape), nullptr);
// reset curve
this->currentcurve->reset();
@@ -657,7 +657,7 @@ void EraserTool::set_to_accumulated() {
Geom::PathVector pathv = this->accumulated->get_pathvector() * this->desktop->dt2doc();
pathv *= item_repr->i2doc_affine().inverse();
gchar *str = sp_svg_write_path(pathv);
- g_assert( str != NULL );
+ g_assert( str != nullptr );
this->repr->setAttribute("d", str);
g_free(str);
Geom::OptRect eraserBbox;
@@ -723,7 +723,7 @@ void EraserTool::set_to_accumulated() {
sp_repr_css_set_property(css, "fill-rule", "evenodd");
sp_desktop_set_style(this->desktop, css);
sp_repr_css_attr_unref(css);
- css = 0;
+ css = nullptr;
}
if (this->nowidth) {
selection->pathCut(true);
@@ -842,12 +842,12 @@ void EraserTool::set_to_accumulated() {
}
// Remove the eraser stroke itself:
sp_repr_unparent( this->repr );
- this->repr = 0;
+ this->repr = nullptr;
}
} else {
if (this->repr) {
sp_repr_unparent(this->repr);
- this->repr = 0;
+ this->repr = nullptr;
}
}
if ( workDone ) {
@@ -1047,7 +1047,7 @@ void EraserTool::fit_and_split(bool release) {
gint eraser_mode = prefs->getInt("/tools/eraser/mode",2);
g_assert(!this->currentcurve->is_empty());
- SPCanvasItem *cbp = sp_canvas_item_new(desktop->getSketch(), SP_TYPE_CANVAS_BPATH, NULL);
+ SPCanvasItem *cbp = sp_canvas_item_new(desktop->getSketch(), SP_TYPE_CANVAS_BPATH, nullptr);
SPCurve *curve = this->currentcurve->copy();
sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH (cbp), curve, true);
curve->unref();
diff --git a/src/ui/tools/flood-tool.cpp b/src/ui/tools/flood-tool.cpp
index 487f3f7d8..aaa5f1d9a 100644
--- a/src/ui/tools/flood-tool.cpp
+++ b/src/ui/tools/flood-tool.cpp
@@ -109,7 +109,7 @@ const std::vector<Glib::ustring> FloodTool::gap_list( gap_init, gap_init+4 );
FloodTool::FloodTool()
: ToolBase(cursor_paintbucket_xpm)
- , item(NULL)
+ , item(nullptr)
{
// TODO: Why does the flood tool use a hardcoded tolerance instead of a pref?
this->tolerance = 4;
@@ -119,7 +119,7 @@ FloodTool::~FloodTool() {
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->item) {
@@ -450,7 +450,7 @@ static void do_trace(bitmap_coords_info bci, guchar *trace_px, SPDesktop *deskto
g_free(str);
}
- desktop->currentLayer()->addChild(pathRepr,NULL);
+ desktop->currentLayer()->addChild(pathRepr,nullptr);
SPObject *reprobj = document->getObjectByRepr(pathRepr);
if (reprobj) {
@@ -1227,7 +1227,7 @@ bool FloodTool::root_handler(GdkEvent* event) {
void FloodTool::finishItem() {
this->message_context->clear();
- if (this->item != NULL) {
+ if (this->item != nullptr) {
this->item->updateRepr();
desktop->canvas->endForcedFullRedraws();
@@ -1236,7 +1236,7 @@ void FloodTool::finishItem() {
DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_PAINTBUCKET, _("Fill bounded area"));
- this->item = NULL;
+ this->item = nullptr;
}
}
diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp
index a9b3ff8f5..ba2609975 100644
--- a/src/ui/tools/freehand-base.cpp
+++ b/src/ui/tools/freehand-base.cpp
@@ -76,24 +76,24 @@ static void spdc_free_colors(FreehandBase *dc);
FreehandBase::FreehandBase(gchar const *const *cursor_shape)
: ToolBase(cursor_shape)
- , selection(NULL)
- , grab(NULL)
+ , selection(nullptr)
+ , grab(nullptr)
, attach(false)
, red_color(0xff00007f)
, blue_color(0x0000ff7f)
, green_color(0x00ff007f)
, highlight_color(0x0000007f)
- , red_bpath(NULL)
- , red_curve(NULL)
- , blue_bpath(NULL)
- , blue_curve(NULL)
- , green_curve(NULL)
- , green_anchor(NULL)
+ , red_bpath(nullptr)
+ , red_curve(nullptr)
+ , blue_bpath(nullptr)
+ , blue_curve(nullptr)
+ , green_curve(nullptr)
+ , green_anchor(nullptr)
, green_closed(false)
- , white_item(NULL)
- , sa_overwrited(NULL)
- , sa(NULL)
- , ea(NULL)
+ , white_item(nullptr)
+ , sa_overwrited(nullptr)
+ , sa(nullptr)
+ , ea(nullptr)
, waiting_LPE_type(Inkscape::LivePathEffect::INVALID_LPE)
, red_curve_is_valid(false)
, anchor_statusbar(false)
@@ -106,11 +106,11 @@ FreehandBase::FreehandBase(gchar const *const *cursor_shape)
FreehandBase::~FreehandBase() {
if (this->grab) {
sp_canvas_item_ungrab(this->grab, GDK_CURRENT_TIME);
- this->grab = NULL;
+ this->grab = nullptr;
}
if (this->selection) {
- this->selection = NULL;
+ this->selection = nullptr;
}
spdc_free_colors(this);
@@ -130,14 +130,14 @@ void FreehandBase::setup() {
);
// Create red bpath
- this->red_bpath = sp_canvas_bpath_new(this->desktop->getSketch(), NULL);
+ this->red_bpath = sp_canvas_bpath_new(this->desktop->getSketch(), nullptr);
sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(this->red_bpath), this->red_color, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
// Create red curve
this->red_curve = new SPCurve();
// Create blue bpath
- this->blue_bpath = sp_canvas_bpath_new(this->desktop->getSketch(), NULL);
+ this->blue_bpath = sp_canvas_bpath_new(this->desktop->getSketch(), nullptr);
sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(this->blue_bpath), this->blue_color, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
// Create blue curve
@@ -147,7 +147,7 @@ void FreehandBase::setup() {
this->green_curve = new SPCurve();
// No green anchor by default
- this->green_anchor = NULL;
+ this->green_anchor = nullptr;
this->green_closed = FALSE;
// Create start anchor alternative curve
@@ -166,7 +166,7 @@ void FreehandBase::finish() {
}
if (this->selection) {
- this->selection = NULL;
+ this->selection = nullptr;
}
spdc_free_colors(this);
@@ -248,7 +248,7 @@ static void spdc_apply_powerstroke_shape(std::vector<Geom::Point> points, Freeha
return;
}
Effect* lpe = SP_LPE_ITEM(item)->getCurrentLPE();
- LPEPowerStroke* ps = NULL;
+ LPEPowerStroke* ps = nullptr;
pt->addPowerStrokePencil(c);
if (lpe) {
ps = static_cast<LPEPowerStroke*>(lpe);
@@ -483,7 +483,7 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item,
if(pasted_clipboard){
Inkscape::XML::Node *pasted_clipboard_root = pasted_clipboard->getRepr();
Inkscape::XML::Node *path = sp_repr_lookup_name(pasted_clipboard_root, "svg:path", -1); // unlimited search depth
- if ( path != NULL ) {
+ if ( path != nullptr ) {
gchar const *svgd = path->attribute("d");
dc->selection->remove(SP_OBJECT(pasted_clipboard));
previous_shape_pathv = sp_svg_read_pathv(svgd);
@@ -528,7 +528,7 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item,
shape = BEND_CLIPBOARD;
} else {
- bend_item = NULL;
+ bend_item = nullptr;
shape = NONE;
}
break;
@@ -544,7 +544,7 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item,
shape = NONE;
}
} else {
- if(bend_item != NULL && bend_item->getRepr() != NULL){
+ if(bend_item != nullptr && bend_item->getRepr() != nullptr){
gchar const *svgd = item->getRepr()->attribute("d");
dc->selection->add(SP_OBJECT(bend_item));
dc->selection->duplicate();
@@ -630,10 +630,10 @@ static void spdc_attach_selection(FreehandBase *dc, Inkscape::Selection */*sel*/
}
// We reset white and forget white/start/end anchors
spdc_reset_white(dc);
- dc->sa = NULL;
- dc->ea = NULL;
+ dc->sa = nullptr;
+ dc->ea = nullptr;
- SPItem *item = dc->selection ? dc->selection->singleItem() : NULL;
+ SPItem *item = dc->selection ? dc->selection->singleItem() : nullptr;
if ( item && SP_IS_PATH(item) ) {
// Create new white data
@@ -644,7 +644,7 @@ static void spdc_attach_selection(FreehandBase *dc, Inkscape::Selection */*sel*/
// We keep it in desktop coordinates to eliminate calculation errors
SPCurve *norm = SP_PATH(item)->getCurveForEdit();
norm->transform((dc->white_item)->i2dt_affine());
- g_return_if_fail( norm != NULL );
+ g_return_if_fail( norm != nullptr );
dc->white_curves = norm->split();
norm->unref();
@@ -737,14 +737,14 @@ void spdc_concat_colors_and_flush(FreehandBase *dc, gboolean forceclosed)
// Blue
c->append_continuous(dc->blue_curve, 0.0625);
dc->blue_curve->reset();
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(dc->blue_bpath), NULL);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(dc->blue_bpath), nullptr);
// Red
if (dc->red_curve_is_valid) {
c->append_continuous(dc->red_curve, 0.0625);
}
dc->red_curve->reset();
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(dc->red_bpath), NULL);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(dc->red_bpath), nullptr);
if (c->is_empty()) {
c->unref();
@@ -780,7 +780,7 @@ void spdc_concat_colors_and_flush(FreehandBase *dc, gboolean forceclosed)
dc->white_curves.erase(std::find(dc->white_curves.begin(),dc->white_curves.end(), dc->sa->curve));
}
dc->white_curves.push_back(dc->sa_overwrited);
- spdc_flush_white(dc, NULL);
+ spdc_flush_white(dc, nullptr);
return;
}
// Step C - test start
@@ -874,7 +874,7 @@ static void spdc_flush_white(FreehandBase *dc, SPCurve *gc)
}
gchar *str = sp_svg_write_path( c->get_pathvector() );
- g_assert( str != NULL );
+ g_assert( str != nullptr );
if (has_lpe)
repr->setAttribute("inkscape:original-d", str);
else
@@ -898,7 +898,7 @@ static void spdc_flush_white(FreehandBase *dc, SPCurve *gc)
Inkscape::GC::release(repr);
item->transform = SP_ITEM(desktop->currentLayer())->i2doc_affine().inverse();
item->updateRepr();
- item->doWriteTransform(item->transform, NULL, true);
+ item->doWriteTransform(item->transform, nullptr, true);
spdc_check_for_and_apply_waiting_LPE(dc, item, c, false);
dc->selection->set(repr);
if(previous_shape_type == BEND_CLIPBOARD){
@@ -924,7 +924,7 @@ static void spdc_flush_white(FreehandBase *dc, SPCurve *gc)
SPDrawAnchor *spdc_test_inside(FreehandBase *dc, Geom::Point p)
{
- SPDrawAnchor *active = NULL;
+ SPDrawAnchor *active = nullptr;
// Test green anchor
if (dc->green_anchor) {
@@ -944,7 +944,7 @@ static void spdc_reset_white(FreehandBase *dc)
{
if (dc->white_item) {
// We do not hold refcount
- dc->white_item = NULL;
+ dc->white_item = nullptr;
}
for (auto i: dc->white_curves)
i->unref();
@@ -959,7 +959,7 @@ static void spdc_free_colors(FreehandBase *dc)
// Red
if (dc->red_bpath) {
sp_canvas_item_destroy(SP_CANVAS_ITEM(dc->red_bpath));
- dc->red_bpath = NULL;
+ dc->red_bpath = nullptr;
}
if (dc->red_curve) {
dc->red_curve = dc->red_curve->unref();
@@ -968,7 +968,7 @@ static void spdc_free_colors(FreehandBase *dc)
// Blue
if (dc->blue_bpath) {
sp_canvas_item_destroy(SP_CANVAS_ITEM(dc->blue_bpath));
- dc->blue_bpath = NULL;
+ dc->blue_bpath = nullptr;
}
if (dc->blue_curve) {
dc->blue_curve = dc->blue_curve->unref();
@@ -992,7 +992,7 @@ static void spdc_free_colors(FreehandBase *dc)
// White
if (dc->white_item) {
// We do not hold refcount
- dc->white_item = NULL;
+ dc->white_item = nullptr;
}
for (auto i: dc->white_curves)
i->unref();
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:
diff --git a/src/ui/tools/lpe-tool.cpp b/src/ui/tools/lpe-tool.cpp
index f62a70c34..c523b7bde 100644
--- a/src/ui/tools/lpe-tool.cpp
+++ b/src/ui/tools/lpe-tool.cpp
@@ -73,8 +73,8 @@ const std::string LpeTool::prefsPath = "/tools/lpetool";
LpeTool::LpeTool()
: PenTool(cursor_crosshairs_xpm)
- , shape_editor(NULL)
- , canvas_bbox(NULL)
+ , shape_editor(nullptr)
+ , canvas_bbox(nullptr)
, mode(Inkscape::LivePathEffect::BEND_PATH)
// TODO: pointer?
, measuring_items(new std::map<SPPath *, SPCanvasItem*>)
@@ -83,16 +83,16 @@ LpeTool::LpeTool()
LpeTool::~LpeTool() {
delete this->shape_editor;
- this->shape_editor = NULL;
+ this->shape_editor = nullptr;
if (this->canvas_bbox) {
sp_canvas_item_destroy(SP_CANVAS_ITEM(this->canvas_bbox));
- this->canvas_bbox = NULL;
+ this->canvas_bbox = nullptr;
}
lpetool_delete_measuring_items(this);
delete this->measuring_items;
- this->measuring_items = NULL;
+ this->measuring_items = nullptr;
this->sel_changed_connection.disconnect();
}
@@ -343,7 +343,7 @@ lpetool_context_reset_limiting_bbox(LpeTool *lc)
{
if (lc->canvas_bbox) {
sp_canvas_item_destroy(lc->canvas_bbox);
- lc->canvas_bbox = NULL;
+ lc->canvas_bbox = nullptr;
}
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
@@ -407,7 +407,7 @@ lpetool_create_measuring_items(LpeTool *lc, Inkscape::Selection *selection)
if (!show)
sp_canvas_item_hide(SP_CANVAS_ITEM(canvas_text));
- Inkscape::Util::Unit const * unit = NULL;
+ Inkscape::Util::Unit const * unit = nullptr;
if (prefs->getString("/tools/lpetool/unit").compare("")) {
unit = unit_table.getUnit(prefs->getString("/tools/lpetool/unit"));
} else {
@@ -446,7 +446,7 @@ lpetool_update_measuring_items(LpeTool *lc)
SPPath *path = i->first;
SPCurve *curve = path->getCurve();
Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2 = Geom::paths_to_pw(curve->get_pathvector());
- Inkscape::Util::Unit const * unit = NULL;
+ Inkscape::Util::Unit const * unit = nullptr;
if (prefs->getString("/tools/lpetool/unit").compare("")) {
unit = unit_table.getUnit(prefs->getString("/tools/lpetool/unit"));
} else {
diff --git a/src/ui/tools/lpe-tool.h b/src/ui/tools/lpe-tool.h
index d3a5a056e..ead4095a8 100644
--- a/src/ui/tools/lpe-tool.h
+++ b/src/ui/tools/lpe-tool.h
@@ -76,7 +76,7 @@ bool lpetool_try_construction(LpeTool *lc, Inkscape::LivePathEffect::EffectType
void lpetool_context_switch_mode(LpeTool *lc, Inkscape::LivePathEffect::EffectType const type);
void lpetool_get_limiting_bbox_corners(SPDocument *document, Geom::Point &A, Geom::Point &B);
void lpetool_context_reset_limiting_bbox(LpeTool *lc);
-void lpetool_create_measuring_items(LpeTool *lc, Inkscape::Selection *selection = NULL);
+void lpetool_create_measuring_items(LpeTool *lc, Inkscape::Selection *selection = nullptr);
void lpetool_delete_measuring_items(LpeTool *lc);
void lpetool_update_measuring_items(LpeTool *lc);
void lpetool_show_measuring_info(LpeTool *lc, bool show = true);
diff --git a/src/ui/tools/measure-tool.cpp b/src/ui/tools/measure-tool.cpp
index c2bc23d8b..633bf6ec3 100644
--- a/src/ui/tools/measure-tool.cpp
+++ b/src/ui/tools/measure-tool.cpp
@@ -244,11 +244,11 @@ void setMeasureItem(Geom::PathVector pathv, bool is_curve, bool markers, guint32
sp_repr_css_write_string(css,css_str);
repr->setAttribute("style", css_str.c_str());
sp_repr_css_attr_unref (css);
- g_assert( str != NULL );
+ g_assert( str != nullptr );
repr->setAttribute("d", str);
g_free(str);
if(measure_repr) {
- measure_repr->addChild(repr, NULL);
+ measure_repr->addChild(repr, nullptr);
Inkscape::GC::release(repr);
} else {
SPItem *item = SP_ITEM(desktop->currentLayer()->appendChildRepr(repr));
@@ -269,7 +269,7 @@ void setMeasureItem(Geom::PathVector pathv, bool is_curve, bool markers, guint32
* @param angle the angle of the arc segment to draw.
* @param measure_rpr the container of the curve if converted to items.
*/
-void createAngleDisplayCurve(SPDesktop *desktop, Geom::Point const &center, Geom::Point const &end, Geom::Point const &anchor, double angle, bool to_phantom, std::vector<SPCanvasItem *> &measure_phantom_items , std::vector<SPCanvasItem *> &measure_tmp_items , Inkscape::XML::Node *measure_repr = NULL)
+void createAngleDisplayCurve(SPDesktop *desktop, Geom::Point const &center, Geom::Point const &end, Geom::Point const &anchor, double angle, bool to_phantom, std::vector<SPCanvasItem *> &measure_phantom_items , std::vector<SPCanvasItem *> &measure_tmp_items , Inkscape::XML::Node *measure_repr = nullptr)
{
// Given that we have a point on the arc's edge and the angle of the arc, we need to get the two endpoints.
@@ -333,7 +333,7 @@ boost::optional<Geom::Point> explicit_base_tmp = boost::none;
MeasureTool::MeasureTool()
: ToolBase(cursor_measure_xpm)
- , grabbed(NULL)
+ , grabbed(nullptr)
{
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
start_p = readMeasurePoint(true);
@@ -519,7 +519,7 @@ void MeasureTool::finish()
if (this->grabbed) {
sp_canvas_item_ungrab(this->grabbed, GDK_CURRENT_TIME);
- this->grabbed = NULL;
+ this->grabbed = nullptr;
}
ToolBase::finish();
@@ -540,9 +540,9 @@ static void calculate_intersections(SPDesktop * /*desktop*/, SPItem* item, Geom:
if (!show_hidden) {
double eps = 0.0001;
if (((*m).ta > eps &&
- item == desktop->getItemAtPoint(desktop->d2w(desktop->dt2doc(lineseg[0].pointAt((*m).ta - eps))), true, NULL)) ||
+ item == desktop->getItemAtPoint(desktop->d2w(desktop->dt2doc(lineseg[0].pointAt((*m).ta - eps))), true, nullptr)) ||
((*m).ta + eps < 1 &&
- item == desktop->getItemAtPoint(desktop->d2w(desktop->dt2doc(lineseg[0].pointAt((*m).ta + eps))), true, NULL))) {
+ item == desktop->getItemAtPoint(desktop->d2w(desktop->dt2doc(lineseg[0].pointAt((*m).ta + eps))), true, nullptr))) {
intersections.push_back((*m).ta);
}
} else {
@@ -579,7 +579,7 @@ bool MeasureTool::root_handler(GdkEvent* event)
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK,
- NULL, event->button.time);
+ nullptr, event->button.time);
this->grabbed = SP_CANVAS_ITEM(desktop->acetate);
break;
}
@@ -676,7 +676,7 @@ bool MeasureTool::root_handler(GdkEvent* event)
if (this->grabbed) {
sp_canvas_item_ungrab(this->grabbed, event->button.time);
- this->grabbed = NULL;
+ this->grabbed = nullptr;
}
break;
}
@@ -969,11 +969,11 @@ void MeasureTool::setLabelText(const char *value, Geom::Point pos, double fontsi
sp_repr_css_write_string(css,css_str);
rtspan->setAttribute("style", css_str.c_str());
sp_repr_css_attr_unref (css);
- rtext->addChild(rtspan, NULL);
+ rtext->addChild(rtspan, nullptr);
Inkscape::GC::release(rtspan);
/* Create TEXT */
Inkscape::XML::Node *rstring = xml_doc->createTextNode(value);
- rtspan->addChild(rstring, NULL);
+ rtspan->addChild(rstring, nullptr);
Inkscape::GC::release(rstring);
SPItem *text_item = SP_ITEM(desktop->currentLayer()->appendChildRepr(rtext));
Inkscape::GC::release(rtext);
@@ -1007,9 +1007,9 @@ void MeasureTool::setLabelText(const char *value, Geom::Point pos, double fontsi
sp_repr_set_svg_double(rrect, "height", bbox->height() + 6);
Inkscape::XML::Node *rtextitem = text_item->getRepr();
text_item->deleteObject();
- rgroup->addChild(rtextitem, NULL);
+ rgroup->addChild(rtextitem, nullptr);
Inkscape::GC::release(rtextitem);
- rgroup->addChild(rrect, NULL);
+ rgroup->addChild(rrect, nullptr);
Inkscape::GC::release(rrect);
SPItem *text_item_box = SP_ITEM(desktop->currentLayer()->appendChildRepr(rgroup));
Geom::Scale scale = Geom::Scale(desktop->current_zoom()).inverse();
@@ -1021,16 +1021,16 @@ void MeasureTool::setLabelText(const char *value, Geom::Point pos, double fontsi
text_item_box->transform *= Geom::Translate(pos);
text_item_box->transform *= SP_ITEM(desktop->currentLayer())->i2doc_affine().inverse();
text_item_box->updateRepr();
- text_item_box->doWriteTransform(text_item_box->transform, NULL, true);
+ text_item_box->doWriteTransform(text_item_box->transform, nullptr, true);
Inkscape::XML::Node *rlabel = text_item_box->getRepr();
text_item_box->deleteObject();
- measure_repr->addChild(rlabel, NULL);
+ measure_repr->addChild(rlabel, nullptr);
Inkscape::GC::release(rlabel);
} else {
text_item->transform *= Geom::Rotate(angle);
text_item->transform *= Geom::Translate(pos);
text_item->transform *= SP_ITEM(desktop->currentLayer())->i2doc_affine().inverse();
- text_item->doWriteTransform(text_item->transform, NULL, true);
+ text_item->doWriteTransform(text_item->transform, nullptr, true);
}
}
@@ -1195,7 +1195,7 @@ void MeasureTool::showInfoBox(Geom::Point cursor, bool into_groups)
}
}
}
- gchar *measure_str = NULL;
+ gchar *measure_str = nullptr;
std::stringstream precision_str;
precision_str.imbue(std::locale::classic());
double origin = Inkscape::Util::Quantity::convert(14, "px", unit->abbr);
@@ -1285,8 +1285,8 @@ void MeasureTool::showCanvasItems(bool to_guides, bool to_item, bool to_phantom,
SPDocument *doc = desktop->getDocument();
Geom::Rect rect(start_p, end_p);
items = doc->getItemsPartiallyInBox(desktop->dkey, rect, false, true);
- Inkscape::LayerModel *layer_model = NULL;
- SPObject *current_layer = NULL;
+ Inkscape::LayerModel *layer_model = nullptr;
+ SPObject *current_layer = nullptr;
if(desktop){
layer_model = desktop->layers;
current_layer = desktop->currentLayer();
diff --git a/src/ui/tools/measure-tool.h b/src/ui/tools/measure-tool.h
index 519e849c3..e50caa434 100644
--- a/src/ui/tools/measure-tool.h
+++ b/src/ui/tools/measure-tool.h
@@ -43,7 +43,7 @@ public:
void finish() override;
bool root_handler(GdkEvent* event) override;
- virtual void showCanvasItems(bool to_guides = false, bool to_item = false, bool to_phantom = false, Inkscape::XML::Node *measure_repr = NULL);
+ virtual void showCanvasItems(bool to_guides = false, bool to_item = false, bool to_phantom = false, Inkscape::XML::Node *measure_repr = nullptr);
virtual void reverseKnots();
virtual void toGuides();
virtual void toPhantom();
@@ -59,11 +59,11 @@ public:
void writeMeasurePoint(Geom::Point point, bool is_start);
void setGuide(Geom::Point origin, double angle, const char *label);
void setPoint(Geom::Point origin, Inkscape::XML::Node *measure_repr);
- void setLine(Geom::Point start_point,Geom::Point end_point, bool markers, guint32 color, Inkscape::XML::Node *measure_repr = NULL);
+ void setLine(Geom::Point start_point,Geom::Point end_point, bool markers, guint32 color, Inkscape::XML::Node *measure_repr = nullptr);
void setMeasureCanvasText(bool is_angle, double precision, double amount, double fontsize, Glib::ustring unit_name, Geom::Point position, guint32 background, CanvasTextAnchorPositionEnum text_anchor, bool to_item, bool to_phantom, Inkscape::XML::Node *measure_repr);
void setMeasureCanvasItem(Geom::Point position, bool to_item, bool to_phantom, Inkscape::XML::Node *measure_repr);
void setMeasureCanvasControlLine(Geom::Point start, Geom::Point end, bool to_item, bool to_phantom, Inkscape::CtrlLineType ctrl_line_type, Inkscape::XML::Node *measure_repr);
- void setLabelText(const char *value, Geom::Point pos, double fontsize, Geom::Coord angle, guint32 background , Inkscape::XML::Node *measure_repr = NULL, CanvasTextAnchorPositionEnum text_anchor = TEXT_ANCHOR_CENTER );
+ void setLabelText(const char *value, Geom::Point pos, double fontsize, Geom::Coord angle, guint32 background , Inkscape::XML::Node *measure_repr = nullptr, CanvasTextAnchorPositionEnum text_anchor = TEXT_ANCHOR_CENTER );
void knotStartMovedHandler(SPKnot */*knot*/, Geom::Point const &ppointer, guint state);
void knotEndMovedHandler(SPKnot */*knot*/, Geom::Point const &ppointer, guint state);
void knotClickHandler(SPKnot *knot, guint state);
diff --git a/src/ui/tools/mesh-tool.cpp b/src/ui/tools/mesh-tool.cpp
index e94da4813..93b94d750 100644
--- a/src/ui/tools/mesh-tool.cpp
+++ b/src/ui/tools/mesh-tool.cpp
@@ -74,8 +74,8 @@ const std::string MeshTool::prefsPath = "/tools/mesh";
MeshTool::MeshTool()
: ToolBase(cursor_gradient_xpm)
// TODO: Why are these connections stored as pointers?
- , selcon(NULL)
- , subselcon(NULL)
+ , selcon(nullptr)
+ , subselcon(nullptr)
, cursor_addnode(false)
, node_added(false)
, show_handles(true)
@@ -118,7 +118,7 @@ void MeshTool::selection_changed(Inkscape::Selection* /*sel*/) {
GrDrag *drag = this->_grdrag;
Inkscape::Selection *selection = this->desktop->getSelection();
- if (selection == NULL) {
+ if (selection == nullptr) {
return;
}
@@ -190,7 +190,7 @@ void MeshTool::setup() {
this->subselcon = new sigc::connection(this->desktop->connectToolSubselectionChanged(
sigc::hide(sigc::bind(
sigc::mem_fun(*this, &MeshTool::selection_changed),
- (Inkscape::Selection*)NULL)
+ (Inkscape::Selection*)nullptr)
)
));
@@ -310,7 +310,7 @@ sp_mesh_context_corner_operation (MeshTool *rc, MeshCornerOperation operation )
std::cout << "sp_mesh_corner_operation: entrance: " << operation << std::endl;
#endif
- SPDocument *doc = NULL;
+ SPDocument *doc = nullptr;
GrDrag *drag = rc->_grdrag;
std::map<SPMeshGradient*, std::vector<guint> > points;
@@ -442,7 +442,7 @@ sp_mesh_context_fit_mesh_in_bbox (MeshTool *rc)
SPDesktop *desktop = SP_EVENT_CONTEXT (rc)->desktop;
Inkscape::Selection *selection = desktop->getSelection();
- if (selection == NULL) {
+ if (selection == nullptr) {
return;
}
@@ -805,7 +805,7 @@ bool MeshTool::root_handler(GdkEvent* event) {
}
}
- this->item_to_select = NULL;
+ this->item_to_select = nullptr;
ret = TRUE;
}
@@ -1115,7 +1115,7 @@ static void sp_mesh_new_default(MeshTool &rc) {
if (css) {
sp_repr_css_attr_unref(css);
- css = 0;
+ css = nullptr;
}
DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_MESH, _("Create mesh"));
diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp
index d54adba89..3ec40d086 100644
--- a/src/ui/tools/node-tool.cpp
+++ b/src/ui/tools/node-tool.cpp
@@ -127,16 +127,16 @@ SPCanvasGroup *create_control_group(SPDesktop *d);
NodeTool::NodeTool()
: ToolBase(cursor_node_xpm)
- , _selected_nodes(NULL)
- , _multipath(NULL)
+ , _selected_nodes(nullptr)
+ , _multipath(nullptr)
, edit_clipping_paths(false)
, edit_masks(false)
- , flashed_item(NULL)
- , flash_tempitem(NULL)
- , _selector(NULL)
- , _path_data(NULL)
- , _transform_handle_group(NULL)
- , _last_over(NULL)
+ , flashed_item(nullptr)
+ , flash_tempitem(nullptr)
+ , _selector(nullptr)
+ , _path_data(nullptr)
+ , _transform_handle_group(nullptr)
+ , _last_over(nullptr)
, cursor_drag(false)
, show_handles(false)
, show_outline(false)
@@ -151,7 +151,7 @@ NodeTool::NodeTool()
SPCanvasGroup *create_control_group(SPDesktop *d)
{
return reinterpret_cast<SPCanvasGroup*>(sp_canvas_item_new(
- d->getControls(), SP_TYPE_CANVAS_GROUP, NULL));
+ d->getControls(), SP_TYPE_CANVAS_GROUP, nullptr));
}
void destroy_group(SPCanvasGroup *g)
@@ -219,7 +219,7 @@ void NodeTool::setup() {
this->_sizeUpdatedConn = ControlManager::getManager().connectCtrlSizeChanged(
sigc::mem_fun(this, &NodeTool::handleControlUiStyleChange)
);
- this->helperpath_tmpitem = NULL;
+ this->helperpath_tmpitem = nullptr;
this->_selected_nodes = new Inkscape::UI::ControlPointSelection(this->desktop, this->_transform_handle_group);
data.node_data.selection = this->_selected_nodes;
@@ -232,7 +232,7 @@ void NodeTool::setup() {
this->_multipath->signal_coords_changed.connect(
sigc::bind(
sigc::mem_fun(*this->desktop, &SPDesktop::emitToolSubselectionChanged),
- (void*)NULL
+ (void*)nullptr
)
);
@@ -243,16 +243,16 @@ void NodeTool::setup() {
// void update_tip(GdkEvent *event)
sigc::hide(sigc::hide(sigc::bind(
sigc::mem_fun(this, &NodeTool::update_tip),
- (GdkEvent*)NULL
+ (GdkEvent*)nullptr
)))
);
this->cursor_drag = false;
this->show_transform_handles = true;
this->single_node_transform_handles = false;
- this->flash_tempitem = NULL;
- this->flashed_item = NULL;
- this->_last_over = NULL;
+ this->flash_tempitem = nullptr;
+ this->flashed_item = nullptr;
+ this->_last_over = nullptr;
// read prefs before adding items to selection to prevent momentarily showing the outline
sp_event_context_read(this, "show_handles");
@@ -266,7 +266,7 @@ void NodeTool::setup() {
sp_event_context_read(this, "edit_masks");
this->selection_changed(selection);
- this->update_tip(NULL);
+ this->update_tip(nullptr);
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
@@ -278,7 +278,7 @@ void NodeTool::setup() {
this->enableGrDrag();
}
- this->desktop->emitToolSubselectionChanged(NULL); // sets the coord entry fields to inactive
+ this->desktop->emitToolSubselectionChanged(nullptr); // sets the coord entry fields to inactive
sp_update_helperpath();
}
@@ -292,7 +292,7 @@ void sp_update_helperpath() {
Inkscape::Selection *selection = desktop->getSelection();
if (nt->helperpath_tmpitem) {
desktop->remove_temporary_canvasitem(nt->helperpath_tmpitem);
- nt->helperpath_tmpitem = NULL;
+ nt->helperpath_tmpitem = nullptr;
}
if (SP_IS_LPE_ITEM(selection->singleItem())) {
@@ -378,7 +378,7 @@ void gather_items(NodeTool *nt, SPItem *base, SPObject *obj, Inkscape::UI::Shape
//XML Tree being used directly here while it shouldn't be.
if (SP_IS_PATH(obj) &&
- obj->getRepr()->attribute("inkscape:original-d") != NULL &&
+ obj->getRepr()->attribute("inkscape:original-d") != nullptr &&
!SP_LPE_ITEM(obj)->hasPathEffectOfType(Inkscape::LivePathEffect::POWERCLIP))
{
ShapeRecord r;
@@ -421,7 +421,7 @@ void NodeTool::selection_changed(Inkscape::Selection *sel) {
SPObject *obj = *i;
if (SP_IS_ITEM(obj)) {
- gather_items(this, NULL, static_cast<SPItem*>(obj), SHAPE_ROLE_NORMAL, shapes);
+ gather_items(this, nullptr, static_cast<SPItem*>(obj), SHAPE_ROLE_NORMAL, shapes);
}
}
@@ -457,7 +457,7 @@ void NodeTool::selection_changed(Inkscape::Selection *sel) {
_current_selection = vec;
this->_multipath->setItems(shapes);
- this->update_tip(NULL);
+ this->update_tip(nullptr);
this->desktop->updateNow();
}
@@ -524,8 +524,8 @@ bool NodeTool::root_handler(GdkEvent* event) {
if (this->flash_tempitem) {
desktop->remove_temporary_canvasitem(this->flash_tempitem);
- this->flash_tempitem = NULL;
- this->flashed_item = NULL;
+ this->flash_tempitem = nullptr;
+ this->flashed_item = nullptr;
}
if (!SP_IS_SHAPE(over_item)) {
@@ -756,7 +756,7 @@ void NodeTool::select_point(Geom::Point const &/*sel*/, GdkEventButton *event) {
SPItem *item_clicked = sp_event_context_find_item (this->desktop, event_point(*event),
(event->state & GDK_MOD1_MASK) && !(event->state & GDK_CONTROL_MASK), TRUE);
- if (item_clicked == NULL) { // nothing under cursor
+ if (item_clicked == nullptr) { // nothing under cursor
// if no Shift, deselect
// if there are nodes selected, the first click should deselect the nodes
// and the second should deselect the items
diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp
index 7dd120077..c5855540b 100644
--- a/src/ui/tools/pen-tool.cpp
+++ b/src/ui/tools/pen-tool.cpp
@@ -96,12 +96,12 @@ PenTool::PenTool()
, polylines_paraxial(false)
, num_clicks(0)
, expecting_clicks_for_LPE(0)
- , waiting_LPE(NULL)
- , waiting_item(NULL)
- , c0(NULL)
- , c1(NULL)
- , cl0(NULL)
- , cl1(NULL)
+ , waiting_LPE(nullptr)
+ , waiting_item(nullptr)
+ , c0(nullptr)
+ , c1(nullptr)
+ , cl0(nullptr)
+ , cl1(nullptr)
, events_disabled(false)
{
tablet_enabled = false;
@@ -118,12 +118,12 @@ PenTool::PenTool(gchar const *const *cursor_shape)
, polylines_paraxial(false)
, num_clicks(0)
, expecting_clicks_for_LPE(0)
- , waiting_LPE(NULL)
- , waiting_item(NULL)
- , c0(NULL)
- , c1(NULL)
- , cl0(NULL)
- , cl1(NULL)
+ , waiting_LPE(nullptr)
+ , waiting_item(nullptr)
+ , c0(nullptr)
+ , c1(nullptr)
+ , cl0(nullptr)
+ , cl1(nullptr)
, events_disabled(false)
{
}
@@ -131,19 +131,19 @@ PenTool::PenTool(gchar const *const *cursor_shape)
PenTool::~PenTool() {
if (this->c0) {
sp_canvas_item_destroy(this->c0);
- this->c0 = NULL;
+ this->c0 = nullptr;
}
if (this->c1) {
sp_canvas_item_destroy(this->c1);
- this->c1 = NULL;
+ this->c1 = nullptr;
}
if (this->cl0) {
sp_canvas_item_destroy(this->cl0);
- this->cl0 = NULL;
+ this->cl0 = nullptr;
}
if (this->cl1) {
sp_canvas_item_destroy(this->cl1);
- this->cl1 = NULL;
+ this->cl1 = nullptr;
}
if (this->expecting_clicks_for_LPE > 0) {
@@ -229,7 +229,7 @@ void PenTool::finish() {
if (this->npoints != 0) {
// switching context - finish path
- this->ea = NULL; // unset end anchor if set (otherwise crashes)
+ this->ea = nullptr; // unset end anchor if set (otherwise crashes)
this->_finish(false);
}
@@ -253,7 +253,7 @@ void PenTool::set(const Inkscape::Preferences::Entry& val) {
bool PenTool::hasWaitingLPE() {
// note: waiting_LPE_type is defined in SPDrawContext
- return (this->waiting_LPE != NULL ||
+ return (this->waiting_LPE != nullptr ||
this->waiting_LPE_type != Inkscape::LivePathEffect::INVALID_LPE);
}
@@ -399,7 +399,7 @@ bool PenTool::_handleButtonPress(GdkEventButton const &bevent) {
sp_canvas_item_grab(this->grab, ( GDK_KEY_PRESS_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK ),
- NULL, bevent.time);
+ nullptr, bevent.time);
}
pen_drag_origin_w = event_w;
@@ -539,7 +539,7 @@ bool PenTool::_handleButtonPress(GdkEventButton const &bevent) {
ret = true;
} else if (bevent.button == 3 && this->npoints != 0) {
// right click - finish path
- this->ea = NULL; // unset end anchor if set (otherwise crashes)
+ this->ea = nullptr; // unset end anchor if set (otherwise crashes)
this->_finish(false);
ret = true;
}
@@ -814,7 +814,7 @@ bool PenTool::_handleButtonRelease(GdkEventButton const &revent) {
if (this->grab) {
// Release grab now
sp_canvas_item_ungrab(this->grab, revent.time);
- this->grab = NULL;
+ this->grab = nullptr;
}
ret = true;
@@ -833,7 +833,7 @@ bool PenTool::_handleButtonRelease(GdkEventButton const &revent) {
// we have an already created LPE waiting for a path
this->waiting_LPE->acceptParamPath(SP_PATH(selection->singleItem()));
selection->add(this->waiting_item);
- this->waiting_LPE = NULL;
+ this->waiting_LPE = nullptr;
} else {
// the case that we need to create a new LPE and apply it to the just-drawn path is
// handled in spdc_check_for_and_apply_waiting_LPE() in draw-context.cpp
@@ -1199,7 +1199,7 @@ bool PenTool::_handleKeyPress(GdkEvent *event) {
case GDK_KEY_Return:
case GDK_KEY_KP_Enter:
if (this->npoints != 0) {
- this->ea = NULL; // unset end anchor if set (otherwise crashes)
+ this->ea = nullptr; // unset end anchor if set (otherwise crashes)
if(MOD__SHIFT_ONLY(event)) {
// All this is needed to stop the last control
// point dispeating and stop making an n-1 shape.
@@ -1243,10 +1243,10 @@ bool PenTool::_handleKeyPress(GdkEvent *event) {
void PenTool::_resetColors() {
// Red
this->red_curve->reset();
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), NULL, true);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), nullptr, true);
// Blue
this->blue_curve->reset();
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->blue_bpath), NULL, true);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->blue_bpath), nullptr, true);
// Green
for (auto i:this->green_bpaths) {
sp_canvas_item_destroy(i);
@@ -1256,8 +1256,8 @@ void PenTool::_resetColors() {
if (this->green_anchor) {
this->green_anchor = sp_draw_anchor_destroy(this->green_anchor);
}
- this->sa = NULL;
- this->ea = NULL;
+ this->sa = nullptr;
+ this->ea = nullptr;
this->sa_overwrited->reset();
this->npoints = 0;
@@ -1271,7 +1271,7 @@ void PenTool::_setInitialPoint(Geom::Point const p) {
this->p[0] = p;
this->p[1] = p;
this->npoints = 2;
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), NULL, true);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), nullptr, true);
this->desktop->canvas->forceFullRedrawAfterInterruptions(5);
}
@@ -1282,9 +1282,9 @@ void PenTool::_setInitialPoint(Geom::Point const p) {
* two parameters ("angle %3.2f&#176;, distance %s").
*/
void PenTool::_setAngleDistanceStatusMessage(Geom::Point const p, int pc_point_to_compare, gchar const *message) {
- g_assert(this != NULL);
+ g_assert(this != nullptr);
g_assert((pc_point_to_compare == 0) || (pc_point_to_compare == 3)); // exclude control handles
- g_assert(message != NULL);
+ g_assert(message != nullptr);
Geom::Point rel = p - this->p[pc_point_to_compare];
Inkscape::Util::Quantity q = Inkscape::Util::Quantity(Geom::L2(rel), "px");
@@ -1384,7 +1384,7 @@ void PenTool::_bsplineSpiroStartAnchor(bool shift)
return;
}
- LivePathEffect::LPEBSpline *lpe_bsp = NULL;
+ LivePathEffect::LPEBSpline *lpe_bsp = nullptr;
if (SP_IS_LPE_ITEM(this->white_item) && SP_LPE_ITEM(this->white_item)->hasPathEffect()){
Inkscape::LivePathEffect::Effect* thisEffect = SP_LPE_ITEM(this->white_item)->getPathEffectOfType(Inkscape::LivePathEffect::BSPLINE);
@@ -1397,7 +1397,7 @@ void PenTool::_bsplineSpiroStartAnchor(bool shift)
}else{
this->bspline = false;
}
- LivePathEffect::LPESpiro *lpe_spi = NULL;
+ LivePathEffect::LPESpiro *lpe_spi = nullptr;
if (SP_IS_LPE_ITEM(this->white_item) && SP_LPE_ITEM(this->white_item)->hasPathEffect()){
Inkscape::LivePathEffect::Effect* thisEffect = SP_LPE_ITEM(this->white_item)->getPathEffectOfType(Inkscape::LivePathEffect::SPIRO);
@@ -1902,7 +1902,7 @@ void PenTool::_finishSegment(Geom::Point const p, guint const state) {
bool PenTool::_undoLastPoint() {
bool ret = false;
- if ( this->green_curve->is_unset() || (this->green_curve->last_segment() == NULL) ) {
+ if ( this->green_curve->is_unset() || (this->green_curve->last_segment() == nullptr) ) {
if (!this->red_curve->is_unset()) {
this->_cancel ();
ret = true;
@@ -1997,8 +1997,8 @@ void PenTool::_finish(gboolean const closed) {
// cancelate line without a created segment
this->red_curve->reset();
spdc_concat_colors_and_flush(this, closed);
- this->sa = NULL;
- this->ea = NULL;
+ this->sa = nullptr;
+ this->ea = nullptr;
this->npoints = 0;
this->state = PenTool::POINT;
diff --git a/src/ui/tools/pencil-tool.cpp b/src/ui/tools/pencil-tool.cpp
index 590ef3634..842a84f74 100644
--- a/src/ui/tools/pencil-tool.cpp
+++ b/src/ui/tools/pencil-tool.cpp
@@ -80,8 +80,8 @@ PencilTool::PencilTool()
, _req_tangent(0, 0)
, _is_drawing(false)
, sketch_n(0)
- , _powerpreview(NULL)
- , _curve(NULL)
+ , _powerpreview(nullptr)
+ , _curve(nullptr)
, _previous_pressure(0.0)
, _last_point(Geom::Point())
{
@@ -187,7 +187,7 @@ bool PencilTool::_handleButtonPress(GdkEventButton const &bevent) {
sp_canvas_item_grab(this->grab, ( GDK_KEY_PRESS_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK ),
- NULL, bevent.time);
+ nullptr, bevent.time);
}
Geom::Point const button_w(bevent.x, bevent.y);
@@ -289,7 +289,7 @@ bool PencilTool::_handleMotionNotify(GdkEventMotion const &mevent) {
sp_canvas_item_grab(this->grab, ( GDK_KEY_PRESS_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK ),
- NULL, mevent.time);
+ nullptr, mevent.time);
}
/* Find desktop coordinates */
@@ -367,10 +367,10 @@ bool PencilTool::_handleMotionNotify(GdkEventMotion const &mevent) {
} else if (!anchor && this->anchor_statusbar) {
this->message_context->clear();
this->anchor_statusbar = false;
- this->ea = NULL;
+ this->ea = nullptr;
} else if (!anchor) {
this->message_context->set(Inkscape::NORMAL_MESSAGE, _("Drawing a freehand path"));
- this->ea = NULL;
+ this->ea = nullptr;
}
} else {
@@ -481,8 +481,8 @@ bool PencilTool::_handleButtonRelease(GdkEventButton const &revent) {
this->_interpolate();
spdc_concat_colors_and_flush(this, FALSE);
this->points.clear();
- this->sa = NULL;
- this->ea = NULL;
+ this->sa = nullptr;
+ this->ea = nullptr;
this->ps.clear();
this->_wps.clear();
this->_key_nodes.clear();
@@ -505,7 +505,7 @@ bool PencilTool::_handleButtonRelease(GdkEventButton const &revent) {
if (this->grab) {
/* Release grab now */
sp_canvas_item_ungrab(this->grab, revent.time);
- this->grab = NULL;
+ this->grab = nullptr;
}
ret = true;
@@ -517,7 +517,7 @@ void PencilTool::_cancel() {
if (this->grab) {
/* Release grab now */
sp_canvas_item_ungrab(this->grab, 0);
- this->grab = NULL;
+ this->grab = nullptr;
}
this->_is_drawing = false;
@@ -525,7 +525,7 @@ void PencilTool::_cancel() {
sp_event_context_discard_delayed_snap_event(this);
this->red_curve->reset();
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), NULL);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), nullptr);
for (auto i:this->green_bpaths) {
sp_canvas_item_destroy(i);
}
@@ -605,8 +605,8 @@ bool PencilTool::_handleKeyRelease(GdkEventKey const &event) {
if (this->_state == SP_PENCIL_CONTEXT_SKETCH) {
spdc_concat_colors_and_flush(this, FALSE);
this->sketch_n = 0;
- this->sa = NULL;
- this->ea = NULL;
+ this->sa = nullptr;
+ this->ea = nullptr;
if (this->green_anchor) {
this->green_anchor = sp_draw_anchor_destroy(this->green_anchor);
}
@@ -682,12 +682,12 @@ void PencilTool::_finishEndpoint() {
this->red_curve->first_point() == this->red_curve->second_point())
{
this->red_curve->reset();
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), NULL);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), nullptr);
} else {
/* Write curves to object. */
spdc_concat_colors_and_flush(this, FALSE);
- this->sa = NULL;
- this->ea = NULL;
+ this->sa = nullptr;
+ this->ea = nullptr;
}
}
@@ -703,7 +703,7 @@ PencilTool::_powerStrokePreview(Geom::Path const path)
Geom::PathVector const pathv(path);
SPLPEItem * lpeitem = dynamic_cast<SPLPEItem *>(_powerpreview);
if (!lpeitem) {
- Inkscape::XML::Node *body = NULL;
+ Inkscape::XML::Node *body = nullptr;
body = xml_doc->createElement("svg:path");
body->setAttribute("sodipodi:insensitive", "true");
sp_desktop_apply_style_tool(desktop, body, Glib::ustring("/tools/freehand/pencil").data(), false);
@@ -760,10 +760,10 @@ PencilTool::removePowerStrokePreview()
LivePathEffectObject * lpeobj = lpe->getLPEObj();
if (lpeobj) {
SP_OBJECT(lpeobj)->deleteObject();
- lpeobj = NULL;
+ lpeobj = nullptr;
}
_powerpreview->deleteObject();
- _powerpreview = NULL;
+ _powerpreview = nullptr;
}
}
void
@@ -793,7 +793,7 @@ PencilTool::addPowerStrokePencil()
}
}
if (!this->_curve || this->_curve->is_unset()) {
- this->_curve = NULL;
+ this->_curve = nullptr;
}
double dezoomify_factor = 0.05 * 1000/SP_EVENT_CONTEXT(this)->desktop->current_zoom();//\/100 we want 100% = 1;
double last_pressure = this->_wps.back();
@@ -836,7 +836,7 @@ void PencilTool::_addFreehandPoint(Geom::Point const &p, guint /*state*/) {
this->_wps.push_back(this->pressure);
this->addPowerStrokePencil();
}
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), NULL);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), nullptr);
for (auto i:this->green_bpaths) {
sp_canvas_item_destroy(i);
}
@@ -870,7 +870,7 @@ PencilTool::_powerstrokeInterpolate(bool apply) {
Geom::Affine transform_coordinate = SP_ITEM(SP_ACTIVE_DESKTOP->currentLayer())->i2dt_affine();
this->_key_nodes.clear();
std::vector<Geom::Point> sa_points;
- SPItem *item = selection ? selection->singleItem() : NULL;
+ SPItem *item = selection ? selection->singleItem() : nullptr;
if(sa && apply && item) {
using namespace Inkscape::LivePathEffect;
SPCurve * c = sa_overwrited->copy();
@@ -929,7 +929,7 @@ PencilTool::_powerstrokeInterpolate(bool apply) {
sa_points.insert(sa_points.end(),this->points.begin(),this->points.end());
this->points = sa_points;
sa_points.clear();
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), NULL);
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), nullptr);
if (!path.empty()){
this->_curve->set_pathvector(path);
if( apply &&
@@ -1117,7 +1117,7 @@ void PencilTool::_fitAndSplit() {
|| is_unit_vector(this->_req_tangent));
Geom::Point const tHatEnd(0, 0);
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- int const n_segs = Geom::bezier_fit_cubic_full(b, NULL, this->p, this->_npoints,
+ int const n_segs = Geom::bezier_fit_cubic_full(b, nullptr, this->p, this->_npoints,
this->_req_tangent, tHatEnd,
tolerance_sq, 1);
if ( n_segs > 0
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();
diff --git a/src/ui/tools/select-tool.cpp b/src/ui/tools/select-tool.cpp
index b412812b6..90451e662 100644
--- a/src/ui/tools/select-tool.cpp
+++ b/src/ui/tools/select-tool.cpp
@@ -64,8 +64,8 @@ namespace Inkscape {
namespace UI {
namespace Tools {
-static GdkCursor *CursorSelectMouseover = NULL;
-static GdkCursor *CursorSelectDragging = NULL;
+static GdkCursor *CursorSelectMouseover = nullptr;
+static GdkCursor *CursorSelectDragging = nullptr;
static gint rb_escaped = 0; // if non-zero, rubberband was canceled by esc, so the next button release should not deselect
static gint drag_escaped = 0; // if non-zero, drag was canceled by esc
@@ -89,17 +89,17 @@ sp_load_handles(int start, int count, char const **xpm) {
SelectTool::SelectTool()
// Don't load a default cursor
- : ToolBase(NULL)
+ : ToolBase(nullptr)
, dragging(false)
, moved(false)
, button_press_shift(false)
, button_press_ctrl(false)
, button_press_alt(false)
, cycling_wrap(true)
- , item(NULL)
- , grabbed(NULL)
- , _seltrans(NULL)
- , _describer(NULL)
+ , item(nullptr)
+ , grabbed(nullptr)
+ , _seltrans(nullptr)
+ , _describer(nullptr)
{
// cursors in select context
CursorSelectMouseover = sp_cursor_from_xpm(cursor_select_m_xpm);
@@ -124,23 +124,23 @@ SelectTool::~SelectTool() {
if (this->grabbed) {
sp_canvas_item_ungrab(this->grabbed, GDK_CURRENT_TIME);
- this->grabbed = NULL;
+ this->grabbed = nullptr;
}
delete this->_seltrans;
- this->_seltrans = NULL;
+ this->_seltrans = nullptr;
delete this->_describer;
- this->_describer = NULL;
+ this->_describer = nullptr;
if (CursorSelectDragging) {
g_object_unref(CursorSelectDragging);
- CursorSelectDragging = NULL;
+ CursorSelectDragging = nullptr;
}
if (CursorSelectMouseover) {
g_object_unref(CursorSelectMouseover);
- CursorSelectMouseover = NULL;
+ CursorSelectMouseover = nullptr;
}
}
@@ -195,14 +195,14 @@ bool SelectTool::sp_select_context_abort() {
DocumentUndo::undo(desktop->getDocument());
}
- sp_object_unref( this->item, NULL);
+ sp_object_unref( this->item, nullptr);
} else if (this->button_press_ctrl) {
// NOTE: This is a workaround to a bug.
// When the ctrl key is held, sc->item is not defined
// so in this case (only), we skip the object doc check
DocumentUndo::undo(desktop->getDocument());
}
- this->item = NULL;
+ this->item = nullptr;
SP_EVENT_CONTEXT(this)->desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Move canceled."));
return true;
@@ -269,7 +269,7 @@ bool SelectTool::item_handler(SPItem* item, GdkEvent* event) {
tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100);
// make sure we still have valid objects to move around
- if (this->item && this->item->document == NULL) {
+ if (this->item && this->item->document == nullptr) {
this->sp_select_context_abort();
}
@@ -303,25 +303,25 @@ bool SelectTool::item_handler(SPItem* item, GdkEvent* event) {
// remember the clicked item in this->item:
if (this->item) {
- sp_object_unref(this->item, NULL);
- this->item = NULL;
+ sp_object_unref(this->item, nullptr);
+ this->item = nullptr;
}
this->item = sp_event_context_find_item (desktop,
Geom::Point(event->button.x, event->button.y), event->button.state & GDK_MOD1_MASK, FALSE);
- sp_object_ref(this->item, NULL);
+ sp_object_ref(this->item, nullptr);
rb_escaped = drag_escaped = 0;
if (this->grabbed) {
sp_canvas_item_ungrab(this->grabbed, event->button.time);
- this->grabbed = NULL;
+ this->grabbed = nullptr;
}
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->drawing),
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK |
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK,
- NULL, event->button.time);
+ nullptr, event->button.time);
this->grabbed = SP_CANVAS_ITEM(desktop->drawing);
@@ -433,7 +433,7 @@ void SelectTool::sp_select_context_cycle_through_items(Inkscape::Selection *sele
this->cycling_cur_item = *next;
g_assert(next != cycling_items.end());
- g_assert(cycling_cur_item != NULL);
+ g_assert(cycling_cur_item != nullptr);
arenaitem = cycling_cur_item->get_arenaitem(desktop->dkey);
arenaitem->setOpacity(1.0);
@@ -457,19 +457,19 @@ void SelectTool::sp_select_context_reset_opacities() {
}
this->cycling_items_cmp.clear();
- this->cycling_cur_item = NULL;
+ this->cycling_cur_item = nullptr;
}
bool SelectTool::root_handler(GdkEvent* event) {
- SPItem *item = NULL;
- SPItem *item_at_point = NULL, *group_at_point = NULL, *item_in_group = NULL;
+ SPItem *item = nullptr;
+ SPItem *item_at_point = nullptr, *group_at_point = nullptr, *item_in_group = nullptr;
gint ret = FALSE;
Inkscape::Selection *selection = desktop->getSelection();
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
// make sure we still have valid objects to move around
- if (this->item && this->item->document == NULL) {
+ if (this->item && this->item->document == nullptr) {
this->sp_select_context_abort();
}
@@ -517,12 +517,12 @@ bool SelectTool::root_handler(GdkEvent* event) {
if (this->grabbed) {
sp_canvas_item_ungrab(this->grabbed, event->button.time);
- this->grabbed = NULL;
+ this->grabbed = nullptr;
}
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK,
- NULL, event->button.time);
+ nullptr, event->button.time);
this->grabbed = SP_CANVAS_ITEM(desktop->acetate);
@@ -605,7 +605,7 @@ bool SelectTool::root_handler(GdkEvent* event) {
if (group_at_point != item_in_group &&
!(group_at_point && item_at_point &&
group_at_point->isAncestorOf(item_at_point))) {
- group_at_point = NULL;
+ group_at_point = nullptr;
}
// if neither a group nor an item (possibly in a group) at point are selected, set selection to the item at point
@@ -703,10 +703,10 @@ bool SelectTool::root_handler(GdkEvent* event) {
desktop->canvas->endForcedFullRedraws();
if (this->item) {
- sp_object_unref( this->item, NULL);
+ sp_object_unref( this->item, nullptr);
}
- this->item = NULL;
+ this->item = nullptr;
} else {
Inkscape::Rubberband *r = Inkscape::Rubberband::get(desktop);
@@ -753,7 +753,7 @@ bool SelectTool::root_handler(GdkEvent* event) {
if (item) {
selection->toggle(item);
- item = NULL;
+ item = nullptr;
}
} else if ((this->button_press_ctrl || this->button_press_alt) && !rb_escaped && !drag_escaped) { // ctrl+click, alt+click
@@ -771,7 +771,7 @@ bool SelectTool::root_handler(GdkEvent* event) {
selection->set(item);
}
- item = NULL;
+ item = nullptr;
}
} else { // click without shift, simply deselect, unless with Alt or something was cancelled
if (!selection->isEmpty()) {
@@ -789,7 +789,7 @@ bool SelectTool::root_handler(GdkEvent* event) {
if (this->grabbed) {
sp_canvas_item_ungrab(this->grabbed, event->button.time);
- this->grabbed = NULL;
+ this->grabbed = nullptr;
}
desktop->updateNow();
@@ -816,11 +816,11 @@ bool SelectTool::root_handler(GdkEvent* event) {
/* Rebuild list of items underneath the mouse pointer */
Geom::Point p = desktop->d2w(desktop->point());
- SPItem *item = desktop->getItemAtPoint(p, true, NULL);
+ SPItem *item = desktop->getItemAtPoint(p, true, nullptr);
this->cycling_items.clear();
- SPItem *tmp = NULL;
- while(item != NULL) {
+ SPItem *tmp = nullptr;
+ while(item != nullptr) {
this->cycling_items.push_back(item);
item = desktop->getItemAtPoint(p, true, item);
if (selection->includes(item)) tmp = item;
diff --git a/src/ui/tools/spiral-tool.cpp b/src/ui/tools/spiral-tool.cpp
index 61ee1026b..4b7743678 100644
--- a/src/ui/tools/spiral-tool.cpp
+++ b/src/ui/tools/spiral-tool.cpp
@@ -56,7 +56,7 @@ const std::string SpiralTool::prefsPath = "/tools/shapes/spiral";
SpiralTool::SpiralTool()
: ToolBase(cursor_spiral_xpm)
- , spiral(NULL)
+ , spiral(nullptr)
, revo(3)
, exp(1)
, t0(0)
@@ -80,7 +80,7 @@ SpiralTool::~SpiralTool() {
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->spiral) {
@@ -168,7 +168,7 @@ bool SpiralTool::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;
}
break;
@@ -229,7 +229,7 @@ bool SpiralTool::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);
}
@@ -246,7 +246,7 @@ bool SpiralTool::root_handler(GdkEvent* event) {
case GDK_KEY_Meta_R:
sp_event_show_modifier_tip(this->defaultMessageContext(), event,
_("<b>Ctrl</b>: snap angle"),
- NULL,
+ nullptr,
_("<b>Alt</b>: lock spiral radius"));
break;
@@ -385,7 +385,7 @@ void SpiralTool::drag(Geom::Point const &p, guint state) {
void SpiralTool::finishItem() {
this->message_context->clear();
- if (this->spiral != NULL) {
+ if (this->spiral != nullptr) {
if (this->spiral->rad == 0) {
this->cancel(); // Don't allow the creating of zero sized spiral, for example when the start and and point snap to the snap grid point
return;
@@ -393,7 +393,7 @@ void SpiralTool::finishItem() {
spiral->set_shape();
spiral->updateRepr(SP_OBJECT_WRITE_EXT);
- spiral->doWriteTransform(spiral->transform, NULL, true);
+ spiral->doWriteTransform(spiral->transform, nullptr, true);
this->desktop->canvas->endForcedFullRedraws();
@@ -401,7 +401,7 @@ void SpiralTool::finishItem() {
DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_SPIRAL, _("Create spiral"));
- this->spiral = NULL;
+ this->spiral = nullptr;
}
}
@@ -409,15 +409,15 @@ void SpiralTool::cancel() {
this->desktop->getSelection()->clear();
sp_canvas_item_ungrab(SP_CANVAS_ITEM(this->desktop->acetate), 0);
- if (this->spiral != NULL) {
+ if (this->spiral != nullptr) {
this->spiral->deleteObject();
- this->spiral = NULL;
+ this->spiral = 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();
diff --git a/src/ui/tools/spray-tool.cpp b/src/ui/tools/spray-tool.cpp
index 603d5e80a..ebfc10d8a 100644
--- a/src/ui/tools/spray-tool.cpp
+++ b/src/ui/tools/spray-tool.cpp
@@ -154,7 +154,7 @@ SprayTool::SprayTool()
, is_drawing(false)
, is_dilating(false)
, has_dilated(false)
- , dilate_area(NULL)
+ , dilate_area(nullptr)
, no_overlap(false)
, picker(false)
, pick_center(true)
@@ -184,13 +184,13 @@ SprayTool::~SprayTool() {
if (this->dilate_area) {
sp_canvas_item_destroy(this->dilate_area);
- this->dilate_area = NULL;
+ this->dilate_area = nullptr;
}
}
void SprayTool::update_cursor(bool /*with_shift*/) {
guint num = 0;
- gchar *sel_message = NULL;
+ gchar *sel_message = nullptr;
if (!desktop->selection->isEmpty()) {
num = (guint) boost::distance(desktop->selection->items());
@@ -418,7 +418,7 @@ static void random_position(double &radius, double &angle, double &a, double &s,
}
static void sp_spray_transform_path(SPItem * item, Geom::Path &path, Geom::Affine affine, Geom::Point center){
- path *= i2anc_affine(static_cast<SPItem *>(item->parent), NULL).inverse();
+ path *= i2anc_affine(static_cast<SPItem *>(item->parent), nullptr).inverse();
path *= item->transform.inverse();
Geom::Affine dt2p;
if (item->parent) {
@@ -429,7 +429,7 @@ static void sp_spray_transform_path(SPItem * item, Geom::Path &path, Geom::Affin
}
Geom::Affine i2dt = item->i2dt_affine() * Geom::Translate(center).inverse() * affine * Geom::Translate(center);
path *= i2dt * dt2p;
- path *= i2anc_affine(static_cast<SPItem *>(item->parent), NULL);
+ path *= i2anc_affine(static_cast<SPItem *>(item->parent), nullptr);
}
/**
@@ -1144,13 +1144,13 @@ static bool sp_spray_dilate(SprayTool *tc, Geom::Point /*event_p*/, Geom::Point
for(std::vector<SPItem*>::const_iterator i=items.begin();i!=items.end(); ++i){
SPItem *item = *i;
- g_assert(item != NULL);
+ g_assert(item != nullptr);
sp_object_ref(item);
}
for(std::vector<SPItem*>::const_iterator i=items.begin();i!=items.end(); ++i){
SPItem *item = *i;
- g_assert(item != NULL);
+ g_assert(item != nullptr);
if (sp_spray_recursive(desktop
, set
, item
@@ -1194,7 +1194,7 @@ static bool sp_spray_dilate(SprayTool *tc, Geom::Point /*event_p*/, Geom::Point
for(std::vector<SPItem*>::const_iterator i=items.begin();i!=items.end(); ++i){
SPItem *item = *i;
- g_assert(item != NULL);
+ g_assert(item != nullptr);
sp_object_unref(item);
}
}
diff --git a/src/ui/tools/star-tool.cpp b/src/ui/tools/star-tool.cpp
index 3a5615c3b..5c0111012 100644
--- a/src/ui/tools/star-tool.cpp
+++ b/src/ui/tools/star-tool.cpp
@@ -61,7 +61,7 @@ const std::string StarTool::prefsPath = "/tools/shapes/star";
StarTool::StarTool()
: ToolBase(cursor_star_xpm)
- , star(NULL)
+ , star(nullptr)
, magnitude(5)
, proportion(0.5)
, isflatsided(false)
@@ -85,7 +85,7 @@ StarTool::~StarTool() {
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->star) {
@@ -100,7 +100,7 @@ StarTool::~StarTool() {
* @param selection Should not be NULL.
*/
void StarTool::selection_changed(Inkscape::Selection* selection) {
- g_assert (selection != NULL);
+ g_assert (selection != nullptr);
this->shape_editor->unset_item();
this->shape_editor->set_item(selection->singleItem());
@@ -183,7 +183,7 @@ bool StarTool::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;
}
break;
@@ -242,7 +242,7 @@ bool StarTool::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);
}
@@ -259,8 +259,8 @@ bool StarTool::root_handler(GdkEvent* event) {
case GDK_KEY_Meta_R:
sp_event_show_modifier_tip(this->defaultMessageContext(), event,
_("<b>Ctrl</b>: snap angle; keep rays radial"),
- NULL,
- NULL);
+ nullptr,
+ nullptr);
break;
case GDK_KEY_x:
@@ -403,7 +403,7 @@ void StarTool::drag(Geom::Point p, guint state)
void StarTool::finishItem() {
this->message_context->clear();
- if (this->star != NULL) {
+ if (this->star != nullptr) {
if (this->star->r[1] == 0) {
// Don't allow the creating of zero sized arc, for example
// when the start and and point snap to the snap grid point
@@ -416,14 +416,14 @@ void StarTool::finishItem() {
this->star->setCenter(this->center);
this->star->set_shape();
this->star->updateRepr(SP_OBJECT_WRITE_EXT);
- this->star->doWriteTransform(this->star->transform, NULL, true);
+ this->star->doWriteTransform(this->star->transform, nullptr, true);
desktop->canvas->endForcedFullRedraws();
desktop->getSelection()->set(this->star);
DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_STAR,
_("Create star"));
- this->star = NULL;
+ this->star = nullptr;
}
}
@@ -431,15 +431,15 @@ void StarTool::cancel() {
desktop->getSelection()->clear();
sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), 0);
- if (this->star != NULL) {
+ if (this->star != nullptr) {
this->star->deleteObject();
- this->star = NULL;
+ this->star = nullptr;
}
this->within_tolerance = false;
this->xp = 0;
this->yp = 0;
- this->item_to_select = NULL;
+ this->item_to_select = nullptr;
desktop->canvas->endForcedFullRedraws();
diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp
index 8db6c323c..f4f20ef30 100644
--- a/src/ui/tools/text-tool.cpp
+++ b/src/ui/tools/text-tool.cpp
@@ -81,14 +81,14 @@ const std::string TextTool::prefsPath = "/tools/text";
TextTool::TextTool()
: ToolBase(cursor_text_xpm)
- , imc(NULL)
- , text(NULL)
+ , imc(nullptr)
+ , text(nullptr)
, pdoc(0, 0)
, unimode(false)
, unipos(0)
- , cursor(NULL)
- , indicator(NULL)
- , frame(NULL)
+ , cursor(nullptr)
+ , indicator(nullptr)
+ , frame(nullptr)
, timeout(0)
, show(false)
, phase(false)
@@ -96,18 +96,18 @@ TextTool::TextTool()
, over_text(false)
, dragging(0)
, creating(false)
- , grabbed(NULL)
- , preedit_string(NULL)
+ , grabbed(nullptr)
+ , preedit_string(nullptr)
{
}
TextTool::~TextTool() {
delete this->shape_editor;
- this->shape_editor = NULL;
+ this->shape_editor = nullptr;
if (this->grabbed) {
sp_canvas_item_ungrab(this->grabbed, GDK_CURRENT_TIME);
- this->grabbed = NULL;
+ this->grabbed = nullptr;
}
Inkscape::Rubberband::get(this->desktop)->stop();
@@ -128,13 +128,13 @@ void TextTool::setup() {
this->cursor->setRgba32(0x000000ff);
sp_canvas_item_hide(this->cursor);
- this->indicator = sp_canvas_item_new(desktop->getControls(), SP_TYPE_CTRLRECT, NULL);
+ this->indicator = sp_canvas_item_new(desktop->getControls(), SP_TYPE_CTRLRECT, nullptr);
SP_CTRLRECT(this->indicator)->setRectangle(Geom::Rect(Geom::Point(0, 0), Geom::Point(100, 100)));
SP_CTRLRECT(this->indicator)->setColor(0x0000ff7f, false, 0);
SP_CTRLRECT(this->indicator)->setShadow(1, 0xffffff7f);
sp_canvas_item_hide(this->indicator);
- this->frame = sp_canvas_item_new(desktop->getControls(), SP_TYPE_CTRLRECT, NULL);
+ this->frame = sp_canvas_item_new(desktop->getControls(), SP_TYPE_CTRLRECT, nullptr);
SP_CTRLRECT(this->frame)->setRectangle(Geom::Rect(Geom::Point(0, 0), Geom::Point(100, 100)));
SP_CTRLRECT(this->frame)->setColor(0x0000ff7f, false, 0);
sp_canvas_item_hide(this->frame);
@@ -160,7 +160,7 @@ void TextTool::setup() {
g_signal_connect(G_OBJECT(this->imc), "commit", G_CALLBACK(sptc_commit), this);
if (gtk_widget_has_focus(canvas)) {
- sptc_focus_in(canvas, NULL, this);
+ sptc_focus_in(canvas, nullptr, this);
}
}
@@ -213,7 +213,7 @@ void TextTool::finish() {
if (this->imc) {
g_object_unref(G_OBJECT(this->imc));
- this->imc = NULL;
+ this->imc = nullptr;
}
if (this->timeout) {
@@ -223,17 +223,17 @@ void TextTool::finish() {
if (this->cursor) {
sp_canvas_item_destroy(this->cursor);
- this->cursor = NULL;
+ this->cursor = nullptr;
}
if (this->indicator) {
sp_canvas_item_destroy(this->indicator);
- this->indicator = NULL;
+ this->indicator = nullptr;
}
if (this->frame) {
sp_canvas_item_destroy(this->frame);
- this->frame = NULL;
+ this->frame = nullptr;
}
for (std::vector<SPCanvasItem*>::iterator it = this->text_selection_quads.begin() ;
@@ -406,12 +406,12 @@ static void sp_text_context_setup_text(TextTool *tc)
/* Create <tspan> */
Inkscape::XML::Node *rtspan = xml_doc->createElement("svg:tspan");
rtspan->setAttribute("sodipodi:role", "line"); // otherwise, why bother creating the tspan?
- rtext->addChild(rtspan, NULL);
+ rtext->addChild(rtspan, nullptr);
Inkscape::GC::release(rtspan);
/* Create TEXT */
Inkscape::XML::Node *rstring = xml_doc->createTextNode("");
- rtspan->addChild(rstring, NULL);
+ rtspan->addChild(rstring, nullptr);
Inkscape::GC::release(rstring);
SPItem *text_item = SP_ITEM(ec->desktop->currentLayer()->appendChildRepr(rtext));
/* fixme: Is selection::changed really immediate? */
@@ -421,7 +421,7 @@ static void sp_text_context_setup_text(TextTool *tc)
text_item->transform = SP_ITEM(ec->desktop->currentLayer())->i2doc_affine().inverse();
text_item->updateRepr();
- text_item->doWriteTransform(text_item->transform, NULL, true);
+ text_item->doWriteTransform(text_item->transform, nullptr, true);
DocumentUndo::done(ec->desktop->getDocument(), SP_VERB_CONTEXT_TEXT,
_("Create text"));
}
@@ -537,7 +537,7 @@ bool TextTool::root_handler(GdkEvent* event) {
Inkscape::Rubberband::get(desktop)->start(desktop, this->p0);
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
GDK_KEY_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK,
- NULL, event->button.time);
+ nullptr, event->button.time);
this->grabbed = SP_CANVAS_ITEM(desktop->acetate);
this->creating = 1;
@@ -605,7 +605,7 @@ bool TextTool::root_handler(GdkEvent* event) {
if (this->grabbed) {
sp_canvas_item_ungrab(this->grabbed, GDK_CURRENT_TIME);
- this->grabbed = NULL;
+ this->grabbed = nullptr;
}
Inkscape::Rubberband::get(desktop)->stop();
@@ -1098,7 +1098,7 @@ bool TextTool::root_handler(GdkEvent* event) {
this->creating = 0;
if (this->grabbed) {
sp_canvas_item_ungrab(this->grabbed, GDK_CURRENT_TIME);
- this->grabbed = NULL;
+ this->grabbed = nullptr;
}
Inkscape::Rubberband::get(desktop)->stop();
} else {
@@ -1220,7 +1220,7 @@ bool TextTool::root_handler(GdkEvent* event) {
this->creating = 0;
if (this->grabbed) {
sp_canvas_item_ungrab(this->grabbed, GDK_CURRENT_TIME);
- this->grabbed = NULL;
+ this->grabbed = nullptr;
}
Inkscape::Rubberband::get(desktop)->stop();
}
@@ -1332,7 +1332,7 @@ Glib::ustring sp_text_get_selected_text(ToolBase const *ec)
if (!SP_IS_TEXT_CONTEXT(ec))
return "";
TextTool const *tc = SP_TEXT_CONTEXT(ec);
- if (tc->text == NULL)
+ if (tc->text == nullptr)
return "";
return sp_te_get_string_multiline(tc->text, tc->text_sel_start, tc->text_sel_end);
@@ -1341,10 +1341,10 @@ Glib::ustring sp_text_get_selected_text(ToolBase const *ec)
SPCSSAttr *sp_text_get_style_at_cursor(ToolBase const *ec)
{
if (!SP_IS_TEXT_CONTEXT(ec))
- return NULL;
+ return nullptr;
TextTool const *tc = SP_TEXT_CONTEXT(ec);
- if (tc->text == NULL)
- return NULL;
+ if (tc->text == nullptr)
+ return nullptr;
SPObject const *obj = sp_te_object_at_position(tc->text, tc->text_sel_end);
@@ -1352,7 +1352,7 @@ SPCSSAttr *sp_text_get_style_at_cursor(ToolBase const *ec)
return take_style_from_item(const_cast<SPObject*>(obj));
}
- return NULL;
+ return nullptr;
}
static bool css_attrs_are_equal(SPCSSAttr const *first, SPCSSAttr const *second)
@@ -1360,13 +1360,13 @@ static bool css_attrs_are_equal(SPCSSAttr const *first, SPCSSAttr const *second)
Inkscape::Util::List<Inkscape::XML::AttributeRecord const> attrs = first->attributeList();
for ( ; attrs ; attrs++) {
gchar const *other_attr = second->attribute(g_quark_to_string(attrs->key));
- if (other_attr == NULL || strcmp(attrs->value, other_attr))
+ if (other_attr == nullptr || strcmp(attrs->value, other_attr))
return false;
}
attrs = second->attributeList();
for ( ; attrs ; attrs++) {
gchar const *other_attr = first->attribute(g_quark_to_string(attrs->key));
- if (other_attr == NULL || strcmp(attrs->value, other_attr))
+ if (other_attr == nullptr || strcmp(attrs->value, other_attr))
return false;
}
return true;
@@ -1417,7 +1417,7 @@ bool sp_text_delete_selection(ToolBase *ec)
if (!SP_IS_TEXT_CONTEXT(ec))
return false;
TextTool *tc = SP_TEXT_CONTEXT(ec);
- if (tc->text == NULL)
+ if (tc->text == nullptr)
return false;
if (tc->text_sel_start == tc->text_sel_end)
@@ -1445,7 +1445,7 @@ bool sp_text_delete_selection(ToolBase *ec)
*/
void TextTool::_selectionChanged(Inkscape::Selection *selection)
{
- g_assert(selection != NULL);
+ g_assert(selection != nullptr);
ToolBase *ec = SP_EVENT_CONTEXT(this);
@@ -1458,7 +1458,7 @@ void TextTool::_selectionChanged(Inkscape::Selection *selection)
if (this->text && (item != this->text)) {
sp_text_context_forget_text(this);
}
- this->text = NULL;
+ this->text = nullptr;
if (SP_IS_TEXT(item) || SP_IS_FLOWTEXT(item)) {
this->text = item;
@@ -1466,7 +1466,7 @@ void TextTool::_selectionChanged(Inkscape::Selection *selection)
if (layout)
this->text_sel_start = this->text_sel_end = layout->end();
} else {
- this->text = NULL;
+ this->text = nullptr;
}
// we update cursor without scrolling, because this position may not be final;
@@ -1483,7 +1483,7 @@ void TextTool::_selectionModified(Inkscape::Selection */*selection*/, guint /*fl
bool TextTool::_styleSet(SPCSSAttr const *css)
{
- if (this->text == NULL)
+ if (this->text == nullptr)
return false;
if (this->text_sel_start == this->text_sel_end)
return false; // will get picked up by the parent and applied to the whole text object
@@ -1498,11 +1498,11 @@ bool TextTool::_styleSet(SPCSSAttr const *css)
int TextTool::_styleQueried(SPStyle *style, int property)
{
- if (this->text == NULL) {
+ if (this->text == nullptr) {
return QUERY_STYLE_NOTHING;
}
const Inkscape::Text::Layout *layout = te_get_layout(this->text);
- if (layout == NULL) {
+ if (layout == nullptr) {
return QUERY_STYLE_NOTHING;
}
sp_text_context_validate_cursor_iterators(this);
@@ -1523,8 +1523,8 @@ int TextTool::_styleQueried(SPStyle *style, int property)
}
}
for (Inkscape::Text::Layout::iterator it = begin_it ; it < end_it ; it.nextStartOfSpan()) {
- SPObject *pos_obj = 0;
- void *rawptr = 0;
+ SPObject *pos_obj = nullptr;
+ void *rawptr = nullptr;
layout->getSourceOfCharacter(it, &rawptr);
if (!rawptr || !SP_IS_OBJECT(rawptr)) {
continue;
@@ -1543,7 +1543,7 @@ int TextTool::_styleQueried(SPStyle *style, int property)
static void sp_text_context_validate_cursor_iterators(TextTool *tc)
{
- if (tc->text == NULL)
+ if (tc->text == nullptr)
return;
Inkscape::Text::Layout const *layout = te_get_layout(tc->text);
if (layout) { // undo can change the text length without us knowing it
@@ -1602,7 +1602,7 @@ static void sp_text_context_update_cursor(TextTool *tc, bool scroll_to_see)
trunc = _(" [truncated]");
}
if (SP_IS_FLOWTEXT(tc->text)) {
- SPItem *frame = SP_FLOWTEXT(tc->text)->get_frame (NULL); // first frame only
+ SPItem *frame = SP_FLOWTEXT(tc->text)->get_frame (nullptr); // first frame only
if (frame) {
if (truncated) {
SP_CTRLRECT(tc->frame)->setColor(0xff0000ff, false, 0);
@@ -1646,11 +1646,11 @@ static void sp_text_context_update_text_selection(TextTool *tc)
tc->text_selection_quads.clear();
std::vector<Geom::Point> quads;
- if (tc->text != NULL)
+ if (tc->text != nullptr)
quads = sp_te_create_selection_quads(tc->text, tc->text_sel_start, tc->text_sel_end, (tc->text)->i2dt_affine());
for (unsigned i = 0 ; i < quads.size() ; i += 4) {
SPCanvasItem *quad_canvasitem;
- quad_canvasitem = sp_canvas_item_new(tc->desktop->getControls(), SP_TYPE_CTRLQUADR, NULL);
+ quad_canvasitem = sp_canvas_item_new(tc->desktop->getControls(), SP_TYPE_CTRLQUADR, nullptr);
// FIXME: make the color settable in prefs
// for now, use semitrasparent blue, as cairo cannot do inversion :(
sp_ctrlquadr_set_rgba32(SP_CTRLQUADR(quad_canvasitem), 0x00777777);
@@ -1683,7 +1683,7 @@ static void sp_text_context_forget_text(TextTool *tc)
(void)ti;
/* We have to set it to zero,
* or selection changed signal messes everything up */
- tc->text = NULL;
+ tc->text = nullptr;
/* FIXME: this automatic deletion when nothing is inputted crashes the XML edittor and also crashes when duplicating an empty flowtext.
So don't create an empty flowtext in the first place? Create it when first character is typed.
@@ -1748,7 +1748,7 @@ void sp_text_context_place_cursor_at (TextTool *tc, SPObject *text, Geom::Point
Inkscape::Text::Layout::iterator *sp_text_context_get_cursor_position(TextTool *tc, SPObject *text)
{
if (text != tc->text)
- return NULL;
+ return nullptr;
return &(tc->text_sel_end);
}
diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp
index ce319009b..e45d30994 100644
--- a/src/ui/tools/tool-base.cpp
+++ b/src/ui/tools/tool-base.cpp
@@ -99,21 +99,21 @@ SPDesktop const& ToolBase::getDesktop() const {
}
ToolBase::ToolBase(gchar const *const *cursor_shape, bool uses_snap)
- : pref_observer(NULL)
- , cursor(NULL)
+ : pref_observer(nullptr)
+ , cursor(nullptr)
, xp(0)
, yp(0)
, tolerance(0)
, within_tolerance(false)
- , item_to_select(NULL)
- , message_context(NULL)
- , _selcue(NULL)
- , _grdrag(NULL)
- , shape_editor(NULL)
+ , item_to_select(nullptr)
+ , message_context(nullptr)
+ , _selcue(nullptr)
+ , _grdrag(nullptr)
+ , shape_editor(nullptr)
, space_panning(false)
- , _delayed_snap_event(NULL)
+ , _delayed_snap_event(nullptr)
, _dse_callback_in_process(false)
- , desktop(NULL)
+ , desktop(nullptr)
, _uses_snap(uses_snap)
, cursor_shape(cursor_shape)
{
@@ -125,7 +125,7 @@ ToolBase::~ToolBase() {
}
if (this->desktop) {
- this->desktop = NULL;
+ this->desktop = nullptr;
}
if (this->pref_observer) {
@@ -388,7 +388,7 @@ bool ToolBase::root_handler(GdkEvent* event) {
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
GDK_KEY_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK
| GDK_POINTER_MOTION_MASK
- | GDK_POINTER_MOTION_HINT_MASK, NULL,
+ | GDK_POINTER_MOTION_HINT_MASK, nullptr,
event->button.time - 1);
ret = TRUE;
@@ -408,7 +408,7 @@ bool ToolBase::root_handler(GdkEvent* event) {
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK,
- NULL, event->button.time );
+ nullptr, event->button.time );
// sp_canvas_item_hide (desktop->drawing);
} else if (event->button.state & GDK_SHIFT_MASK) {
@@ -423,7 +423,7 @@ bool ToolBase::root_handler(GdkEvent* event) {
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK,
- NULL, event->button.time - 1);
+ nullptr, event->button.time - 1);
}
@@ -440,12 +440,12 @@ bool ToolBase::root_handler(GdkEvent* event) {
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK
- | GDK_POINTER_MOTION_HINT_MASK, NULL,
+ | GDK_POINTER_MOTION_HINT_MASK, nullptr,
event->button.time);
ret = TRUE;
} else {
- sp_event_root_menu_popup(desktop, NULL, event);
+ sp_event_root_menu_popup(desktop, nullptr, event);
}
break;
@@ -465,7 +465,7 @@ bool ToolBase::root_handler(GdkEvent* event) {
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
GDK_KEY_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK
| GDK_POINTER_MOTION_MASK
- | GDK_POINTER_MOTION_HINT_MASK, NULL,
+ | GDK_POINTER_MOTION_HINT_MASK, nullptr,
event->motion.time - 1);
}
@@ -625,7 +625,7 @@ bool ToolBase::root_handler(GdkEvent* event) {
case GDK_KEY_F4:
/* Close view */
if (MOD__CTRL_ONLY(event)) {
- sp_ui_close_view(NULL);
+ sp_ui_close_view(nullptr);
ret = TRUE;
}
break;
@@ -691,13 +691,13 @@ bool ToolBase::root_handler(GdkEvent* event) {
break;
case GDK_KEY_Menu:
- sp_event_root_menu_popup(desktop, NULL, event);
+ sp_event_root_menu_popup(desktop, nullptr, event);
ret = TRUE;
break;
case GDK_KEY_F10:
if (MOD__SHIFT_ONLY(event)) {
- sp_event_root_menu_popup(desktop, NULL, event);
+ sp_event_root_menu_popup(desktop, nullptr, event);
ret = TRUE;
}
break;
@@ -935,7 +935,7 @@ void ToolBase::enableSelectionCue(bool enable) {
}
} else {
delete _selcue;
- _selcue = NULL;
+ _selcue = nullptr;
}
}
@@ -950,7 +950,7 @@ void ToolBase::enableGrDrag(bool enable) {
} else {
if (_grdrag) {
delete _grdrag;
- _grdrag = NULL;
+ _grdrag = nullptr;
}
}
}
@@ -972,9 +972,9 @@ bool ToolBase::deleteSelectedDrag(bool just_one) {
* Calls virtual set() function of ToolBase.
*/
void sp_event_context_read(ToolBase *ec, gchar const *key) {
- g_return_if_fail(ec != NULL);
+ g_return_if_fail(ec != nullptr);
g_return_if_fail(SP_IS_EVENT_CONTEXT(ec));
- g_return_if_fail(key != NULL);
+ g_return_if_fail(key != nullptr);
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
Inkscape::Preferences::Entry val = prefs->getEntry(ec->pref_observer->observed_path + '/' + key);
@@ -993,7 +993,7 @@ gint sp_event_context_root_handler(ToolBase * event_context,
switch (event->type) {
case GDK_MOTION_NOTIFY:
- sp_event_context_snap_delay_handler(event_context, NULL, NULL,
+ sp_event_context_snap_delay_handler(event_context, nullptr, nullptr,
(GdkEventMotion *) event,
DelayedSnapEvent::EVENTCONTEXT_ROOT_HANDLER);
break;
@@ -1048,7 +1048,7 @@ gint sp_event_context_item_handler(ToolBase * event_context,
switch (event->type) {
case GDK_MOTION_NOTIFY:
- sp_event_context_snap_delay_handler(event_context, (gpointer) item, NULL, (GdkEventMotion *) event, DelayedSnapEvent::EVENTCONTEXT_ITEM_HANDLER);
+ sp_event_context_snap_delay_handler(event_context, (gpointer) item, nullptr, (GdkEventMotion *) event, DelayedSnapEvent::EVENTCONTEXT_ITEM_HANDLER);
break;
case GDK_BUTTON_RELEASE:
if (event_context && event_context->_delayed_snap_event) {
@@ -1205,7 +1205,7 @@ guint get_latin_keyval(GdkEventKey const *event, guint *consumed_modifiers /*= N
gdk_keymap_translate_keyboard_state(
Gdk::Display::get_default()->get_keymap(),
event->hardware_keycode, (GdkModifierType) event->state, group,
- &keyval, NULL, NULL, &modifiers);
+ &keyval, nullptr, nullptr, &modifiers);
if (consumed_modifiers) {
*consumed_modifiers = modifiers;
@@ -1222,18 +1222,18 @@ guint get_latin_keyval(GdkEventKey const *event, guint *consumed_modifiers /*= N
SPItem *sp_event_context_find_item(SPDesktop *desktop, Geom::Point const &p,
bool select_under, bool into_groups)
{
- SPItem *item = 0;
+ SPItem *item = nullptr;
if (select_under) {
auto tmp = desktop->selection->items();
std::vector<SPItem *> vec(tmp.begin(), tmp.end());
SPItem *selected_at_point = desktop->getItemFromListAtPointBottom(vec, p);
item = desktop->getItemAtPoint(p, into_groups, selected_at_point);
- if (item == NULL) { // we may have reached bottom, flip over to the top
- item = desktop->getItemAtPoint(p, into_groups, NULL);
+ if (item == nullptr) { // we may have reached bottom, flip over to the top
+ item = desktop->getItemAtPoint(p, into_groups, nullptr);
}
} else {
- item = desktop->getItemAtPoint(p, into_groups, NULL);
+ item = desktop->getItemAtPoint(p, into_groups, nullptr);
}
return item;
@@ -1327,14 +1327,14 @@ void sp_event_context_snap_delay_handler(ToolBase *ec,
// But if we're really standing still, then we should snap now. We could use some low-pass filtering,
// otherwise snapping occurs for each jitter movement. For this filtering we'll leave the watchdog to expire,
// snap, and set a new watchdog again.
- if (ec->_delayed_snap_event == NULL) { // no watchdog has been set
+ if (ec->_delayed_snap_event == nullptr) { // no watchdog has been set
// it might have already expired, so we'll set a new one; the snapping frequency will be limited this way
ec->_delayed_snap_event = new DelayedSnapEvent(ec, dse_item, dse_item2, event, origin);
} // else: watchdog has been set before and we'll wait for it to expire
}
} else {
// This is the first GDK_MOTION_NOTIFY event, so postpone snapping and set the watchdog
- g_assert(ec->_delayed_snap_event == NULL);
+ g_assert(ec->_delayed_snap_event == nullptr);
ec->_delayed_snap_event = new DelayedSnapEvent(ec, dse_item, dse_item2, event, origin);
}
@@ -1351,19 +1351,19 @@ gboolean sp_event_context_snap_watchdog_callback(gpointer data) {
// Snap NOW! For this the "postponed" flag will be reset and the last motion event will be repeated
DelayedSnapEvent *dse = reinterpret_cast<DelayedSnapEvent*> (data);
- if (dse == NULL) {
+ if (dse == nullptr) {
// This might occur when this method is called directly, i.e. not through the timer
// E.g. on GDK_BUTTON_RELEASE in sp_event_context_root_handler()
return FALSE;
}
ToolBase *ec = dse->getEventContext();
- if (ec == NULL) {
+ if (ec == nullptr) {
delete dse;
return false;
}
- if (ec->desktop == NULL) {
- ec->_delayed_snap_event = NULL;
+ if (ec->desktop == nullptr) {
+ ec->_delayed_snap_event = nullptr;
delete dse;
return false;
}
@@ -1399,7 +1399,7 @@ gboolean sp_event_context_snap_watchdog_callback(gpointer data) {
gpointer pitem2 = dse->getItem2();
if (!pitem2)
{
- ec->_delayed_snap_event = NULL;
+ ec->_delayed_snap_event = nullptr;
delete dse;
return false;
}
@@ -1448,7 +1448,7 @@ gboolean sp_event_context_snap_watchdog_callback(gpointer data) {
break;
}
- ec->_delayed_snap_event = NULL;
+ ec->_delayed_snap_event = nullptr;
delete dse;
ec->_dse_callback_in_process = false;
@@ -1458,7 +1458,7 @@ gboolean sp_event_context_snap_watchdog_callback(gpointer data) {
void sp_event_context_discard_delayed_snap_event(ToolBase *ec) {
delete ec->_delayed_snap_event;
- ec->_delayed_snap_event = NULL;
+ ec->_delayed_snap_event = nullptr;
ec->desktop->namedview->snap_manager.snapprefs.setSnapPostponedGlobally(false);
}
diff --git a/src/ui/tools/tool-base.h b/src/ui/tools/tool-base.h
index cb08e67b4..1696c6453 100644
--- a/src/ui/tools/tool-base.h
+++ b/src/ui/tools/tool-base.h
@@ -68,7 +68,7 @@ public:
DelayedSnapEvent(ToolBase *event_context, gpointer const dse_item, gpointer dse_item2, GdkEventMotion const *event, DelayedSnapEvent::DelayedSnapEventOrigin const origin)
: _timer_id(0)
- , _event(NULL)
+ , _event(nullptr)
, _item(dse_item)
, _item2(dse_item2)
, _origin(origin)
@@ -90,7 +90,7 @@ public:
~DelayedSnapEvent() {
if (_timer_id > 0) g_source_remove(_timer_id); // Kill the watchdog
- if (_event != NULL) gdk_event_free(_event); // Remove the copy of the original event
+ if (_event != nullptr) gdk_event_free(_event); // Remove the copy of the original event
}
ToolBase* getEventContext() {
@@ -253,7 +253,7 @@ void sp_event_show_modifier_tip(Inkscape::MessageContext *message_context, GdkEv
gchar const *ctrl_tip, gchar const *shift_tip, gchar const *alt_tip);
void init_latin_keys_group();
-guint get_latin_keyval(GdkEventKey const *event, guint *consumed_modifiers = NULL);
+guint get_latin_keyval(GdkEventKey const *event, guint *consumed_modifiers = nullptr);
SPItem *sp_event_context_find_item (SPDesktop *desktop, Geom::Point const &p, bool select_under, bool into_groups);
SPItem *sp_event_context_over_item (SPDesktop *desktop, SPItem *item, Geom::Point const &p);
diff --git a/src/ui/tools/tweak-tool.cpp b/src/ui/tools/tweak-tool.cpp
index 6698316c7..f6b10d67a 100644
--- a/src/ui/tools/tweak-tool.cpp
+++ b/src/ui/tools/tweak-tool.cpp
@@ -104,7 +104,7 @@ TweakTool::TweakTool()
, is_drawing(false)
, is_dilating(false)
, has_dilated(false)
- , dilate_area(NULL)
+ , dilate_area(nullptr)
, do_h(true)
, do_s(true)
, do_l(true)
@@ -119,7 +119,7 @@ TweakTool::~TweakTool() {
if (this->dilate_area) {
sp_canvas_item_destroy(this->dilate_area);
- this->dilate_area = NULL;
+ this->dilate_area = nullptr;
}
}
@@ -140,7 +140,7 @@ static bool is_color_mode (gint mode)
void TweakTool::update_cursor (bool with_shift) {
guint num = 0;
- gchar *sel_message = NULL;
+ gchar *sel_message = nullptr;
if (!desktop->selection->isEmpty()) {
num = (guint) boost::distance(desktop->selection->items());
@@ -369,7 +369,7 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P
sp_item_list_to_curves (items, selected, to_select);
SPObject* newObj = doc->getObjectByRepr(to_select[0]);
item = dynamic_cast<SPItem *>(newObj);
- g_assert(item != NULL);
+ g_assert(item != nullptr);
selection->add(item);
}
@@ -383,7 +383,7 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P
for (auto i = children.rbegin(); i!= children.rend(); ++i) {
SPItem *child = *i;
- g_assert(child != NULL);
+ g_assert(child != nullptr);
if (sp_tweak_dilate_recursive (selection, child, p, vector, mode, radius, force, fidelity, reverse)) {
did = true;
}
@@ -490,10 +490,10 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P
} else if (dynamic_cast<SPPath *>(item) || dynamic_cast<SPShape *>(item)) {
- Inkscape::XML::Node *newrepr = NULL;
+ Inkscape::XML::Node *newrepr = nullptr;
gint pos = 0;
- Inkscape::XML::Node *parent = NULL;
- char const *id = NULL;
+ Inkscape::XML::Node *parent = nullptr;
+ char const *id = nullptr;
if (!dynamic_cast<SPPath *>(item)) {
newrepr = sp_selected_item_to_curved_repr(item, 0);
if (!newrepr) {
@@ -518,7 +518,7 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P
}
Path *orig = Path_for_item(item, false);
- if (orig == NULL) {
+ if (orig == nullptr) {
return false;
}
@@ -533,7 +533,7 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P
orig->Fill(theShape, 0);
SPCSSAttr *css = sp_repr_css_attr(item->getRepr(), "style");
- gchar const *val = sp_repr_css_property(css, "fill-rule", NULL);
+ gchar const *val = sp_repr_css_property(css, "fill-rule", nullptr);
if (val && strcmp(val, "nonzero") == 0) {
theRes->ConvertToShape(theShape, fill_nonZero);
} else if (val && strcmp(val, "evenodd") == 0) {
@@ -624,7 +624,7 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P
if (newrepr) {
Inkscape::GC::release(newrepr);
- newrepr = NULL;
+ newrepr = nullptr;
}
}
@@ -818,7 +818,7 @@ static void tweak_colors_in_gradient(SPItem *item, Inkscape::PaintTarget fill_or
double offset_l = 0;
double offset_h = 0;
- SPObject *child_prev = NULL;
+ SPObject *child_prev = nullptr;
for (auto& child: vector->children) {
SPStop *stop = dynamic_cast<SPStop *>(&child);
if (!stop) {
@@ -829,7 +829,7 @@ static void tweak_colors_in_gradient(SPItem *item, Inkscape::PaintTarget fill_or
if (child_prev) {
SPStop *prevStop = dynamic_cast<SPStop *>(child_prev);
- g_assert(prevStop != NULL);
+ g_assert(prevStop != nullptr);
if (offset_h - offset_l > r && pos_e >= offset_l && pos_e <= offset_h) {
// the summit falls in this interstop, and the radius is small,
diff --git a/src/ui/tools/zoom-tool.cpp b/src/ui/tools/zoom-tool.cpp
index 6f7fca242..dcd6eac80 100644
--- a/src/ui/tools/zoom-tool.cpp
+++ b/src/ui/tools/zoom-tool.cpp
@@ -37,7 +37,7 @@ const std::string ZoomTool::prefsPath = "/tools/zoom";
ZoomTool::ZoomTool()
: ToolBase(cursor_zoom_xpm)
- , grabbed(NULL)
+ , grabbed(nullptr)
, escaped(false)
{
}
@@ -50,7 +50,7 @@ void ZoomTool::finish() {
if (this->grabbed) {
sp_canvas_item_ungrab(this->grabbed, GDK_CURRENT_TIME);
- this->grabbed = NULL;
+ this->grabbed = nullptr;
}
ToolBase::finish();
@@ -108,7 +108,7 @@ bool ZoomTool::root_handler(GdkEvent* event) {
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK,
- NULL, event->button.time);
+ nullptr, event->button.time);
this->grabbed = SP_CANVAS_ITEM(desktop->acetate);
break;
@@ -160,7 +160,7 @@ bool ZoomTool::root_handler(GdkEvent* event) {
if (this->grabbed) {
sp_canvas_item_ungrab(this->grabbed, event->button.time);
- this->grabbed = NULL;
+ this->grabbed = nullptr;
}
xp = yp = 0;