Bug #478583. Do not add the relation if it is already in the relationset.
authorLi Yuan <li.yuan@sun.com>
Fri, 7 Nov 2008 09:26:49 +0000 (09:26 +0000)
committerLi Yuan <liyuan@src.gnome.org>
Fri, 7 Nov 2008 09:26:49 +0000 (09:26 +0000)
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

ChangeLog
atk/atkrelationset.c

index d2818fc..ed37dff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,14 @@
 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.
+
+2008-11-07  Li Yuan  <li.yuan@sun.com>
+
        * atk/atkutil.c: (atk_add_global_event_listener),
        (atk_add_key_event_listener):
+       Bug #480126.
        Change the return value to 0 if failure accroding to doc.
 
 2008-09-22  Li Yuan  <li.yuan@sun.com>
index 7de1d62..3b975b7 100755 (executable)
@@ -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);
 }