diff --git a/gtk/a11y/gtkcellaccessible.c b/gtk/a11y/gtkcellaccessible.c index 54bd1adf47..c68ff27125 100644 --- a/gtk/a11y/gtkcellaccessible.c +++ b/gtk/a11y/gtkcellaccessible.c @@ -95,6 +95,11 @@ gtk_cell_accessible_get_index_in_parent (AtkObject *obj) int index; cell = GTK_CELL_ACCESSIBLE (obj); + + parent = atk_object_get_parent (obj); + if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (parent)) + return g_list_index (GTK_CONTAINER_CELL_ACCESSIBLE (parent)->children, obj); + parent = gtk_widget_get_accessible (cell->widget); if (parent == NULL) return -1; diff --git a/gtk/a11y/gtkcontainercellaccessible.c b/gtk/a11y/gtkcontainercellaccessible.c index ad5bdb4ac3..d2f577d938 100644 --- a/gtk/a11y/gtkcontainercellaccessible.c +++ b/gtk/a11y/gtkcontainercellaccessible.c @@ -96,29 +96,6 @@ _gtk_container_cell_accessible_new (void) return container; } -static void -recompute_child_indices (GtkContainerCellAccessible *container) -{ - gint cur_index = 0; - GList *l; - - for (l = container->children; l; l = l->next) - { - GTK_CELL_ACCESSIBLE (l->data)->index = cur_index; - cur_index++; - } -} - -static void -refresh_child_index (GtkCellAccessible *cell) -{ - AtkObject *parent; - - parent = atk_object_get_parent (ATK_OBJECT (cell)); - - recompute_child_indices (GTK_CONTAINER_CELL_ACCESSIBLE (parent)); -} - void _gtk_container_cell_accessible_add_child (GtkContainerCellAccessible *container, GtkCellAccessible *child) @@ -132,7 +109,6 @@ _gtk_container_cell_accessible_add_child (GtkContainerCellAccessible *container, container->children = g_list_append (container->children, child); child->index = child_index; atk_object_set_parent (ATK_OBJECT (child), ATK_OBJECT (container)); - child->refresh_index = refresh_child_index; } void @@ -144,6 +120,5 @@ _gtk_container_cell_accessible_remove_child (GtkContainerCellAccessible *contain g_return_if_fail (container->NChildren > 0); container->children = g_list_remove (container->children, child); - recompute_child_indices (container); container->NChildren--; }