From 613453b1095e325149b8d37e5731d415e1d5f9bd Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Thu, 31 Oct 2002 21:30:57 +0000 Subject: merging the gal-2 branch back to the trunk. merging the gal-2 branch back to the trunk. svn path=/trunk/; revision=18471 --- widgets/table/e-table-specification.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'widgets/table/e-table-specification.c') diff --git a/widgets/table/e-table-specification.c b/widgets/table/e-table-specification.c index 7395ce60aa..6d8653b6d6 100644 --- a/widgets/table/e-table-specification.c +++ b/widgets/table/e-table-specification.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-specification.c * Copyright 2000, 2001, Ximian, Inc. * @@ -31,8 +31,8 @@ #include #include -#include -#include +#include +#include #include "gal/util/e-util.h" #include "gal/util/e-xml-utils.h" @@ -51,17 +51,17 @@ etsp_destroy (GtkObject *object) gtk_object_unref (GTK_OBJECT (etsp->columns[i])); } g_free (etsp->columns); + etsp->columns = NULL; } if (etsp->state) gtk_object_unref (GTK_OBJECT (etsp->state)); + etsp->state = NULL; + g_free (etsp->click_to_add_message); + etsp->click_to_add_message = NULL; g_free (etsp->domain); - - etsp->columns = NULL; - etsp->state = NULL; - etsp->click_to_add_message = NULL; etsp->domain = NULL; GTK_OBJECT_CLASS (etsp_parent_class)->destroy (object); @@ -251,6 +251,8 @@ e_table_specification_load_from_node (ETableSpecification *specification, if (!strcmp (children->name, "ETableColumn")) { ETableColumnSpecification *col_spec = e_table_column_specification_new (); + gtk_object_ref (GTK_OBJECT (col_spec)); + gtk_object_sink (GTK_OBJECT (col_spec)); e_table_column_specification_load_from_node (col_spec, children); list = g_list_append (list, col_spec); } else if (specification->state == NULL && !strcmp (children->name, "ETableState")) { @@ -260,6 +262,11 @@ e_table_specification_load_from_node (ETableSpecification *specification, } } + if (specification->state == NULL) { + /* Make the default state. */ + specification->state = e_table_state_vanilla (g_list_length (list)); + } + specification->columns = g_new (ETableColumnSpecification *, g_list_length (list) + 1); for (list2 = list, i = 0; list2; list2 = g_list_next (list2), i++) { specification->columns[i] = list2->data; @@ -293,7 +300,7 @@ e_table_specification_save_to_file (ETableSpecification *specification, xmlDocSetRootElement (doc, e_table_specification_save_to_node (specification, doc)); - ret = e_xml_save_file (filename, doc); + ret = xmlSaveFile (filename, doc); xmlFreeDoc (doc); -- cgit