summaryrefslogtreecommitdiffstats
path: root/src/display/canvas-text.cpp
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-15 10:46:15 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2018-06-18 12:27:01 +0000
commitf4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43 (patch)
tree7c6044fd3a17a2665841959dac9b3b2110b27924 /src/display/canvas-text.cpp
parentRun clang-tidy’s modernize-use-override pass. (diff)
downloadinkscape-f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43.tar.gz
inkscape-f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43.zip
Run clang-tidy’s modernize-use-nullptr pass.
This replaces all NULL or 0 with nullptr when assigned to or returned as a pointer.
Diffstat (limited to 'src/display/canvas-text.cpp')
-rw-r--r--src/display/canvas-text.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/display/canvas-text.cpp b/src/display/canvas-text.cpp
index 4117825e3..9df002f7f 100644
--- a/src/display/canvas-text.cpp
+++ b/src/display/canvas-text.cpp
@@ -52,9 +52,9 @@ sp_canvastext_init (SPCanvasText *canvastext)
canvastext->s[Geom::X] = canvastext->s[Geom::Y] = 0.0;
canvastext->affine = Geom::identity();
canvastext->fontsize = 10.0;
- canvastext->item = NULL;
- canvastext->desktop = NULL;
- canvastext->text = NULL;
+ canvastext->item = nullptr;
+ canvastext->desktop = nullptr;
+ canvastext->text = nullptr;
canvastext->outline = false;
canvastext->background = false;
canvastext->border = 3; // must be a constant, and not proportional to any width, height, or fontsize to allow alignment with other text boxes
@@ -62,14 +62,14 @@ sp_canvastext_init (SPCanvasText *canvastext)
static void sp_canvastext_destroy(SPCanvasItem *object)
{
- g_return_if_fail (object != NULL);
+ g_return_if_fail (object != nullptr);
g_return_if_fail (SP_IS_CANVASTEXT (object));
SPCanvasText *canvastext = SP_CANVASTEXT (object);
g_free(canvastext->text);
- canvastext->text = NULL;
- canvastext->item = NULL;
+ canvastext->text = nullptr;
+ canvastext->item = nullptr;
if (SP_CANVAS_ITEM_CLASS(sp_canvastext_parent_class)->destroy)
SP_CANVAS_ITEM_CLASS(sp_canvastext_parent_class)->destroy(object);
@@ -227,7 +227,7 @@ SPCanvasText *sp_canvastext_new(SPCanvasGroup *parent, SPDesktop *desktop, Geom:
{
// Pos specifies the position of the anchor, which is at the bounding box of the text itself (i.e. not at the border of the filled background rectangle)
// The relative position of the anchor can be set using e.g. anchor_position = TEXT_ANCHOR_LEFT
- SPCanvasItem *item = sp_canvas_item_new(parent, SP_TYPE_CANVASTEXT, NULL);
+ SPCanvasItem *item = sp_canvas_item_new(parent, SP_TYPE_CANVASTEXT, nullptr);
SPCanvasText *ct = SP_CANVASTEXT(item);
@@ -244,7 +244,7 @@ SPCanvasText *sp_canvastext_new(SPCanvasGroup *parent, SPDesktop *desktop, Geom:
void
sp_canvastext_set_rgba32 (SPCanvasText *ct, guint32 rgba, guint32 rgba_stroke)
{
- g_return_if_fail (ct != NULL);
+ g_return_if_fail (ct != nullptr);
g_return_if_fail (SP_IS_CANVASTEXT (ct));
if (rgba != ct->rgba || rgba_stroke != ct->rgba_stroke) {