From c1d9c02b090f7cf1d95e90ecf459627fb3e598b8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 17 Feb 2004 22:16:02 +0000 Subject: [PATCH] Make sure that we keep priv->columns >= 1 even for empty menus, since we Tue Feb 17 23:11:21 2004 Matthias Clasen * gtk/gtkmenu.c (gtk_menu_do_remove): Make sure that we keep priv->columns >= 1 even for empty menus, since we divide by it somewhere else. (#133428, Vincent Noel) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkmenu.c | 10 ++++++---- 6 files changed, 36 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19f9521b75..e40fde338e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Feb 17 23:11:21 2004 Matthias Clasen + + * gtk/gtkmenu.c (gtk_menu_do_remove): Make sure that we keep + priv->columns >= 1 even for empty menus, since we divide by it + somewhere else. (#133428, Vincent Noel) + Tue Feb 17 23:02:58 2004 Soeren Sandmann Fix for #119722, reported by Olexiy Avramchenko, patch by Owen diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 19f9521b75..e40fde338e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Tue Feb 17 23:11:21 2004 Matthias Clasen + + * gtk/gtkmenu.c (gtk_menu_do_remove): Make sure that we keep + priv->columns >= 1 even for empty menus, since we divide by it + somewhere else. (#133428, Vincent Noel) + Tue Feb 17 23:02:58 2004 Soeren Sandmann Fix for #119722, reported by Olexiy Avramchenko, patch by Owen diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 19f9521b75..e40fde338e 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Tue Feb 17 23:11:21 2004 Matthias Clasen + + * gtk/gtkmenu.c (gtk_menu_do_remove): Make sure that we keep + priv->columns >= 1 even for empty menus, since we divide by it + somewhere else. (#133428, Vincent Noel) + Tue Feb 17 23:02:58 2004 Soeren Sandmann Fix for #119722, reported by Olexiy Avramchenko, patch by Owen diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 19f9521b75..e40fde338e 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Tue Feb 17 23:11:21 2004 Matthias Clasen + + * gtk/gtkmenu.c (gtk_menu_do_remove): Make sure that we keep + priv->columns >= 1 even for empty menus, since we divide by it + somewhere else. (#133428, Vincent Noel) + Tue Feb 17 23:02:58 2004 Soeren Sandmann Fix for #119722, reported by Olexiy Avramchenko, patch by Owen diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 19f9521b75..e40fde338e 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Tue Feb 17 23:11:21 2004 Matthias Clasen + + * gtk/gtkmenu.c (gtk_menu_do_remove): Make sure that we keep + priv->columns >= 1 even for empty menus, since we divide by it + somewhere else. (#133428, Vincent Noel) + Tue Feb 17 23:02:58 2004 Soeren Sandmann Fix for #119722, reported by Olexiy Avramchenko, patch by Owen diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 15ad9743f5..acdd57a3c3 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -948,9 +948,11 @@ gtk_menu_do_remove (GtkMenuShell *menu_shell, delta = ai->bottom_attach - ai->top_attach; single_column = priv->columns == 1; - /* recalculate these, assuming the child has already been removed */ + /* Recalculate these, assuming the child has already been removed. + * Note that an empty menu is assumed to have one column. + */ priv->rows = 0; - priv->columns = 0; + priv->columns = 1; for (children = menu_shell->children; children; children = children->next) { @@ -1015,7 +1017,7 @@ gtk_menu_do_insert (GtkMenuShell *menu_shell, { /* attach after the last row */ gtk_menu_attach (GTK_MENU (menu_shell), child, - 0, priv->columns ? priv->columns : 1, + 0, priv->columns, priv->rows, priv->rows + 1); return; @@ -1039,7 +1041,7 @@ gtk_menu_do_insert (GtkMenuShell *menu_shell, /* attach the new item */ gtk_menu_attach (GTK_MENU (menu_shell), child, - 0, priv->columns ? priv->columns : 1, + 0, priv->columns, position, position + 1); }