diff options
-rw-r--r-- | widgets/e-table/ChangeLog | 4 | ||||
-rw-r--r-- | widgets/e-table/e-table.c | 6 | ||||
-rw-r--r-- | widgets/table/e-table.c | 6 |
3 files changed, 10 insertions, 6 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog index 90230e3ceb..eacf84cea9 100644 --- a/widgets/e-table/ChangeLog +++ b/widgets/e-table/ChangeLog @@ -1,3 +1,7 @@ +2000-08-05 Dan Winship <danw@helixcode.com> + + * e-table.c (e_table_get_{next,prev}_row_sorted): fix + 2000-08-05 Christopher James Lahey <clahey@helixcode.com> * e-table.c: Added a function to get the next row with sorting diff --git a/widgets/e-table/e-table.c b/widgets/e-table/e-table.c index c56d4ff931..d9cbbc4779 100644 --- a/widgets/e-table/e-table.c +++ b/widgets/e-table/e-table.c @@ -932,9 +932,9 @@ e_table_get_next_row_sorted (ETable *e_table, if (e_table->sorter) { int i; i = e_table_sorter_model_to_sorted(e_table->sorter, model_row); - if (i < e_table_model_row_count(e_table->model)) { + if (i < e_table_model_row_count(e_table->model) - 1) { i++; - return e_table_sorter_sorted_to_model(e_table->sorter, model_row); + return e_table_sorter_sorted_to_model(e_table->sorter, i); } else return -1; } else @@ -953,7 +953,7 @@ e_table_get_prev_row_sorted (ETable *e_table, i = e_table_sorter_model_to_sorted(e_table->sorter, model_row); i--; if (i >= 0) - return e_table_sorter_sorted_to_model(e_table->sorter, model_row); + return e_table_sorter_sorted_to_model(e_table->sorter, i); else return -1; } else diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index c56d4ff931..d9cbbc4779 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -932,9 +932,9 @@ e_table_get_next_row_sorted (ETable *e_table, if (e_table->sorter) { int i; i = e_table_sorter_model_to_sorted(e_table->sorter, model_row); - if (i < e_table_model_row_count(e_table->model)) { + if (i < e_table_model_row_count(e_table->model) - 1) { i++; - return e_table_sorter_sorted_to_model(e_table->sorter, model_row); + return e_table_sorter_sorted_to_model(e_table->sorter, i); } else return -1; } else @@ -953,7 +953,7 @@ e_table_get_prev_row_sorted (ETable *e_table, i = e_table_sorter_model_to_sorted(e_table->sorter, model_row); i--; if (i >= 0) - return e_table_sorter_sorted_to_model(e_table->sorter, model_row); + return e_table_sorter_sorted_to_model(e_table->sorter, i); else return -1; } else |