From f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Fri, 15 Jun 2018 12:46:15 +0200 Subject: =?UTF-8?q?Run=20clang-tidy=E2=80=99s=20modernize-use-nullptr=20pa?= =?UTF-8?q?ss.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This replaces all NULL or 0 with nullptr when assigned to or returned as a pointer. --- src/display/canvas-text.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/display/canvas-text.cpp') 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) { -- cgit v1.2.3