From 8a5b6d422f900033d80f7eafa3945d502a52658f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 3 Jan 2018 21:21:58 -0500 Subject: fontchooser: fix feature formatting There was a " missing, causing some features to be missed. --- gtk/gtkfontchooserwidget.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'gtk/gtkfontchooserwidget.c') diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c index d021da48aa..ee5f50f0a2 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))); } } -- cgit v1.2.1