[g-a-devel]Re: a more substantial bug report ...



Hi Bill,

	Thanks for working this through with me,

	May I commit ?

		Michael.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libgail-gnome/ChangeLog,v
retrieving revision 1.12
diff -u -p -u -r1.12 ChangeLog
--- ChangeLog	13 Mar 2002 22:45:35 -0000	1.12
+++ ChangeLog	14 Mar 2002 12:03:32 -0000
@@ -1,3 +1,23 @@
+2002-03-14  Michael Meeks  <michael ximian com>
+
+	* gail-gnome/bonobo-control-accessible.c
+	(bonobo_control_accessible_new): add IS_REMOTE_OBJECT
+	assertion.
+
+	* gail-gnome/bonobo-control-frame-accessible.c
+	(bonobo_control_frame_accessible_new): ditto.
+
+	* test/test-gail-gnome.c (main): upd. init.
+
+2002-03-13  Michael Meeks  <michael ximian com>
+
+	* gail-gnome/bonobo_socket_atk_object.c
+	(bonobo_socket_atk_object_get_accessible): handle
+	uninitialized returns correctly.
+
+	* gail-gnome/bonobo_plug_atk_object.c
+	(bonobo_plug_atk_object_get_accessible): ditto.
+
 2002-03-13  Bill Haneman <bill haneman sun com>
 
 	* gail-gnome/bonobo-control-accessible.c
Index: gail-gnome/bonobo-accessibility-init.c
===================================================================
RCS file: /cvs/gnome/libgail-gnome/gail-gnome/bonobo-accessibility-init.c,v
retrieving revision 1.5
diff -u -p -u -r1.5 bonobo-accessibility-init.c
--- gail-gnome/bonobo-accessibility-init.c	13 Mar 2002 15:30:09 -0000	1.5
+++ gail-gnome/bonobo-accessibility-init.c	14 Mar 2002 12:03:32 -0000
@@ -23,6 +23,7 @@
 #include <bonobo/bonobo-plug.h>
 #include <bonobo/bonobo-socket.h>
 #include <bonobo/bonobo-control.h>
+#include <bonobo/bonobo-exception.h>
 #include <bonobo/bonobo-control-frame.h>
 #include <libspi/accessible.h>
 #include "bonobo-control-accessible.h"
@@ -55,7 +56,8 @@ impl_bonobo_control_frame_get_parent_acc
 
   parent = atk_object_get_parent (atko);  
   
-  return BONOBO_OBJREF (spi_accessible_new (parent));  
+  return CORBA_Object_duplicate (
+	  BONOBO_OBJREF (spi_accessible_new (parent)), ev);
 }
 
 static Bonobo_Unknown
@@ -68,7 +70,8 @@ impl_bonobo_control_get_accessible (Port
 
   g_return_val_if_fail (control != NULL, CORBA_OBJECT_NIL);
   
-  return BONOBO_OBJREF (bonobo_control_accessible_new (control));  
+  return CORBA_Object_duplicate (
+	  BONOBO_OBJREF (bonobo_control_accessible_new (control)), ev);
 }
 
 static void
Index: gail-gnome/bonobo-control-accessible.c
===================================================================
RCS file: /cvs/gnome/libgail-gnome/gail-gnome/bonobo-control-accessible.c,v
retrieving revision 1.6
diff -u -p -u -r1.6 bonobo-control-accessible.c
--- gail-gnome/bonobo-control-accessible.c	13 Mar 2002 22:45:37 -0000	1.6
+++ gail-gnome/bonobo-control-accessible.c	14 Mar 2002 12:03:32 -0000
@@ -22,6 +22,7 @@
  */
 
 #include <atk/atk.h>
+#include <libspi/remoteobject.h>
 #include "bonobo-control-accessible.h"
 #include "gail-gnome-debug.h"
 
