[gtk+] a11y: Improve table_is_row_selected()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] a11y: Improve table_is_row_selected()
- Date: Fri, 16 Dec 2011 03:58:18 +0000 (UTC)
commit 20b56689c5688a53abfba3ea42bfd19a4f93334e
Author: Benjamin Otte <otte redhat com>
Date: Mon Dec 12 17:59:36 2011 +0100
a11y: Improve table_is_row_selected()
gtk/a11y/gtktreeviewaccessible.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c
index 065be9f..d2eaaa5 100644
--- a/gtk/a11y/gtktreeviewaccessible.c
+++ b/gtk/a11y/gtktreeviewaccessible.c
@@ -806,22 +806,23 @@ gtk_tree_view_accessible_is_row_selected (AtkTable *table,
gint row)
{
GtkWidget *widget;
- GtkTreeView *tree_view;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
+ GtkRBTree *tree;
+ GtkRBNode *node;
+
+ if (row < 0)
+ return FALSE;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (table));
if (widget == NULL)
return FALSE;
- if (row < 0)
+ if (!_gtk_rbtree_find_index (_gtk_tree_view_get_rbtree (GTK_TREE_VIEW (widget)),
+ row,
+ &tree,
+ &node))
return FALSE;
- tree_view = GTK_TREE_VIEW (widget);
- selection = gtk_tree_view_get_selection (tree_view);
-
- set_iter_nth_row (tree_view, &iter, row);
- return gtk_tree_selection_iter_is_selected (selection, &iter);
+ return GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]