From a9dd3e559af6763e86ee615b6fcbc8a506e766c4 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 11 Nov 2011 01:40:36 +0100 Subject: [PATCH] a11y: Make the cache lookup function inefficient Ahem. This is in preparation for future changes and is not meant to stay this way. But I want to change the hash table's keys and this is way easier when nobody is using them. --- gtk/a11y/gtktreeviewaccessible.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c index 83667947c8..b6faa75377 100644 --- a/gtk/a11y/gtktreeviewaccessible.c +++ b/gtk/a11y/gtktreeviewaccessible.c @@ -3206,12 +3206,19 @@ find_cell (GtkTreeViewAccessible *accessible, gint index) { GtkTreeViewAccessibleCellInfo *info; + GHashTableIter iter; + GtkTreeView *tree_view; - info = g_hash_table_lookup (accessible->cell_info_by_index, &index); - if (!info) - return NULL; + tree_view = GTK_TREE_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible))); - return info->cell; + g_hash_table_iter_init (&iter, accessible->cell_info_by_index); + while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &info)) + { + if (index == cell_info_get_index (tree_view, info)) + return info->cell; + } + + return NULL; } static void