Details

[Home]

Issue of the Implementation # S0574

Brief

atk_state_set_or_sets returns an empty set rather than NULL

Detailed Description

atk_state_set_or_sets returns an empty set when called for empty sets.

The standard requires that atk_state_set_or_sets returns NULL if the union of the sets is empty.

Unlike this function, atk_state_set_and_sets and atk_state_set_xor_sets return NULL when result is empty set.

Problem location(s) in the standard

ATK 1.9.0 Reference Manual, AtkStateSet

Possible solutions

It is required to implement atk_state_set_or_sets by analogy with atk_state_set_and_sets and atk_state_set_xor_sets:

--- atk-1.19.6/atk/atkstateset.c
+++ atk-1.19.6/atk/atkstateset.c
@@ -308,8 +308,11 @@
 
   state = real_set->state | real_compare_set->state;
 
-  return_set = atk_state_set_new();
-  ((AtkRealStateSet *) return_set)->state = state;
+  if (state)
+  {
+    return_set = atk_state_set_new();
+    ((AtkRealStateSet *) return_set)->state = state;
+  }
 
   return return_set;
 }

Component

gtk-atk 1.9.0 or later

Accepted

Gnome Bugzilla 478595

Status

Fixed in ATK 1.25.2 for GNOME 2.25.2.

[Home]