[gtk/wip/baedert/for-master: 80/96] label: Don't normalize booleans in internal setters



commit 27c77cdff7fd3f7c7947266af3d8b12435dc0547
Author: Timm Bäder <mail baedert org>
Date:   Sun Apr 12 10:04:30 2020 +0200

    label: Don't normalize booleans in internal setters
    
    We almost always pass a literal TRUE/FALSE to them.

 gtk/gtklabel.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 705c6ae7d8..9b27b02476 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -1802,7 +1802,6 @@ gtk_label_set_use_markup_internal (GtkLabel *label,
 {
   GtkLabelPrivate *priv = gtk_label_get_instance_private (label);
 
-  val = val != FALSE;
   if (priv->use_markup != val)
     {
       priv->use_markup = val;
@@ -1821,7 +1820,6 @@ gtk_label_set_use_underline_internal (GtkLabel *label,
 {
   GtkLabelPrivate *priv = gtk_label_get_instance_private (label);
 
-  val = val != FALSE;
   if (priv->use_underline != val)
     {
       priv->use_underline = val;
@@ -5106,7 +5104,7 @@ gtk_label_set_use_markup (GtkLabel *label,
 
   g_object_freeze_notify (G_OBJECT (label));
 
-  if (gtk_label_set_use_markup_internal (label, setting))
+  if (gtk_label_set_use_markup_internal (label, !!setting))
     gtk_label_recalculate (label);
 
   g_object_thaw_notify (G_OBJECT (label));
@@ -5148,7 +5146,7 @@ gtk_label_set_use_underline (GtkLabel *label,
 
   g_object_freeze_notify (G_OBJECT (label));
 
-  if (gtk_label_set_use_underline_internal (label, setting))
+  if (gtk_label_set_use_underline_internal (label, !!setting))
     gtk_label_recalculate (label);
 
   g_object_thaw_notify (G_OBJECT (label));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]