Check if string is non-NULL
2001-12-07 Bradford Hovinen <hovinen@ximian.com> * preferences.c (read_color_from_string): Check if string is non-NULL
This commit is contained in:
parent
4703f9f1a1
commit
58d92fe12a
2 changed files with 10 additions and 5 deletions
|
@ -1,5 +1,8 @@
|
|||
2001-12-07 Bradford Hovinen <hovinen@ximian.com>
|
||||
|
||||
* preferences.c (read_color_from_string): Check if string is
|
||||
non-NULL
|
||||
|
||||
* applier.c (applier_class_init): Initialize object_class properly
|
||||
before using it; install property after {get|set}_property are set
|
||||
(applier_get_preview_widget): Construct the GC before using it
|
||||
|
|
|
@ -253,11 +253,13 @@ read_color_from_string (const gchar *string)
|
|||
|
||||
color = g_new0 (GdkColor, 1);
|
||||
|
||||
if (string != NULL) {
|
||||
gdk_color_parse (string, color);
|
||||
rgb = ((color->red >> 8) << 16) ||
|
||||
((color->green >> 8) << 8) ||
|
||||
(color->blue >> 8);
|
||||
color->pixel = gdk_rgb_xpixel_from_rgb (rgb);
|
||||
}
|
||||
|
||||
return color;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue