From 57af1cdb8caad86719b6f56d5026c12c7de52464 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Tue, 27 Oct 2009 00:30:54 +0100 Subject: [PATCH] Only set the accesible label if it is non-empty Fixes https://bugzilla.gnome.org/show_bug.cgi?id=599446 --- gtk/gtktoolbutton.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c index 6db835861d..5975a51689 100644 --- a/gtk/gtktoolbutton.c +++ b/gtk/gtktoolbutton.c @@ -916,11 +916,14 @@ gtk_tool_button_set_label (GtkToolButton *button, button->priv->label_text = g_strdup (label); button->priv->contents_invalid = TRUE; - elided_label = _gtk_toolbar_elide_underscores (label); - accessible = gtk_widget_get_accessible (GTK_WIDGET (button->priv->button)); - atk_object_set_name (accessible, elided_label); + if (label) + { + elided_label = _gtk_toolbar_elide_underscores (label); + accessible = gtk_widget_get_accessible (GTK_WIDGET (button->priv->button)); + atk_object_set_name (accessible, elided_label); + g_free (elided_label); + } - g_free (elided_label); g_free (old_label); g_object_notify (G_OBJECT (button), "label");