aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-11-15 04:47:31 +0800
committerChris Lahey <clahey@src.gnome.org>2001-11-15 04:47:31 +0800
commit6c92a88fc703026682269bc5ab0f60f42ee14215 (patch)
tree956d18372fea312bfe855dd4b0b6975669369d49 /widgets/table/e-table.c
parent2829e1602b1d53832d6e6ff441bdeb36c778a70d (diff)
downloadgsoc2013-evolution-6c92a88fc703026682269bc5ab0f60f42ee14215.tar.gz
gsoc2013-evolution-6c92a88fc703026682269bc5ab0f60f42ee14215.tar.zst
gsoc2013-evolution-6c92a88fc703026682269bc5ab0f60f42ee14215.zip
Handle the case where page up or page down goes off the end of the table
2001-11-10 Christopher James Lahey <clahey@ximian.com> * e-table.c (group_key_press), e-tree.c (item_key_press): Handle the case where page up or page down goes off the end of the table or tree. svn path=/trunk/; revision=14702
Diffstat (limited to 'widgets/table/e-table.c')
-rw-r--r--widgets/table/e-table.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index 8724e15dd5..8aceac1332 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -522,6 +522,10 @@ group_key_press (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et
y = CLAMP(vadj->value + (2 * vadj->page_size - 50), 0, vadj->upper);
y -= vadj->value;
e_table_get_cell_at (et, 30, y, &row_local, &col_local);
+
+ if (row_local == -1)
+ row_local = e_table_model_row_count (et->model) - 1;
+
row_local = e_table_view_to_model_row (et, row_local);
col_local = e_selection_model_cursor_col (E_SELECTION_MODEL (et->selection));
e_selection_model_select_as_key_press (E_SELECTION_MODEL (et->selection), row_local, col_local, key->state);
@@ -533,6 +537,10 @@ group_key_press (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et
y = CLAMP(vadj->value - (vadj->page_size - 50), 0, vadj->upper);
y -= vadj->value;
e_table_get_cell_at (et, 30, y, &row_local, &col_local);
+
+ if (row_local == -1)
+ row_local = 0;
+
row_local = e_table_view_to_model_row (et, row_local);
col_local = e_selection_model_cursor_col (E_SELECTION_MODEL (et->selection));
e_selection_model_select_as_key_press (E_SELECTION_MODEL (et->selection), row_local, col_local, key->state);