summaryrefslogtreecommitdiffstats
path: root/src/widgets/button.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/widgets/button.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 '')
-rw-r--r--src/widgets/button.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/widgets/button.cpp b/src/widgets/button.cpp
index 7dcfc9771..7ebc20b6f 100644
--- a/src/widgets/button.cpp
+++ b/src/widgets/button.cpp
@@ -47,8 +47,8 @@ static void sp_button_class_init(SPButtonClass *klass)
static void sp_button_init(SPButton *button)
{
- button->action = NULL;
- button->doubleclick_action = NULL;
+ button->action = nullptr;
+ button->doubleclick_action = nullptr;
new (&button->c_set_active) sigc::connection();
new (&button->c_set_sensitive) sigc::connection();
@@ -66,10 +66,10 @@ static void sp_button_dispose(GObject *object)
SPButton *button = SP_BUTTON(object);
if (button->action) {
- sp_button_set_action(button, NULL);
+ sp_button_set_action(button, nullptr);
}
if (button->doubleclick_action) {
- sp_button_set_doubleclick_action(button, NULL);
+ sp_button_set_doubleclick_action(button, nullptr);
}
button->c_set_active.~connection();
@@ -136,7 +136,7 @@ static gint sp_button_process_event(SPButton *button, GdkEvent *event)
switch (event->type) {
case GDK_2BUTTON_PRESS:
if (button->doubleclick_action) {
- sp_action_perform(button->doubleclick_action, NULL);
+ sp_action_perform(button->doubleclick_action, nullptr);
}
return TRUE;
break;
@@ -150,13 +150,13 @@ static gint sp_button_process_event(SPButton *button, GdkEvent *event)
static void sp_button_perform_action(SPButton *button, gpointer /*data*/)
{
if (button->action) {
- sp_action_perform(button->action, NULL);
+ sp_action_perform(button->action, nullptr);
}
}
GtkWidget *sp_button_new(GtkIconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action)
{
- SPButton *button = SP_BUTTON(g_object_new(SP_TYPE_BUTTON, NULL));
+ SPButton *button = SP_BUTTON(g_object_new(SP_TYPE_BUTTON, nullptr));
button->type = type;
button->lsize = CLAMP(size, GTK_ICON_SIZE_MENU, GTK_ICON_SIZE_DIALOG);
@@ -251,15 +251,15 @@ static void sp_button_set_composed_tooltip(GtkWidget *widget, SPAction *action)
}
} else {
// no action
- gtk_widget_set_tooltip_text(widget, NULL);
+ gtk_widget_set_tooltip_text(widget, nullptr);
}
}
GtkWidget *sp_button_new_from_data(GtkIconSize size, SPButtonType type, Inkscape::UI::View::View *view,
const gchar *name, const gchar *tip)
{
- SPAction *action = sp_action_new(Inkscape::ActionContext(view), name, name, tip, name, 0);
- GtkWidget *button = sp_button_new(size, type, action, NULL);
+ SPAction *action = sp_action_new(Inkscape::ActionContext(view), name, name, tip, name, nullptr);
+ GtkWidget *button = sp_button_new(size, type, action, nullptr);
g_object_unref(action);
return button;
}