From 2397d76137178839678b2e5d30d6886d48ea0f58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 13 Jan 2016 19:07:20 +0100 Subject: [PATCH] label: Remove some unneeded conditionals We are never passing NULL here. --- gtk/gtklabel.c | 39 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 7efb7499c1..9d13def205 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -4584,26 +4584,16 @@ window_to_layout_coords (GtkLabel *label, { GtkAllocation allocation; gint lx, ly; - GtkWidget *widget; - widget = GTK_WIDGET (label); - /* get layout location in widget->window coords */ get_layout_location (label, &lx, &ly); + gtk_widget_get_allocation (GTK_WIDGET (label), &allocation); - gtk_widget_get_allocation (widget, &allocation); + *x += allocation.x; /* go to widget->window */ + *x -= lx; /* go to layout */ - if (x) - { - *x += allocation.x; /* go to widget->window */ - *x -= lx; /* go to layout */ - } - - if (y) - { - *y += allocation.y; /* go to widget->window */ - *y -= ly; /* go to layout */ - } + *y += allocation.y; /* go to widget->window */ + *y -= ly; /* go to layout */ } static void @@ -4612,26 +4602,17 @@ layout_to_window_coords (GtkLabel *label, gint *y) { gint lx, ly; - GtkWidget *widget; GtkAllocation allocation; - widget = GTK_WIDGET (label); - /* get layout location in widget->window coords */ get_layout_location (label, &lx, &ly); - gtk_widget_get_allocation (widget, &allocation); + gtk_widget_get_allocation (GTK_WIDGET (label), &allocation); - if (x) - { - *x += lx; /* go to widget->window */ - *x -= allocation.x; /* go to selection window */ - } + *x += lx; /* go to widget->window */ + *x -= allocation.x; /* go to selection window */ - if (y) - { - *y += ly; /* go to widget->window */ - *y -= allocation.y; /* go to selection window */ - } + *y += ly; /* go to widget->window */ + *y -= allocation.y; /* go to selection window */ } static gboolean