GNOME Bugzilla – Bug 477708
atk_object_remove_relationship can remove more relationships than it should
Last modified: 2008-11-11 07:22:42 UTC
There can be errors if the relationships between objects are processed with both atk_object_add_relationship()/atk_object_remove_relationship(), atk_object_ref_relation_set() and then some function from AtkRelationSet. Example: relation_set = atk_object_ref_relation_set(obj); atk_object_add_relationship(obj, type, target1); atk_relation_set_add_relation_by_type(relation_set, type, target2); atk_object_remove_relationship(obj, type, target1); The <type,target1> relationship will be removed in this case but <type,target2> will be removed too, while it should not. The detailed bug description can be found at: http://linuxtesting.org/results/report?num=S0568
Created attachment 122315 [details] [review] patch
As I understand, after the patch there is no way to create AtkRelationSet with duplicating relation types? That's good. According to code, all seems to be correct. Is it intended to describe atk_relation_remove_target in the documentation?
Yes for both of your question :) 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.