aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-cell-toggle.c
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/table/e-cell-toggle.c')
-rw-r--r--widgets/table/e-cell-toggle.c11
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;