diff options
author | Mike Kestner <mkestner@ximian.com> | 2003-03-25 03:12:18 +0800 |
---|---|---|
committer | Mike Kestner <mkestner@src.gnome.org> | 2003-03-25 03:12:18 +0800 |
commit | 0e01b294facae9991facf2d8cc01a97d0037065f (patch) | |
tree | 2f7b7178e93e80a11d03083176e176d59bd4c527 | |
parent | c58ffb001cd64c3edb276d87ba0af34ce4120f7f (diff) | |
download | gsoc2013-evolution-0e01b294facae9991facf2d8cc01a97d0037065f.tar.gz gsoc2013-evolution-0e01b294facae9991facf2d8cc01a97d0037065f.tar.zst gsoc2013-evolution-0e01b294facae9991facf2d8cc01a97d0037065f.zip |
properly parse nodes that include whitespace. bug #39896
2003-03-24 Mike Kestner <mkestner@ximian.com>
* 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
-rw-r--r-- | widgets/table/e-table-sort-info.c | 29 |
1 files changed, 16 insertions, 13 deletions
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); - } /** |