From 18ce0b21a06995864fa5e7417f0cf96f883d70cf Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 5 Jan 2012 17:06:00 +0100 Subject: [PATCH] label: Move function into only caller --- gtk/gtklabel.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 5ca9b1dc5f..e6a629d024 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -423,8 +423,6 @@ static void gtk_label_set_use_markup_internal (GtkLabel *label, gboolean val); static void gtk_label_set_use_underline_internal (GtkLabel *label, gboolean val); -static void gtk_label_set_attributes_internal (GtkLabel *label, - PangoAttrList *attrs); static void gtk_label_set_uline_text_internal (GtkLabel *label, const gchar *str); static void gtk_label_set_pattern_internal (GtkLabel *label, @@ -2071,23 +2069,6 @@ gtk_label_compose_effective_attrs (GtkLabel *label) } } -static void -gtk_label_set_attributes_internal (GtkLabel *label, - PangoAttrList *attrs) -{ - GtkLabelPrivate *priv = label->priv; - - if (attrs) - pango_attr_list_ref (attrs); - - if (priv->attrs) - pango_attr_list_unref (priv->attrs); - priv->attrs = attrs; - - g_object_notify (G_OBJECT (label), "attributes"); -} - - /* Calculates text, attrs and mnemonic_keyval from * label, use_underline and use_markup */ @@ -2174,9 +2155,18 @@ void gtk_label_set_attributes (GtkLabel *label, PangoAttrList *attrs) { + GtkLabelPrivate *priv = label->priv; + g_return_if_fail (GTK_IS_LABEL (label)); - gtk_label_set_attributes_internal (label, attrs); + if (attrs) + pango_attr_list_ref (attrs); + + if (priv->attrs) + pango_attr_list_unref (priv->attrs); + priv->attrs = attrs; + + g_object_notify (G_OBJECT (label), "attributes"); gtk_label_recalculate (label);