diff options
author | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-12-13 15:37:12 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-12-13 15:37:12 +0900 |
commit | 41cd9d139412c0d7077c9432431b6c42a0209756 (patch) | |
tree | 2d791c178ad4a5eba720cf0d2e69c9c0189e7567 /gtk/gtkcellareaboxcontext.c | |
parent | d743ecf82e8ca7198d3b6d8a569764e8ee003238 (diff) | |
download | gtk+-41cd9d139412c0d7077c9432431b6c42a0209756.tar.gz |
Fixed gtk_cell_area_box_context_copy() to also copy it's allocations.
Diffstat (limited to 'gtk/gtkcellareaboxcontext.c')
-rw-r--r-- | gtk/gtkcellareaboxcontext.c | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/gtk/gtkcellareaboxcontext.c b/gtk/gtkcellareaboxcontext.c index fbf6ffea1d..fe61b45e0f 100644 --- a/gtk/gtkcellareaboxcontext.c +++ b/gtk/gtkcellareaboxcontext.c @@ -527,27 +527,37 @@ for_size_copy (gpointer key, GtkCellAreaBoxContext * gtk_cell_area_box_context_copy (GtkCellAreaBox *box, - GtkCellAreaBoxContext *box_context) + GtkCellAreaBoxContext *context) { - GtkCellAreaBoxContext *context; - - context = g_object_new (GTK_TYPE_CELL_AREA_BOX_CONTEXT, - "area", box, NULL); - - gtk_cell_area_box_init_groups (context, - box_context->priv->base_widths->len, - box_context->priv->expand); - - /* Copy all the arrays */ - copy_size_array (box_context->priv->base_widths, - context->priv->base_widths); - copy_size_array (box_context->priv->base_heights, - context->priv->base_heights); - - g_hash_table_foreach (box_context->priv->heights, - (GHFunc)for_size_copy, context->priv->heights); - g_hash_table_foreach (box_context->priv->widths, - (GHFunc)for_size_copy, context->priv->widths); + GtkCellAreaBoxContext *copy; + + copy = g_object_new (GTK_TYPE_CELL_AREA_BOX_CONTEXT, + "area", box, NULL); + + gtk_cell_area_box_init_groups (copy, + context->priv->base_widths->len, + context->priv->expand); + + /* Copy the base arrays */ + copy_size_array (context->priv->base_widths, + copy->priv->base_widths); + copy_size_array (context->priv->base_heights, + copy->priv->base_heights); + + /* Copy each for size */ + g_hash_table_foreach (context->priv->heights, + (GHFunc)for_size_copy, copy->priv->heights); + g_hash_table_foreach (context->priv->widths, + (GHFunc)for_size_copy, copy->priv->widths); + + /* Copy any active allocation */ + copy->priv->n_orientation_allocs = + context->priv->n_orientation_allocs; + + if (copy->priv->n_orientation_allocs) + copy->priv->orientation_allocs = + g_memdup (context->priv->orientation_allocs, + copy->priv->n_orientation_allocs * sizeof (GtkCellAreaBoxAllocation)); return context; } |