]> Pileus Git - ~andy/gtk/commitdiff
Correctly treat GdkColor properties
authorMatthias Clasen <mclasen@redhat.com>
Sun, 20 Feb 2011 14:46:42 +0000 (09:46 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 20 Feb 2011 14:49:04 +0000 (09:49 -0500)
Noticed by Daniel Garcia,
https://bugzilla.gnome.org/show_bug.cgi?id=642782

modules/other/gail/libgail-util/gailmisc.c

index 5f4268df037409f387cab9aceb220912fb0403ab..e1ad192df3304f44d1858c3bf42142cf6c29b9b4 100644 (file)
@@ -720,11 +720,12 @@ gail_misc_buffer_get_run_attributes (GtkTextBuffer *buffer,
       g_object_get (tag, "foreground-set", &val_set, NULL);
       if (val_set)
         {
-          GdkColor c;
+          GdkColor *c;
           gchar *value;
 
           g_object_get (tag, "foreground-gdk", &c, NULL);
-          value = g_strdup_printf ("%u,%u,%u", c.red, c.green, c.blue);
+          value = g_strdup_printf ("%u,%u,%u", c->red, c->green, c->blue);
+          gdk_color_free (c);
           attrib_set = gail_misc_add_attribute (attrib_set, ATK_TEXT_ATTR_FG_COLOR, value);
         }
       temp_tags = temp_tags->next;
@@ -739,11 +740,12 @@ gail_misc_buffer_get_run_attributes (GtkTextBuffer *buffer,
       g_object_get (tag, "background-set", &val_set, NULL);
       if (val_set)
         {
-          GdkColor c;
+          GdkColor *c;
           gchar *value;
 
           g_object_get (tag, "background-gdk", &c, NULL);
-          value = g_strdup_printf ("%u,%u,%u", c.red, c.green, c.blue);
+          value = g_strdup_printf ("%u,%u,%u", c->red, c->green, c->blue);
+          gdk_color_free (c);
           attrib_set = gail_misc_add_attribute (attrib_set, ATK_TEXT_ATTR_BG_COLOR, value);
         }
       temp_tags = temp_tags->next;