GNOME Bugzilla – Bug 478595
atk_state_set_or_sets returns an empty set rather than NULL
Last modified: 2008-11-11 07:23:05 UTC
atk_state_set_or_sets returns an empty set when called for empty sets. The documentation requires that atk_state_set_or_sets returns NULL if the union of the sets is empty. The detailed bug description can be found at: http://linuxtesting.org/results/report?num=S0574
The function will return NULL if anyone of the stateset is NULL. And if AtkState is 0, it means ATK_STATE_INVALID, not empty.
> And if AtkState is 0, it means ATK_STATE_INVALID, not empty. I mean atk_state_set_new(), which, according to the documentation, creates empty stateset. This stateset is really empty, because atk_state_set_and_sets() returns NULL, if its both arguments are atk_state_set_new(). But for the same arguments atk_state_set_or_sets() returns not NULL, that is strange.
Right, I will see what to do.
Created attachment 122316 [details] [review] patch
2008-11-10 Li Yuan <li.yuan@sun.com> * atk/atkobject.c: (atk_object_remove_relationship): Bug #477708. Only remove the target, not the relation if there are still are targets. * atk/atkrelation.c: (atk_relation_remove_target): * atk/atkrelation.h: New API. * atk/atkrelationset.c: (atk_relation_set_add), (atk_relation_set_remove): Add/remove the new relation's targets to/from the existed relation if there has been a relation with the same type. * atk/atkstateset.c: (atk_state_set_or_sets): Bug #478595. Return NULL if sets are empty.