]> Pileus Git - ~andy/gtk/commitdiff
Bug 542523 - GtkTextTag should handle setting properties to NULL
authorXavier Claessens <xclaesse@gmail.com>
Tue, 15 Jul 2008 15:23:43 +0000 (15:23 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Tue, 15 Jul 2008 15:23:43 +0000 (15:23 +0000)
2008-07-15  Xavier Claessens  <xclaesse@gmail.com>

Bug 542523 - GtkTextTag should handle setting properties to NULL

* gtk/gtktexttag.c (gtk_text_tag_set_property): Unset the color when
setting it to NULL instead of displaying a warning.

svn path=/trunk/; revision=20836

ChangeLog
gtk/gtktexttag.c

index e7e0f0a75d0b82d9034b5452fdb3f4ec379bf70a..9878ba8cca21de81702d0ae8ce206c9c2918cc23 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-07-15  Xavier Claessens  <xclaesse@gmail.com>
+
+       Bug 542523 – GtkTextTag should handle setting properties to NULL
+
+       * gtk/gtktexttag.c (gtk_text_tag_set_property): Unset the color when
+       setting it to NULL instead of displaying a warning.
+
 2008-07-15  Matthias Clasen  <mclasen@redhat.com>
 
        Bug 479780 – Bookmarks in left pane of FileChooser cannot be renamed
index 34eda38db6fe98f1a4466633816d73a30fb563e8..482179b032f380e4b726652c18aae4ccecb69f10 100644 (file)
@@ -1002,7 +1002,9 @@ gtk_text_tag_set_property (GObject      *object,
       {
         GdkColor color;
 
-        if (gdk_color_parse (g_value_get_string (value), &color))
+        if (!g_value_get_string (value))
+          set_bg_color (text_tag, NULL);       /* reset to background_set to FALSE */
+        else if (gdk_color_parse (g_value_get_string (value), &color))
           set_bg_color (text_tag, &color);
         else
           g_warning ("Don't know color `%s'", g_value_get_string (value));
@@ -1015,7 +1017,9 @@ gtk_text_tag_set_property (GObject      *object,
       {
         GdkColor color;
 
-        if (gdk_color_parse (g_value_get_string (value), &color))
+        if (!g_value_get_string (value))
+          set_fg_color (text_tag, NULL);       /* reset to foreground_set to FALSE */
+        else if (gdk_color_parse (g_value_get_string (value), &color))
           set_fg_color (text_tag, &color);
         else
           g_warning ("Don't know color `%s'", g_value_get_string (value));
@@ -1295,7 +1299,9 @@ gtk_text_tag_set_property (GObject      *object,
       {
         GdkColor color;
 
-        if (gdk_color_parse (g_value_get_string (value), &color))
+        if (!g_value_get_string (value))
+          set_pg_bg_color (text_tag, NULL);       /* reset to paragraph_background_set to FALSE */
+        else if (gdk_color_parse (g_value_get_string (value), &color))
           set_pg_bg_color (text_tag, &color);
         else
           g_warning ("Don't know color `%s'", g_value_get_string (value));