[g-a-devel]Acute at-spi relation-set breakage ...
- From: Michael Meeks <michael ximian com>
- To: Bill Haneman <bill haneman sun com>
- Cc: accessibility mailing list <gnome-accessibility-devel gnome org>
- Subject: [g-a-devel]Acute at-spi relation-set breakage ...
- Date: 18 Apr 2002 01:11:23 +0100
Presumably no AT could possibly have ever used this API ?
May I commit ? stock complaint about the pain of needing approval to
fix such acute brokenness,
Regards,
Michael.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/at-spi/ChangeLog,v
retrieving revision 1.190
diff -u -p -u -r1.190 ChangeLog
--- ChangeLog 17 Apr 2002 22:15:06 -0000 1.190
+++ ChangeLog 17 Apr 2002 23:08:52 -0000
@@ -1,5 +1,8 @@
2002-04-18 Michael Meeks <michael ximian com>
+ * libspi/relation.c (impl_getNTargets): impl.
+ (impl_getTarget): impl.
+
* libspi/Makefile.am: fix stateset install.
2002-04-17 Bill Haneman <bill haneman sun com>
Index: libspi/relation.c
===================================================================
RCS file: /cvs/gnome/at-spi/libspi/relation.c,v
retrieving revision 1.7
diff -u -p -u -r1.7 relation.c
--- libspi/relation.c 2 Jan 2002 19:53:20 -0000 1.7
+++ libspi/relation.c 17 Apr 2002 23:08:53 -0000
@@ -24,6 +24,7 @@
#include <config.h>
#include <stdio.h>
+#include <libspi/accessible.h>
#include <libspi/relation.h>
@@ -83,21 +84,21 @@ impl_getRelationType (PortableServer_Ser
AtkRelation *relation = get_relation_from_servant (servant);
AtkRelationType type;
- g_return_val_if_fail (relation, 0);
+ g_return_val_if_fail (relation != NULL, 0);
type = atk_relation_get_relation_type (relation);
return spi_relation_type_from_atk_relation_type (type);
}
-
static CORBA_short
impl_getNTargets (PortableServer_Servant servant,
CORBA_Environment * ev)
{
AtkRelation *relation = get_relation_from_servant(servant);
- g_return_val_if_fail (relation, 0);
-}
+ g_return_val_if_fail (relation != NULL, 0);
+ return relation->target ? relation->target->len : 0;
+}
static CORBA_Object
@@ -105,10 +106,21 @@ impl_getTarget (PortableServer_Servant s
const CORBA_short index,
CORBA_Environment * ev)
{
+ AtkObject *atk_object;
AtkRelation *relation = get_relation_from_servant (servant);
g_return_val_if_fail (relation, NULL);
-}
+ if (!relation->target ||
+ index < 0 ||
+ index >= relation->target->len)
+ return CORBA_OBJECT_NIL;
+
+ atk_object = g_ptr_array_index (relation->target, index);
+ if (!atk_object)
+ return CORBA_OBJECT_NIL;
+
+ return spi_accessible_new_return (atk_object, FALSE, ev);
+}
SpiRelation *
--
mmeeks gnu org <><, Pseudo Engineer, itinerant idiot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]