diff options
author | Li Yuan <li.yuan@sun.com> | 2008-11-07 09:26:49 +0000 |
---|---|---|
committer | Li Yuan <liyuan@src.gnome.org> | 2008-11-07 09:26:49 +0000 |
commit | eb0bb1c1612041fa46b4c3b28def8447b1689313 (patch) | |
tree | 01f596fda2a5a1f5d7ef6f4fa6bd47d8b3e41fcd /atk/atkrelationset.c | |
parent | b7a56ac7566bccd05b52813945c55ed314995686 (diff) | |
download | atk-eb0bb1c1612041fa46b4c3b28def8447b1689313.tar.gz |
Bug #478583. Do not add the relation if it is already in the relationset.
2008-11-07 Li Yuan <li.yuan@sun.com>
* atk/atkrelationset.c: (atk_relation_set_add):
Bug #478583. Do not add the relation if it is already
in the relationset.
svn path=/trunk/; revision=1295
Diffstat (limited to 'atk/atkrelationset.c')
-rwxr-xr-x | atk/atkrelationset.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/atk/atkrelationset.c b/atk/atkrelationset.c index 7de1d62..3b975b7 100755 --- a/atk/atkrelationset.c +++ b/atk/atkrelationset.c @@ -151,6 +151,8 @@ void atk_relation_set_add (AtkRelationSet *set, AtkRelation *relation) { + AtkRelationType relationship; + g_return_if_fail (ATK_IS_RELATION_SET (set)); g_return_if_fail (relation != NULL); @@ -158,7 +160,11 @@ atk_relation_set_add (AtkRelationSet *set, { set->relations = g_ptr_array_new (); } - g_ptr_array_add (set->relations, relation); + relationship = atk_relation_get_relation_type (relation); + if (!atk_relation_set_contains (set, relationship)) + { + g_ptr_array_add (set->relations, relation); + } g_object_ref (relation); } |