From b5061249e775f930f2fc21fad5b3c0bd29870a45 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 17 Jan 2010 23:33:19 -0500 Subject: [PATCH] Reset effective_attrs when necessary This fixes both bug 607217 and bug 607269. --- gtk/gtklabel.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index aebd8c61d2..854318ce5d 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -1911,24 +1911,22 @@ gtk_label_recalculate (GtkLabel *label) guint keyval = label->mnemonic_keyval; if (label->use_markup) - { - gtk_label_set_markup_internal (label, label->label, label->use_underline); - gtk_label_compose_effective_attrs (label); - } + gtk_label_set_markup_internal (label, label->label, label->use_underline); else { if (label->use_underline) - { - gtk_label_set_uline_text_internal (label, label->label); - gtk_label_compose_effective_attrs (label); - } + gtk_label_set_uline_text_internal (label, label->label); else - { - gtk_label_set_text_internal (label, g_strdup (label->label)); - gtk_label_compose_effective_attrs (label); - } + { + if (label->effective_attrs) + pango_attr_list_unref (label->effective_attrs); + label->effective_attrs = NULL; + gtk_label_set_text_internal (label, g_strdup (label->label)); + } } + gtk_label_compose_effective_attrs (label); + if (!label->use_underline) label->mnemonic_keyval = GDK_VoidSymbol; @@ -1995,7 +1993,7 @@ gtk_label_set_attributes (GtkLabel *label, gtk_label_recalculate (label); - gtk_label_clear_layout (label); + gtk_label_clear_layout (label); gtk_widget_queue_resize (GTK_WIDGET (label)); }