Printers: Check that GValue holds int before using it

Check that GValue returned as value of GTK_STYLE_PROPERTY_BORDER_RADIUS
holds int.
This commit is contained in:
Marek Kasik 2011-05-16 10:43:18 +02:00
parent bb858701a3
commit 60e9f49673

View file

@ -1736,13 +1736,14 @@ supply_levels_draw_cb (GtkWidget *widget,
gchar **marker_namesv = NULL; gchar **marker_namesv = NULL;
gchar **marker_typesv = NULL; gchar **marker_typesv = NULL;
gchar *tmp = NULL; gchar *tmp = NULL;
gint border_radius = 3; gint border_radius = 0;
context = gtk_widget_get_style_context ((GtkWidget *) context = gtk_widget_get_style_context ((GtkWidget *)
gtk_builder_get_object (priv->builder, "printer-options-button")); gtk_builder_get_object (priv->builder, "printer-options-button"));
gtk_style_context_get_border_color (context, 0, &border_color); gtk_style_context_get_border_color (context, 0, &border_color);
gtk_style_context_get_property ( gtk_style_context_get_property (
context, GTK_STYLE_PROPERTY_BORDER_RADIUS, 0, &int_val); context, GTK_STYLE_PROPERTY_BORDER_RADIUS, 0, &int_val);
if (G_VALUE_HOLDS_INT (&int_val))
border_radius = g_value_get_int (&int_val); border_radius = g_value_get_int (&int_val);
widget = (GtkWidget*) widget = (GtkWidget*)