Revved to 1.7.4; Fixes for cspi event handlers for EventDetails.
[platform/core/uifw/at-spi2-atk.git] / libspi / hyperlink.c
index ef41984..2a504af 100644 (file)
@@ -26,6 +26,7 @@
 #include <config.h>
 #include <stdio.h>
 #include <libspi/hyperlink.h>
+#include <libspi/action.h>
 #include <libspi/accessible.h>
 
 /* Static function declarations */
@@ -97,8 +98,19 @@ spi_hyperlink_new (AtkHyperlink *object)
    */
   if (ATK_IS_ACTION (object))
     {
+      /* 
+       * NOTE: we don't cast 'object' to ATK_OBJECT in the call to 
+       * spi_action_interface_new(), because of the above convention, 
+       * even though it means we may be violating the func prototype.
+       * See discussion in bugzilla bug #120659.
+       * !!!
+       * IMPORTANT! The 'AtkObject' typecast, instead of the cast macro,
+       * is used below, because 'object' may NOT really be an AtkObject;
+       * it will be cast back to a G_OBJECT inside spi_action_interface_new
+       * before use, so this is OK though very ropey coding style.
+       */
       bonobo_object_add_interface (bonobo_object (new_hyperlink),
-                                  BONOBO_OBJECT (spi_action_interface_new (object)));
+                                  BONOBO_OBJECT (spi_action_interface_new ((AtkObject *) object)));
     }
   return new_hyperlink;
 }