From 0e01b294facae9991facf2d8cc01a97d0037065f Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Mon, 24 Mar 2003 19:12:18 +0000 Subject: properly parse nodes that include whitespace. bug #39896 2003-03-24 Mike Kestner * e-table-sort-info.c (e_table_sort_info_load_from_node): properly parse nodes that include whitespace. bug #39896 svn path=/trunk/; revision=20486 --- widgets/table/e-table-sort-info.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'widgets/table/e-table-sort-info.c') diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c index 991222d8ff..c25acf6d0a 100644 --- a/widgets/table/e-table-sort-info.c +++ b/widgets/table/e-table-sort-info.c @@ -380,23 +380,26 @@ e_table_sort_info_load_from_node (ETableSortInfo *info, e_table_sort_info_sorting_set_nth(info, i++, column); } } else { - i = 0; - for (grouping = node->xmlChildrenNode; grouping && !strcmp (grouping->name, "group"); grouping = grouping->next) { + for (grouping = node->children; grouping; grouping = grouping->next) { ETableSortColumn column; - column.column = e_xml_get_integer_prop_by_name (grouping, "column"); - column.ascending = e_xml_get_bool_prop_by_name (grouping, "ascending"); - e_table_sort_info_grouping_set_nth(info, i++, column); - } - i = 0; - for (; grouping && !strcmp (grouping->name, "leaf"); grouping = grouping->next) { - ETableSortColumn column; - column.column = e_xml_get_integer_prop_by_name (grouping, "column"); - column.ascending = e_xml_get_bool_prop_by_name (grouping, "ascending"); - e_table_sort_info_sorting_set_nth(info, i++, column); + gint gcnt = 0; + gint scnt = 0; + + if (grouping->type != XML_ELEMENT_NODE) + continue; + + if (!strcmp (grouping->name, "group")) { + column.column = e_xml_get_integer_prop_by_name (grouping, "column"); + column.ascending = e_xml_get_bool_prop_by_name (grouping, "ascending"); + e_table_sort_info_grouping_set_nth(info, gcnt++, column); + } else if (!strcmp (grouping->name, "leaf")) { + column.column = e_xml_get_integer_prop_by_name (grouping, "column"); + column.ascending = e_xml_get_bool_prop_by_name (grouping, "ascending"); + e_table_sort_info_sorting_set_nth(info, scnt++, column); + } } } g_signal_emit (G_OBJECT (info), e_table_sort_info_signals [SORT_INFO_CHANGED], 0); - } /** -- cgit