diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-08-01 15:30:11 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-08-01 15:30:11 +0800 |
commit | 01d76f259086c09eadee101f6c28bcb06a9e11b0 (patch) | |
tree | dac34d70aa5a5d5d6ebe4db5bea4cc02fe277a12 /widgets/table | |
parent | 63eaf4c25ef157f5e4aac33ab57462e6bc1774bb (diff) | |
download | gsoc2013-evolution-01d76f259086c09eadee101f6c28bcb06a9e11b0.tar.gz gsoc2013-evolution-01d76f259086c09eadee101f6c28bcb06a9e11b0.tar.zst gsoc2013-evolution-01d76f259086c09eadee101f6c28bcb06a9e11b0.zip |
Made this not query the 0th row if there are 0 rows in the table. Fixes
2001-08-01 Christopher James Lahey <clahey@ximian.com>
* e-cell-toggle.c (etog_max_width): Made this not query the 0th
row if there are 0 rows in the table. Fixes Ximian bug #5640.
svn path=/trunk/; revision=11542
Diffstat (limited to 'widgets/table')
-rw-r--r-- | widgets/table/e-cell-toggle.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c index 45971f6f18..e85418e593 100644 --- a/widgets/table/e-cell-toggle.c +++ b/widgets/table/e-cell-toggle.c @@ -233,16 +233,15 @@ static int etog_max_width (ECellView *ecell_view, int model_col, int view_col) { ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell); - void *_value = e_table_model_value_at (ecell_view->e_table_model, model_col, 0); - int max_width = gdk_pixbuf_get_width (toggle->images[GPOINTER_TO_INT (_value)]); + int max_width = 0; int number_of_rows; int row; number_of_rows = e_table_model_row_count (ecell_view->e_table_model); - for (row = 1; row < number_of_rows; row++) { - void *_value = e_table_model_value_at (ecell_view->e_table_model, - model_col, row); - max_width = MAX (max_width, gdk_pixbuf_get_width (toggle->images[GPOINTER_TO_INT (_value)])); + for (row = 0; row < number_of_rows; row++) { + void *value = e_table_model_value_at (ecell_view->e_table_model, + model_col, row); + max_width = MAX (max_width, gdk_pixbuf_get_width (toggle->images[GPOINTER_TO_INT (value)])); } return max_width; |