From a8629917ae91588cea02e0e8a20afc593a263cd7 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Tue, 3 Feb 1998 05:57:31 +0000 Subject: [PATCH] gtk/gtktable.c Fixed problem with division by zero in row/column-spanned Tue Feb 3 00:12:00 1998 Owen Taylor * gtk/gtktable.c Fixed problem with division by zero in row/column-spanned tables. Also removed a bunch of conditionals by making the observation that x/1 == x. --- ChangeLog | 7 +++++++ ChangeLog.pre-2-0 | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-2 | 7 +++++++ ChangeLog.pre-2-4 | 7 +++++++ ChangeLog.pre-2-6 | 7 +++++++ ChangeLog.pre-2-8 | 7 +++++++ gtk/gtktable.c | 33 ++++++--------------------------- 8 files changed, 55 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 172b0e4982..147110c4cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Feb 3 00:12:00 1998 Owen Taylor + * gtk/gtktable.c + Fixed problem with division by zero in row/column-spanned + tables. Also removed a bunch of conditionals by making + the observation that x/1 == x. + Mon Feb 2 04:15:08 1998 Tim Janik * gtk/gtkwindow.c: @@ -213,6 +219,7 @@ Sat Jan 31 23:55:03 1998 Tim Janik * gtk/testgtk.c: some changes because of all the above ;) +>>>>>>> 1.103 Sat Jan 31 21:26:27 1998 Owen Taylor * gtk/gtkwidget.c: Added a new GTK_IN_REPARENT flag and revised diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 172b0e4982..147110c4cb 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Tue Feb 3 00:12:00 1998 Owen Taylor + * gtk/gtktable.c + Fixed problem with division by zero in row/column-spanned + tables. Also removed a bunch of conditionals by making + the observation that x/1 == x. + Mon Feb 2 04:15:08 1998 Tim Janik * gtk/gtkwindow.c: @@ -213,6 +219,7 @@ Sat Jan 31 23:55:03 1998 Tim Janik * gtk/testgtk.c: some changes because of all the above ;) +>>>>>>> 1.103 Sat Jan 31 21:26:27 1998 Owen Taylor * gtk/gtkwidget.c: Added a new GTK_IN_REPARENT flag and revised diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 172b0e4982..147110c4cb 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Tue Feb 3 00:12:00 1998 Owen Taylor + * gtk/gtktable.c + Fixed problem with division by zero in row/column-spanned + tables. Also removed a bunch of conditionals by making + the observation that x/1 == x. + Mon Feb 2 04:15:08 1998 Tim Janik * gtk/gtkwindow.c: @@ -213,6 +219,7 @@ Sat Jan 31 23:55:03 1998 Tim Janik * gtk/testgtk.c: some changes because of all the above ;) +>>>>>>> 1.103 Sat Jan 31 21:26:27 1998 Owen Taylor * gtk/gtkwidget.c: Added a new GTK_IN_REPARENT flag and revised diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 172b0e4982..147110c4cb 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Tue Feb 3 00:12:00 1998 Owen Taylor + * gtk/gtktable.c + Fixed problem with division by zero in row/column-spanned + tables. Also removed a bunch of conditionals by making + the observation that x/1 == x. + Mon Feb 2 04:15:08 1998 Tim Janik * gtk/gtkwindow.c: @@ -213,6 +219,7 @@ Sat Jan 31 23:55:03 1998 Tim Janik * gtk/testgtk.c: some changes because of all the above ;) +>>>>>>> 1.103 Sat Jan 31 21:26:27 1998 Owen Taylor * gtk/gtkwidget.c: Added a new GTK_IN_REPARENT flag and revised diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 172b0e4982..147110c4cb 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Tue Feb 3 00:12:00 1998 Owen Taylor + * gtk/gtktable.c + Fixed problem with division by zero in row/column-spanned + tables. Also removed a bunch of conditionals by making + the observation that x/1 == x. + Mon Feb 2 04:15:08 1998 Tim Janik * gtk/gtkwindow.c: @@ -213,6 +219,7 @@ Sat Jan 31 23:55:03 1998 Tim Janik * gtk/testgtk.c: some changes because of all the above ;) +>>>>>>> 1.103 Sat Jan 31 21:26:27 1998 Owen Taylor * gtk/gtkwidget.c: Added a new GTK_IN_REPARENT flag and revised diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 172b0e4982..147110c4cb 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Tue Feb 3 00:12:00 1998 Owen Taylor + * gtk/gtktable.c + Fixed problem with division by zero in row/column-spanned + tables. Also removed a bunch of conditionals by making + the observation that x/1 == x. + Mon Feb 2 04:15:08 1998 Tim Janik * gtk/gtkwindow.c: @@ -213,6 +219,7 @@ Sat Jan 31 23:55:03 1998 Tim Janik * gtk/testgtk.c: some changes because of all the above ;) +>>>>>>> 1.103 Sat Jan 31 21:26:27 1998 Owen Taylor * gtk/gtkwidget.c: Added a new GTK_IN_REPARENT flag and revised diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 172b0e4982..147110c4cb 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Tue Feb 3 00:12:00 1998 Owen Taylor + * gtk/gtktable.c + Fixed problem with division by zero in row/column-spanned + tables. Also removed a bunch of conditionals by making + the observation that x/1 == x. + Mon Feb 2 04:15:08 1998 Tim Janik * gtk/gtkwindow.c: @@ -213,6 +219,7 @@ Sat Jan 31 23:55:03 1998 Tim Janik * gtk/testgtk.c: some changes because of all the above ;) +>>>>>>> 1.103 Sat Jan 31 21:26:27 1998 Owen Taylor * gtk/gtkwidget.c: Added a new GTK_IN_REPARENT flag and revised diff --git a/gtk/gtktable.c b/gtk/gtktable.c index 85cd80606d..0f5959f749 100644 --- a/gtk/gtktable.c +++ b/gtk/gtktable.c @@ -964,12 +964,7 @@ gtk_table_size_allocate_pass1 (GtkTable *table) for (col = 0; col < table->ncols; col++) { extra = width / (table->ncols - col); - - if ((col + 1) == table->ncols) - table->cols[col].allocation = width; - else - table->cols[col].allocation = extra; - + table->cols[col].allocation = extra; width -= extra; } } @@ -1001,10 +996,7 @@ gtk_table_size_allocate_pass1 (GtkTable *table) if (table->cols[col].expand) { extra = width / nexpand; - if (nexpand == 1) - table->cols[col].allocation += width; - else - table->cols[col].allocation += extra; + table->cols[col].allocation += extra; width -= extra; nexpand -= 1; @@ -1021,10 +1013,7 @@ gtk_table_size_allocate_pass1 (GtkTable *table) if (table->cols[col].shrink) { extra = width / nshrink; - if (nshrink == 1) - table->cols[col].allocation -= width; - else - table->cols[col].allocation -= extra; + table->cols[col].allocation -= extra; width -= extra; nshrink -= 1; @@ -1053,11 +1042,7 @@ gtk_table_size_allocate_pass1 (GtkTable *table) for (row = 0; row < table->nrows; row++) { extra = height / (table->nrows - row); - if ((row + 1) == table->nrows) - table->rows[row].allocation = height; - else - table->rows[row].allocation = extra; - + table->rows[row].allocation = extra; height -= extra; } } @@ -1089,10 +1074,7 @@ gtk_table_size_allocate_pass1 (GtkTable *table) if (table->rows[row].expand) { extra = height / nexpand; - if (nexpand == 1) - table->rows[row].allocation += height; - else - table->rows[row].allocation += extra; + table->rows[row].allocation += extra; height -= extra; nexpand -= 1; @@ -1109,10 +1091,7 @@ gtk_table_size_allocate_pass1 (GtkTable *table) if (table->rows[row].shrink) { extra = height / nshrink; - if (nshrink == 1) - table->rows[row].allocation -= height; - else - table->rows[row].allocation -= extra; + table->rows[row].allocation -= extra; height -= extra; nshrink -= 1;