summaryrefslogtreecommitdiff
path: root/gtk/a11y/gtkcellaccessible.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-11-10 22:07:19 +0100
committerBenjamin Otte <otte@redhat.com>2011-11-16 04:31:06 +0100
commit02fd1e5a6260d8f74977a56f311be117b5417d38 (patch)
treefebf346b6417d2311447774e16d6f18304d26ee3 /gtk/a11y/gtkcellaccessible.c
parent2bd69cbf8c4eda845eeac205cc5132c6bf2b8565 (diff)
downloadgtk+-02fd1e5a6260d8f74977a56f311be117b5417d38.tar.gz
a11y: Add _gtk_cell_accessible_parent_get_child_index()
This will soon replace the shenanigans we do to keep the index of cells current.
Diffstat (limited to 'gtk/a11y/gtkcellaccessible.c')
-rw-r--r--gtk/a11y/gtkcellaccessible.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gtk/a11y/gtkcellaccessible.c b/gtk/a11y/gtkcellaccessible.c
index 93f0ebe771..54bd1adf47 100644
--- a/gtk/a11y/gtkcellaccessible.c
+++ b/gtk/a11y/gtkcellaccessible.c
@@ -91,8 +91,18 @@ static gint
gtk_cell_accessible_get_index_in_parent (AtkObject *obj)
{
GtkCellAccessible *cell;
+ AtkObject *parent;
+ int index;
cell = GTK_CELL_ACCESSIBLE (obj);
+ parent = gtk_widget_get_accessible (cell->widget);
+ if (parent == NULL)
+ return -1;
+
+ index = _gtk_cell_accessible_parent_get_child_index (GTK_CELL_ACCESSIBLE_PARENT (parent), cell);
+ if (index >= 0)
+ return index;
+
if (atk_state_set_contains_state (cell->state_set, ATK_STATE_STALE) &&
cell->refresh_index != NULL)
{