[gtk+/gtk-style-context: 92/533] GtkCssProvider: Parse boolean values.



commit 65988c6f5ffb672e9e626d8ff7487f7b14d7f73b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jun 18 16:46:31 2010 +0200

    GtkCssProvider: Parse boolean values.

 gtk/gtkcssprovider.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index acc73c0..fef896c 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -596,7 +596,7 @@ css_provider_apply_scope (GtkCssProvider *css_provider,
     {
       priv->scanner->config->cset_identifier_first = G_CSET_a_2_z "#-_0123456789" G_CSET_A_2_Z;
       priv->scanner->config->cset_identifier_nth = G_CSET_a_2_z "#-_ 0123456789" G_CSET_A_2_Z;
-      priv->scanner->config->scan_identifier_1char = FALSE;
+      priv->scanner->config->scan_identifier_1char = TRUE;
     }
   else if (scope == SCOPE_SELECTOR)
     {
@@ -894,6 +894,14 @@ parse_value (GType        type,
       font_desc = pango_font_description_from_string (value_str);
       g_value_take_boxed (value, font_desc);
     }
+  else if (type == G_TYPE_BOOLEAN)
+    {
+      if (value_str[0] == '1' ||
+          g_ascii_strcasecmp (value_str, "true") == 0)
+        g_value_set_boolean (value, TRUE);
+      else
+        g_value_set_boolean (value, FALSE);
+    }
   else if (type == G_TYPE_INT)
     g_value_set_int (value, atoi (value_str));
   else if (type == G_TYPE_DOUBLE)



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