aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'e-util/e-tree.c')
-rw-r--r--e-util/e-tree.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/e-util/e-tree.c b/e-util/e-tree.c
index a8ccefcb5d..e6dc943b34 100644
--- a/e-util/e-tree.c
+++ b/e-util/e-tree.c
@@ -1382,30 +1382,40 @@ ETableState *
e_tree_get_state_object (ETree *tree)
{
ETableState *state;
+ GPtrArray *columns;
gint full_col_count;
gint i, j;
+ columns = e_table_specification_ref_columns (tree->priv->spec);
+
state = e_table_state_new (tree->priv->spec);
- state->sort_info = tree->priv->sort_info;
- if (state->sort_info)
- g_object_ref (state->sort_info);
+
+ g_clear_object (&state->sort_info);
+ if (tree->priv->sort_info != NULL)
+ state->sort_info = g_object_ref (tree->priv->sort_info);
state->col_count = e_table_header_count (tree->priv->header);
full_col_count = e_table_header_count (tree->priv->full_header);
- state->columns = g_new (int, state->col_count);
- state->expansions = g_new (double, state->col_count);
+
+ state->column_specs = g_new (
+ ETableColumnSpecification *, state->col_count);
+ state->expansions = g_new (gdouble, state->col_count);
+
for (i = 0; i < state->col_count; i++) {
ETableCol *col = e_table_header_get_column (tree->priv->header, i);
- state->columns[i] = -1;
+ state->column_specs[i] = NULL;
for (j = 0; j < full_col_count; j++) {
if (col->spec->model_col == e_table_header_index (tree->priv->full_header, j)) {
- state->columns[i] = j;
+ state->column_specs[i] =
+ g_object_ref (columns->pdata[j]);
break;
}
}
state->expansions[i] = col->expansion;
}
+ g_ptr_array_unref (columns);
+
return state;
}