Bug 548354 – Remove repeated code in gtk_cell_view_size_allocate

2008-08-19  Björn Lindqvist  <bjourne@gmail.com>

	Bug 548354 – Remove repeated code in gtk_cell_view_size_allocate

	* gtk/gtkcellview.c (gtk_cell_view_size_allocate): Remove some
	code duplication, no need for separate loops for GTK_PACK_START
	and GTK_PACK_END.

svn path=/trunk/; revision=21158
This commit is contained in:
Björn Lindqvist 2008-08-19 19:16:38 +00:00 committed by Björn Lindqvist
parent aad8c0f16e
commit c40b78ae58
2 changed files with 10 additions and 19 deletions

View File

@ -1,3 +1,11 @@
2008-08-19 Björn Lindqvist <bjourne@gmail.com>
Bug 548354 Remove repeated code in gtk_cell_view_size_allocate
* gtk/gtkcellview.c (gtk_cell_view_size_allocate): Remove some
code duplication, no need for separate loops for GTK_PACK_START
and GTK_PACK_END.
2008-08-19 Johan Dahlin <johan@gnome.org> 2008-08-19 Johan Dahlin <johan@gnome.org>
* gtk/gtk-builder-convert (GtkBuilderConverter._parse): * gtk/gtk-builder-convert (GtkBuilderConverter._parse):

View File

@ -381,32 +381,15 @@ gtk_cell_view_size_allocate (GtkWidget *widget,
else if (extra_space > 0 && expand_cell_count > 0) else if (extra_space > 0 && expand_cell_count > 0)
extra_space /= expand_cell_count; extra_space /= expand_cell_count;
/* iterate list for PACK_START cells */
for (i = cellview->priv->cell_list; i; i = i->next) for (i = cellview->priv->cell_list; i; i = i->next)
{ {
GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data; GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data;
if (info->pack == GTK_PACK_END)
continue;
if (!info->cell->visible) if (!info->cell->visible)
continue; continue;
info->real_width = info->requested_width + (info->expand?extra_space:0); info->real_width = info->requested_width +
} (info->expand ? extra_space : 0);
/* iterate list for PACK_END cells */
for (i = cellview->priv->cell_list; i; i = i->next)
{
GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data;
if (info->pack == GTK_PACK_START)
continue;
if (!info->cell->visible)
continue;
info->real_width = info->requested_width + (info->expand?extra_space:0);
} }
} }