From c1c5688c54f8da7ee968f59132cc1878d0138f89 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 16 Jan 2001 20:45:56 +0000 Subject: Added a bit of documentation. (config_sort_config_show, 2001-01-16 Christopher James Lahey * e-table-config.c: Added a bit of documentation. (config_sort_config_show, config_group_config_show): gnome_dialog_set_parent on the config->dialog_toplevel instead of the config. * e-table-specification: Pass "1.0" instead of NULL to xmlNewDoc here. * e-table-state.c, e-table-state.h: Pass "1.0" instead of NULL to xmlNewDoc here. Make sure that sort_info is never NULL if this object exists. Added ETableStateDuplicate. svn path=/trunk/; revision=7542 --- widgets/table/e-table-state.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'widgets/table/e-table-state.c') diff --git a/widgets/table/e-table-state.c b/widgets/table/e-table-state.c index 91f1178a33..c9049b7a18 100644 --- a/widgets/table/e-table-state.c +++ b/widgets/table/e-table-state.c @@ -46,6 +46,7 @@ etst_init (ETableState *state) { state->columns = NULL; state->expansions = NULL; + state->sort_info = e_table_sort_info_new(); } E_MAKE_TYPE(e_table_state, "ETableState", ETableState, etst_class_init, etst_init, PARENT_TYPE); @@ -152,7 +153,7 @@ e_table_state_save_to_string (ETableState *state) int length; xmlDoc *doc; - doc = xmlNewDoc(NULL); + doc = xmlNewDoc("1.0"); xmlDocSetRootElement(doc, e_table_state_save_to_node(state, NULL)); xmlDocDumpMemory(doc, &string, &length); xmlFreeDoc(doc); @@ -192,3 +193,23 @@ e_table_state_save_to_node (ETableState *state, return node; } + +/** + * e_table_state_duplicate: + * @state: state to duplicate + * + * This creates a copy of the %ETableState @state + * + * Returns: The duplicated %ETableState. + */ +ETableState * +e_table_state_duplicate (ETableState *state) +{ + ETableState *new_state = e_table_state_new (); + char *state_str = e_table_state_save_to_string (state); + + printf ("This is the state: \n%s\n", state_str); + e_table_state_load_from_string (new_state, state_str); + + return new_state; +} -- cgit