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:
parent
bb858701a3
commit
60e9f49673
1 changed files with 3 additions and 2 deletions
|
@ -1736,14 +1736,15 @@ supply_levels_draw_cb (GtkWidget *widget,
|
|||
gchar **marker_namesv = NULL;
|
||||
gchar **marker_typesv = NULL;
|
||||
gchar *tmp = NULL;
|
||||
gint border_radius = 3;
|
||||
gint border_radius = 0;
|
||||
|
||||
context = gtk_widget_get_style_context ((GtkWidget *)
|
||||
gtk_builder_get_object (priv->builder, "printer-options-button"));
|
||||
gtk_style_context_get_border_color (context, 0, &border_color);
|
||||
gtk_style_context_get_property (
|
||||
context, GTK_STYLE_PROPERTY_BORDER_RADIUS, 0, &int_val);
|
||||
border_radius = g_value_get_int (&int_val);
|
||||
if (G_VALUE_HOLDS_INT (&int_val))
|
||||
border_radius = g_value_get_int (&int_val);
|
||||
|
||||
widget = (GtkWidget*)
|
||||
gtk_builder_get_object (priv->builder, "supply-drawing-area");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue