[gtk+] a11y: Don't emit children-changed when nothing changed
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] a11y: Don't emit children-changed when nothing changed
- Date: Fri, 16 Dec 2011 12:40:06 +0000 (UTC)
commit 113aff673f726542efd84565642651e442063a83
Author: Benjamin Otte <otte redhat com>
Date: Fri Dec 16 12:57:06 2011 +0100
a11y: Don't emit children-changed when nothing changed
When we have 0 columns, no children ever get added or removed.
gtk/a11y/gtktreeviewaccessible.c | 34 ++++++++++++++++++++--------------
1 files changed, 20 insertions(+), 14 deletions(-)
---
diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c
index 06abfa0..61762e1 100644
--- a/gtk/a11y/gtktreeviewaccessible.c
+++ b/gtk/a11y/gtktreeviewaccessible.c
@@ -1881,10 +1881,13 @@ _gtk_tree_view_accessible_add (GtkTreeView *treeview,
g_signal_emit_by_name (accessible, "row-inserted", row, n_rows);
n_cols = get_n_columns (treeview);
- for (i = (row + 1) * n_cols; i < (row + n_rows + 1) * n_cols; i++)
+ if (n_cols)
{
- /* Pass NULL as the child object, i.e. 4th argument */
- g_signal_emit_by_name (accessible, "children-changed::add", i, NULL, NULL);
+ for (i = (row + 1) * n_cols; i < (row + n_rows + 1) * n_cols; i++)
+ {
+ /* Pass NULL as the child object, i.e. 4th argument */
+ g_signal_emit_by_name (accessible, "children-changed::add", i, NULL, NULL);
+ }
}
}
@@ -1920,19 +1923,22 @@ _gtk_tree_view_accessible_remove (GtkTreeView *treeview,
g_signal_emit_by_name (accessible, "row-deleted", row, n_rows);
n_cols = get_n_columns (treeview);
- for (i = (n_rows + row + 1) * n_cols - 1; i >= (row + 1) * n_cols; i--)
+ if (n_cols)
{
- /* Pass NULL as the child object, i.e. 4th argument */
- g_signal_emit_by_name (accessible, "children-changed::remove", i, NULL, NULL);
- }
+ for (i = (n_rows + row + 1) * n_cols - 1; i >= (row + 1) * n_cols; i--)
+ {
+ /* Pass NULL as the child object, i.e. 4th argument */
+ g_signal_emit_by_name (accessible, "children-changed::remove", i, NULL, NULL);
+ }
- g_hash_table_iter_init (&iter, accessible->cell_infos);
- while (g_hash_table_iter_next (&iter, NULL, (gpointer *)&cell_info))
- {
- if (node == cell_info->node ||
- tree == cell_info->tree ||
- (tree && _gtk_rbtree_contains (tree, cell_info->tree)))
- g_hash_table_iter_remove (&iter);
+ g_hash_table_iter_init (&iter, accessible->cell_infos);
+ while (g_hash_table_iter_next (&iter, NULL, (gpointer *)&cell_info))
+ {
+ if (node == cell_info->node ||
+ tree == cell_info->tree ||
+ (tree && _gtk_rbtree_contains (tree, cell_info->tree)))
+ g_hash_table_iter_remove (&iter);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]