forked from AuroraMiddleware/gtk
label: refactor code
If text didn't change, don't change it. And if that sentence made no sense, that might explain why I refactored.
This commit is contained in:
parent
24fa277329
commit
e09957a47d
@ -1980,15 +1980,14 @@ gtk_label_set_text_internal (GtkLabel *label,
|
||||
gchar *str)
|
||||
{
|
||||
GtkLabelPrivate *priv = label->priv;
|
||||
gboolean text_changed;
|
||||
|
||||
text_changed = g_strcmp0 (priv->text, str) != 0;
|
||||
if (g_strcmp0 (priv->text, str) == 0)
|
||||
return;
|
||||
|
||||
g_free (priv->text);
|
||||
priv->text = str;
|
||||
|
||||
if (text_changed)
|
||||
gtk_label_select_region_index (label, 0, 0);
|
||||
gtk_label_select_region_index (label, 0, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user