Bug 542523 - GtkTextTag should handle setting properties to NULL

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
This commit is contained in:
Xavier Claessens
2008-07-15 15:23:43 +00:00
committed by Xavier Claessens
parent 81c7dc93f7
commit 2452be453b
2 changed files with 16 additions and 3 deletions

View File

@ -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

View 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));