Minor code cleanup: use child variable consistently

Preparation for a subsequent patch.

https://bugzilla.gnome.org/show_bug.cgi?id=598462
This commit is contained in:
Colin Walters 2009-10-15 14:25:01 -04:00
parent 51c41aed90
commit 497c74f4d8

View File

@ -436,14 +436,15 @@ get_content_preferred_width (StBoxLayout *self,
for (l = priv->children; l; l = g_list_next (l)) for (l = priv->children; l; l = g_list_next (l))
{ {
ClutterActor *child = l->data;
gfloat child_min = 0, child_nat = 0; gfloat child_min = 0, child_nat = 0;
if (!CLUTTER_ACTOR_IS_VISIBLE ((ClutterActor*) l->data)) if (!CLUTTER_ACTOR_IS_VISIBLE (child))
continue; continue;
n_children++; n_children++;
clutter_actor_get_preferred_width ((ClutterActor*) l->data, clutter_actor_get_preferred_width (child,
(!priv->is_vertical) ? for_height : -1, (!priv->is_vertical) ? for_height : -1,
&child_min, &child_min,
&child_nat); &child_nat);
@ -506,14 +507,15 @@ get_content_preferred_height (StBoxLayout *self,
for (l = priv->children; l; l = g_list_next (l)) for (l = priv->children; l; l = g_list_next (l))
{ {
ClutterActor *child = l->data;
gfloat child_min = 0, child_nat = 0; gfloat child_min = 0, child_nat = 0;
if (!CLUTTER_ACTOR_IS_VISIBLE ((ClutterActor*) l->data)) if (!CLUTTER_ACTOR_IS_VISIBLE (child))
continue; continue;
n_children++; n_children++;
clutter_actor_get_preferred_height ((ClutterActor*) l->data, clutter_actor_get_preferred_height (child,
(priv->is_vertical) ? for_width : -1, (priv->is_vertical) ? for_width : -1,
&child_min, &child_min,
&child_nat); &child_nat);
@ -606,17 +608,18 @@ compute_shrinks (StBoxLayout *self,
int n_visible_children = 0; int n_visible_children = 0;
for (l = priv->children, i = 0; l; l = l->next, i++) for (l = priv->children, i = 0; l; l = l->next, i++)
{ {
ClutterActor *child = l->data;
gfloat child_min, child_nat; gfloat child_min, child_nat;
shrinks[i].child_index = i; shrinks[i].child_index = i;
if (CLUTTER_ACTOR_IS_VISIBLE (l->data)) if (CLUTTER_ACTOR_IS_VISIBLE (child))
{ {
if (priv->is_vertical) if (priv->is_vertical)
clutter_actor_get_preferred_height ((ClutterActor*) l->data, clutter_actor_get_preferred_height (child,
for_length, for_length,
&child_min, &child_nat); &child_min, &child_nat);
else else
clutter_actor_get_preferred_width ((ClutterActor*) l->data, clutter_actor_get_preferred_width (child,
for_length, for_length,
&child_min, &child_nat); &child_min, &child_nat);
@ -760,13 +763,14 @@ st_box_layout_allocate (ClutterActor *actor,
n_expand_children = 0; n_expand_children = 0;
for (l = priv->children; l; l = l->next) for (l = priv->children; l; l = l->next)
{ {
ClutterActor *child = l->data;
gboolean expand; gboolean expand;
if (!CLUTTER_ACTOR_IS_VISIBLE (l->data)) if (!CLUTTER_ACTOR_IS_VISIBLE (child))
continue; continue;
clutter_container_child_get ((ClutterContainer *) actor, clutter_container_child_get ((ClutterContainer *) actor,
(ClutterActor*) l->data, child,
"expand", &expand, "expand", &expand,
NULL); NULL);
if (expand) if (expand)