[evolution-patches] gal, #59047, Gnopernicus can't read evolution's message list properly



Hi,
   #59047 is an a11y related bug. The bug's detailed information and
reason is at http://bugzilla.ximian.com/show_bug.cgi?id=59047 .

   I provide a patch to fix this bug, please help review, thanks.

Regards,
Eric
Index: gal-a11y-e-table-item.c
===================================================================
RCS file: /cvs/gnome/gal/gal/a11y/e-table/gal-a11y-e-table-item.c,v
retrieving revision 1.11
diff -u -r1.11 gal-a11y-e-table-item.c
--- gal-a11y-e-table-item.c	22 Apr 2004 11:01:31 -0000	1.11
+++ gal-a11y-e-table-item.c	25 May 2004 14:21:12 -0000
@@ -80,6 +80,42 @@
 	return ecol ? ecol->col_idx : -1;
 }
 
+inline static gint
+model_to_view_row(ETableItem *eti, int row)
+{
+	int i;
+	if (row == -1)
+		return -1;
+	if (eti->uses_source_model) {
+		ETableSubset *etss = E_TABLE_SUBSET(eti->table_model);
+		if (eti->row_guess >= 0 && eti->row_guess < etss->n_map) {
+			if (etss->map_table[eti->row_guess] == row) {
+				return eti->row_guess;
+			}
+		}
+		for (i = 0; i < etss->n_map; i++) {
+			if (etss->map_table[i] == row)
+				return i;
+		}
+		return -1;
+	} else
+		return row;
+}
+
+inline static gint
+model_to_view_col(ETableItem *eti, int col)
+{
+	int i;
+	if (col == -1)
+		return -1;
+	for (i = 0; i < eti->cols; i++) {
+		ETableCol *ecol = e_table_header_get_column (eti->header, i);
+		if (ecol->col_idx == col)
+			return i;
+	}
+	return -1;
+}
+
 inline static GObject *
 eti_a11y_get_gobject (AtkObject *accessible)
 {
@@ -309,6 +345,8 @@
 							    ecol->col_idx,
 							    column,
 							    row);
+			gal_a11y_e_cell_add_state(ret, ATK_STATE_SHOWING, FALSE);
+			gal_a11y_e_cell_add_state(ret, ATK_STATE_VISIBLE, FALSE);
 			cell_data[row*item->cols + column] = ret;
 			if (ATK_IS_OBJECT (ret))
 				g_object_weak_ref (G_OBJECT (ret),
@@ -1288,11 +1326,21 @@
 			    int row, int col,  GalA11yETableItem *a11y)
 {
 	AtkObject * cell;
+	int view_row, view_col;
+	ETableItem *item;
+
 	g_return_if_fail (GAL_A11Y_IS_E_TABLE_ITEM (a11y));
 
 	g_signal_emit_by_name (a11y, "selection_changed");
 
-        cell = atk_table_ref_at (ATK_TABLE (a11y), row, col);
+	item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (a11y)));
+
+	g_return_if_fail (item);
+
+	view_row = model_to_view_row (item, row);
+	view_col = model_to_view_col (item, col);
+
+	cell = atk_table_ref_at (ATK_TABLE (a11y), view_row, view_col);
 	if (cell != NULL) {
 		gal_a11y_e_cell_add_state(cell, ATK_STATE_FOCUSED, FALSE);
 
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gal/ChangeLog,v
retrieving revision 1.869
diff -u -r1.869 ChangeLog
--- a/ChangeLog	19 May 2004 16:59:04 -0000	1.869
+++ b/ChangeLog	25 May 2004 14:36:19 -0000
@@ -1,3 +1,14 @@
+2004-05-25  Eric Zhao  <eric zhao sun com>
+
+	Fixes 59047.
+
+	* gal/a11y/e-table/gal-a11y-e-table-item.c: (model_to_view_row),
+	(model_to_view_col), (eti_ref_at), (eti_a11y_cursor_changed_cb):
+	Set the cell's ATK_STATE_SHOWING and ATK_STATE_VISIBLE properties to
+	be TURE, so that gnopernicus can read the whole table line. Also
+	convert the cursor's to position to view format, prevent potential
+	bug.
+
 2004-05-19  JP Rosevear  <jpr novell com>
 
 	* configure.in: bump version


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]