aboutsummaryrefslogtreecommitdiffstats
path: root/a11y
diff options
context:
space:
mode:
authorYuedong Du <yuedong.du@sun.com>2004-04-01 18:08:27 +0800
committerYuedong Du <york@src.gnome.org>2004-04-01 18:08:27 +0800
commit2c836a89a992483a98df6a98f22dcda21f909453 (patch)
tree2d9f8828cc5e292a74968fda38dd8270d43e5d53 /a11y
parent16cc716139de0cfe8679a1f86a72fed92cf7b189 (diff)
downloadgsoc2013-evolution-2c836a89a992483a98df6a98f22dcda21f909453.tar
gsoc2013-evolution-2c836a89a992483a98df6a98f22dcda21f909453.tar.gz
gsoc2013-evolution-2c836a89a992483a98df6a98f22dcda21f909453.tar.bz2
gsoc2013-evolution-2c836a89a992483a98df6a98f22dcda21f909453.tar.lz
gsoc2013-evolution-2c836a89a992483a98df6a98f22dcda21f909453.tar.xz
gsoc2013-evolution-2c836a89a992483a98df6a98f22dcda21f909453.tar.zst
gsoc2013-evolution-2c836a89a992483a98df6a98f22dcda21f909453.zip
add some sanity check here. add atk_state_focused to focused cell, it is
2004-04-01 Yuedong Du <yuedong.du@sun.com> * gal/a11y/e-table/gal-a11y-e-cell-text.c: (ect_get_caret_offset): add some sanity check here. * gal/a11y/e-table/gal-a11y-e-table-item.c: add atk_state_focused to focused cell, it is must. (gal_a11y_e_table_item_new), (eti_a11y_cursor_changed_cb): svn path=/trunk/; revision=25277
Diffstat (limited to 'a11y')
-rw-r--r--a11y/e-table/gal-a11y-e-cell-text.c5
-rw-r--r--a11y/e-table/gal-a11y-e-table-item.c15
2 files changed, 16 insertions, 4 deletions
diff --git a/a11y/e-table/gal-a11y-e-cell-text.c b/a11y/e-table/gal-a11y-e-cell-text.c
index e23d1f2feb..88eefc8325 100644
--- a/a11y/e-table/gal-a11y-e-cell-text.c
+++ b/a11y/e-table/gal-a11y-e-cell-text.c
@@ -107,9 +107,12 @@ static gint
ect_get_caret_offset (AtkText *text)
{
GalA11yECell *gaec = GAL_A11Y_E_CELL (text);
- ECellText *ect = E_CELL_TEXT (gaec->cell_view->ecell);
+ ECellText *ect = NULL;
gint start, end;
+ g_return_val_if_fail (gaec && gaec->cell_view && gaec->cell_view->ecell && E_IS_CELL_TEXT (gaec->cell_view->ecell), -1);
+ ect = E_CELL_TEXT (gaec->cell_view->ecell);
+
if (e_cell_text_get_selection (gaec->cell_view,
gaec->view_col, gaec->row,
&start, &end)) {
diff --git a/a11y/e-table/gal-a11y-e-table-item.c b/a11y/e-table/gal-a11y-e-table-item.c
index fcfa1cc0e6..984eaa6e3a 100644
--- a/a11y/e-table/gal-a11y-e-table-item.c
+++ b/a11y/e-table/gal-a11y-e-table-item.c
@@ -1035,8 +1035,10 @@ gal_a11y_e_table_item_new (AtkObject *parent,
int index_in_parent)
{
GalA11yETableItem *a11y;
+ AtkObject *accessible;
int n;
+ g_return_val_if_fail (item && item->cols >= 0 && item->rows >= 0, NULL);
a11y = g_object_new (gal_a11y_e_table_item_get_type (), NULL);
atk_object_initialize (ATK_OBJECT (a11y), item);
@@ -1044,7 +1046,9 @@ gal_a11y_e_table_item_new (AtkObject *parent,
GET_PRIVATE (a11y)->parent = parent;
GET_PRIVATE (a11y)->index_in_parent = index_in_parent;
- g_return_val_if_fail (item->cols >= 0 && item->rows >= 0, NULL);
+
+ accessible = ATK_OBJECT(a11y);
+ accessible->role = ATK_ROLE_TREE_TABLE;
/* Initialize cell data. */
n = item->cols * item->rows;
GET_PRIVATE (a11y)->cols = item->cols;
@@ -1187,10 +1191,15 @@ eti_a11y_cursor_changed_cb (ESelectionModel *selection,
g_signal_emit_by_name (a11y, "selection_changed");
cell = atk_table_ref_at (ATK_TABLE (a11y), row, col);
- if (ATK_IS_OBJECT (cell))
- g_signal_emit_by_name (a11y,
+ if (cell != NULL) {
+ gal_a11y_e_cell_add_state(cell, ATK_STATE_FOCUSED, FALSE);
+
+ if (ATK_IS_OBJECT (cell))
+ g_signal_emit_by_name (a11y,
"active-descendant-changed",
cell);
+ atk_focus_tracker_notify (cell);
+ }
}
/* atk selection */