From 68518c1d989ded3031c490fb0b542424aef369cf Mon Sep 17 00:00:00 2001 From: Chris Lahey Date: Fri, 3 Aug 2001 14:43:58 +0000 Subject: p2001-08-03 Christopher James Lahey * e-list-iterator.c (e_list_iterator_next): Made it so that e_list_iterator_next goes to the first element if it's set to NULL. This makes deleting the first element and then doing e_list_iterator_next go to the new first element. Did the analogy for e_list_iterator_prev for completeness and consistency's sakes. Fixes Ximian bug #6057. svn path=/trunk/; revision=11614 --- e-util/ChangeLog | 9 +++++++++ e-util/e-list-iterator.c | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 6306ed2e1a..325e29cb72 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,12 @@ +2001-08-03 Christopher James Lahey + + * e-list-iterator.c (e_list_iterator_next): Made it so that + e_list_iterator_next goes to the first element if it's set to + NULL. This makes deleting the first element and then doing + e_list_iterator_next go to the new first element. Did the analogy + for e_list_iterator_prev for completeness and consistency's sakes. + Fixes Ximian bug #6057. + 2001-08-01 Christopher James Lahey * e-categories-master-list-wombat.c (ecmlw_load): Fixed the load diff --git a/e-util/e-list-iterator.c b/e-util/e-list-iterator.c index 1a3554b070..64f7c299f3 100644 --- a/e-util/e-list-iterator.c +++ b/e-util/e-list-iterator.c @@ -156,6 +156,8 @@ e_list_iterator_next (EIterator *_iterator) EListIterator *iterator = E_LIST_ITERATOR(_iterator); if (iterator->iterator) iterator->iterator = g_list_next(iterator->iterator); + else + iterator->iterator = iterator->list->list; return (iterator->iterator != NULL); } @@ -165,6 +167,8 @@ e_list_iterator_prev (EIterator *_iterator) EListIterator *iterator = E_LIST_ITERATOR(_iterator); if (iterator->iterator) iterator->iterator = g_list_previous(iterator->iterator); + else + iterator->iterator = g_list_last(iterator->list->list); return (iterator->iterator != NULL); } -- cgit v1.2.3