[gtk+] fontchooser: fix feature formatting



commit 8a5b6d422f900033d80f7eafa3945d502a52658f
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jan 3 21:21:58 2018 -0500

    fontchooser: fix feature formatting
    
    There was a " missing, causing some features to be missed.

 gtk/gtkfontchooserwidget.c |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c
index d021da4..ee5f50f 100644
--- a/gtk/gtkfontchooserwidget.c
+++ b/gtk/gtkfontchooserwidget.c
@@ -2115,11 +2115,7 @@ update_font_features (GtkFontChooserWidget *fontchooser)
           if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (item->feat)) &&
               strcmp (item->name, "xxxx") != 0)
             {
-              if (s->len > 0)
-                g_string_append (s, ", ");
-              g_string_append (s, "\"");
-              g_string_append (s, item->name);
-              g_string_append (s, "\" 1");
+              g_string_append_printf (s, "%s\"%s\" %d", s->len > 0 ? ", " : "", item->name, 1);
             }
         }
       else if (GTK_IS_CHECK_BUTTON (item->feat))
@@ -2127,14 +2123,9 @@ update_font_features (GtkFontChooserWidget *fontchooser)
           if (gtk_check_button_get_inconsistent (GTK_CHECK_BUTTON (item->feat)))
             continue;
 
-          if (s->len > 0)
-            g_string_append (s, ", ");
-          g_string_append (s, ", \"");
-          g_string_append (s, item->name);
-          if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (item->feat)))
-            g_string_append (s, "\" 1");
-          else
-            g_string_append (s, " 0");
+          g_string_append_printf (s, "%s\"%s\" %d",
+                                  s->len > 0 ? ", " : "", item->name,
+                                  gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (item->feat)));
         }
     }
 


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