@@ -76,6 +77,8 @@ bonobo_control_accessible_new (BonoboCon
   g_assert (GTK_IS_PLUG (widget->parent));
 
   atko = gtk_widget_get_accessible (widget->parent);
+
+  g_assert (SPI_IS_REMOTE_OBJECT (atko));
 
   retval = BONOBO_CONTROL_ACCESSIBLE (
 	  spi_accessible_construct (BONOBO_TYPE_CONTROL_ACCESSIBLE, atko));
Index: gail-gnome/bonobo-control-frame-accessible.c
===================================================================
RCS file: /cvs/gnome/libgail-gnome/gail-gnome/bonobo-control-frame-accessible.c,v
retrieving revision 1.4
diff -u -p -u -r1.4 bonobo-control-frame-accessible.c
--- gail-gnome/bonobo-control-frame-accessible.c	13 Mar 2002 22:45:37 -0000	1.4
+++ gail-gnome/bonobo-control-frame-accessible.c	14 Mar 2002 12:03:32 -0000
@@ -22,6 +22,7 @@
  */
 
 #include <atk/atk.h>
+#include <libspi/remoteobject.h>
 #include "bonobo-control-frame-accessible.h"
 #include "gail-gnome-debug.h"
 
@@ -93,10 +94,12 @@ bonobo_control_frame_accessible_new (Bon
   atko = gtk_widget_get_accessible (widget);
   g_assert (atko != NULL);
 
+  g_assert (SPI_IS_REMOTE_OBJECT (atko));
+
   retval = BONOBO_CONTROL_FRAME_ACCESSIBLE (
 	  spi_accessible_construct (
 		  BONOBO_TYPE_CONTROL_FRAME_ACCESSIBLE, atko));
-  
+
   retval->control_frame = control_frame;
 
   return retval;
Index: gail-gnome/bonobo_plug_atk_object.c
===================================================================
RCS file: /cvs/gnome/libgail-gnome/gail-gnome/bonobo_plug_atk_object.c,v
retrieving revision 1.6
diff -u -p -u -r1.6 bonobo_plug_atk_object.c
--- gail-gnome/bonobo_plug_atk_object.c	13 Mar 2002 22:45:37 -0000	1.6
+++ gail-gnome/bonobo_plug_atk_object.c	14 Mar 2002 12:03:32 -0000
@@ -20,6 +20,7 @@
 
 #include <libspi/remoteobject.h>
 
+#include <bonobo/bonobo-exception.h>
 #include "bonobo_plug_atk_object.h"
 #include "gail-gnome-debug.h"
 
@@ -43,12 +44,16 @@ bonobo_plug_atk_object_get_accessible (S
 
   g_return_val_if_fail (BONOBO_IS_PLUG_ATK_OBJECT (remote), CORBA_OBJECT_NIL);
 
-  CORBA_exception_init (&env);
+  control = bonobo_plug_atk_object_get_control (BONOBO_PLUG_ATK_OBJECT (remote));
 
   control = bonobo_plug_atk_object_get_control (BONOBO_PLUG_ATK_OBJECT (remote));
   g_return_val_if_fail (BONOBO_IS_CONTROL (control), CORBA_OBJECT_NIL);
   
+  CORBA_exception_init (&env);
+
   retval = Bonobo_Control_getAccessible (BONOBO_OBJREF (control), &env);
+  if (BONOBO_EX (&env))
+	  retval = CORBA_OBJECT_NIL;
 
   CORBA_exception_free (&env);
 
Index: gail-gnome/bonobo_socket_atk_object.c
===================================================================
RCS file: /cvs/gnome/libgail-gnome/gail-gnome/bonobo_socket_atk_object.c,v
retrieving revision 1.6
diff -u -p -u -r1.6 bonobo_socket_atk_object.c
--- gail-gnome/bonobo_socket_atk_object.c	13 Mar 2002 22:45:37 -0000	1.6
+++ gail-gnome/bonobo_socket_atk_object.c	14 Mar 2002 12:03:32 -0000
@@ -20,6 +20,7 @@
 
 #include <libspi/remoteobject.h>
 
+#include <bonobo/bonobo-exception.h>
 #include "bonobo_socket_atk_object.h"
 #include "gail-gnome-debug.h"
 
@@ -44,14 +45,21 @@ bonobo_socket_atk_object_get_accessible 
 
   g_return_val_if_fail (BONOBO_IS_SOCKET_ATK_OBJECT (remote), CORBA_OBJECT_NIL);
 
-  CORBA_exception_init (&env);
+  frame = bonobo_socket_atk_object_get_frame (BONOBO_SOCKET_ATK_OBJECT (remote));
+  control = bonobo_control_frame_get_control (frame);
 
   frame = bonobo_socket_atk_object_get_frame (BONOBO_SOCKET_ATK_OBJECT (remote));
   g_return_val_if_fail (BONOBO_IS_CONTROL_FRAME (frame), CORBA_OBJECT_NIL);
   control = bonobo_control_frame_get_control (frame);
   g_return_val_if_fail (control != CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
+
+  CORBA_exception_init (&env);
+
   retval = Bonobo_Control_getAccessible (control, &env);
   g_return_val_if_fail (retval != CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
+
+  if (BONOBO_EX (&env))
+	  retval = CORBA_OBJECT_NIL;
 
   CORBA_exception_free (&env);
 
Index: test/test-gail-gnome.c
===================================================================
RCS file: /cvs/gnome/libgail-gnome/test/test-gail-gnome.c,v
retrieving revision 1.3
diff -u -p -u -r1.3 test-gail-gnome.c
--- test/test-gail-gnome.c	13 Mar 2002 22:45:39 -0000	1.3
+++ test/test-gail-gnome.c	14 Mar 2002 12:03:33 -0000
@@ -26,6 +26,7 @@
 #include <cspi/spi.h>
 #include <libspi/libspi.h>
 #include <libbonoboui.h>
+#include <libgnomeui/gnome-ui-init.h>
 
 static GtkWidget *inproc_widget = NULL;
 static GtkWidget *outproc_widget = NULL;
@@ -112,6 +113,8 @@ test_gail_gnome (void)
 	test_spi_stuff (BONOBO_WIDGET (outproc_widget));
 #endif
 
+	gtk_main ();
+
 	gtk_widget_destroy (inproc_widget);
 	gtk_widget_destroy (outproc_widget);
 }
@@ -119,15 +122,15 @@ test_gail_gnome (void)
 int
 main (int argc, char **argv)
 {
-	const char *modules;
-	int         leaked;
+	int leaked;
 
-	modules = g_getenv ("GTK_MODULES");
-	if (!modules || modules [0] == '\0')
-		putenv ("GTK_MODULES=gail:gail-gnome:atk-bridge");
-	modules = NULL;
+	putenv ("GTK_MODULES=gail:gail-gnome:atk-bridge");
+	putenv ("GNOME_ACCESSIBILITY=0");
 
-	gtk_init (&argc, &argv);
+	gnome_program_init ("test-gail-gnome",
+			    "0.0.1",
+			    LIBGNOMEUI_MODULE,
+			    argc, argv, NULL);
 
 	SPI_init ();
 

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]