aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-07-05 15:05:51 +0800
committerChris Lahey <clahey@src.gnome.org>2001-07-05 15:05:51 +0800
commitb530eb430743def1c4bb506d71b33735c7be429a (patch)
treea795b2fe0471813a90961053fb60e976b7c574b9 /widgets
parente509ad72df82b4f8e0e516b019d1f0c06f9a8a88 (diff)
downloadgsoc2013-evolution-b530eb430743def1c4bb506d71b33735c7be429a.tar
gsoc2013-evolution-b530eb430743def1c4bb506d71b33735c7be429a.tar.gz
gsoc2013-evolution-b530eb430743def1c4bb506d71b33735c7be429a.tar.bz2
gsoc2013-evolution-b530eb430743def1c4bb506d71b33735c7be429a.tar.lz
gsoc2013-evolution-b530eb430743def1c4bb506d71b33735c7be429a.tar.xz
gsoc2013-evolution-b530eb430743def1c4bb506d71b33735c7be429a.tar.zst
gsoc2013-evolution-b530eb430743def1c4bb506d71b33735c7be429a.zip
Make sure start_row and end_row are within the number of rows in the
2001-07-05 Christopher James Lahey <clahey@ximian.com> * e-table-item.c (e_table_item_row_diff): Make sure start_row and end_row are within the number of rows in the table. svn path=/trunk/; revision=10788
Diffstat (limited to 'widgets')
-rw-r--r--widgets/table/e-table-item.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 5230ab7771..aac9439030 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -93,6 +93,8 @@ 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) {
@@ -126,6 +128,8 @@ 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)
@@ -689,6 +693,10 @@ e_table_item_row_diff (ETableItem *eti, int start_row, int end_row)
int height_extra = eti->horizontal_draw_grid ? 1 : 0;
total = 0;
+ if (start_row < 0)
+ start_row = 0;
+ if (end_row > eti->rows)
+ end_row = eti->rows;
for (row = start_row; row < end_row; row++)
total += eti_row_height (eti, row) + height_extra;