Make sure that we keep priv->columns >= 1 even for empty menus, since we

Tue Feb 17 23:11:21 2004  Matthias Clasen  <maclas@gmx.de>

	* 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)
This commit is contained in:
Matthias Clasen 2004-02-17 22:16:02 +00:00 committed by Matthias Clasen
parent 6c8430c0c4
commit c1d9c02b09
6 changed files with 36 additions and 4 deletions

View File

@ -1,3 +1,9 @@
Tue Feb 17 23:11:21 2004 Matthias Clasen <maclas@gmx.de>
* 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 <sandmann@daimi.au.dk>
Fix for #119722, reported by Olexiy Avramchenko, patch by Owen

View File

@ -1,3 +1,9 @@
Tue Feb 17 23:11:21 2004 Matthias Clasen <maclas@gmx.de>
* 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 <sandmann@daimi.au.dk>
Fix for #119722, reported by Olexiy Avramchenko, patch by Owen

View File

@ -1,3 +1,9 @@
Tue Feb 17 23:11:21 2004 Matthias Clasen <maclas@gmx.de>
* 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 <sandmann@daimi.au.dk>
Fix for #119722, reported by Olexiy Avramchenko, patch by Owen

View File

@ -1,3 +1,9 @@
Tue Feb 17 23:11:21 2004 Matthias Clasen <maclas@gmx.de>
* 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 <sandmann@daimi.au.dk>
Fix for #119722, reported by Olexiy Avramchenko, patch by Owen

View File

@ -1,3 +1,9 @@
Tue Feb 17 23:11:21 2004 Matthias Clasen <maclas@gmx.de>
* 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 <sandmann@daimi.au.dk>
Fix for #119722, reported by Olexiy Avramchenko, patch by Owen

View File

@ -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);
}