listboxrowaccessible: Avoid assertion failure

The next call to gtk_list_box_get_selection_mode just expected the
GtkListBoxRow's parent to be a GtkListBox and failed when the row was
added to something other than a GtkListBox.

https://bugzilla.gnome.org/show_bug.cgi?id=733782
This commit is contained in:
Timm Bäder 2014-07-26 13:38:55 +02:00 committed by Matthias Clasen
parent 36b36822c3
commit fb7d710931

View File

@ -51,6 +51,7 @@ gtk_list_box_row_accessible_ref_state_set (AtkObject *obj)
{ {
parent = gtk_widget_get_parent (widget); parent = gtk_widget_get_parent (widget);
if (parent != NULL && if (parent != NULL &&
GTK_IS_LIST_BOX (parent) &&
gtk_list_box_get_selection_mode (GTK_LIST_BOX (parent)) != GTK_SELECTION_NONE) gtk_list_box_get_selection_mode (GTK_LIST_BOX (parent)) != GTK_SELECTION_NONE)
atk_state_set_add_state (state_set, ATK_STATE_SELECTABLE); atk_state_set_add_state (state_set, ATK_STATE_SELECTABLE);