Add atk-bridge
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_hypertext.c
index e9be198..35a64af 100644 (file)
@@ -1,3 +1,26 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001, 2002 Sun Microsystems Inc.,
+ * Copyright 2001, 2002 Ximian, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
 #include <cspi/spi-private.h>
 
 /**
@@ -51,7 +74,7 @@ AccessibleHypertext_getNLinks (AccessibleHypertext *obj)
   retval =
     Accessibility_Hypertext_getNLinks (CSPI_OBJREF (obj), cspi_ev ());
 
-  cspi_return_val_if_ex ("getNLinks", -1);
+  cspi_return_val_if_ev ("getNLinks", -1);
 
   return retval;
 }
@@ -69,11 +92,18 @@ AccessibleHyperlink *
 AccessibleHypertext_getLink (AccessibleHypertext *obj,
                              long int             linkIndex)
 {
-  cspi_return_val_if_fail (obj != NULL, FALSE);
+  AccessibleHyperlink *retval;
+       
+  cspi_return_val_if_fail (obj != NULL, NULL);
 
-  return cspi_object_new (
+  retval = cspi_object_add (
     Accessibility_Hypertext_getLink (CSPI_OBJREF (obj),
-                                    (CORBA_long) linkIndex, cspi_ev ()));
+                                    linkIndex,
+                                    cspi_ev ()));
+  
+  cspi_return_val_if_ev ("getLink", NULL); 
+
+  return retval;
 }
 
 /**
@@ -98,10 +128,10 @@ AccessibleHypertext_getLinkIndex (AccessibleHypertext *obj,
 
   retval = 
     Accessibility_Hypertext_getLinkIndex (CSPI_OBJREF (obj),
-                                         (CORBA_long) characterOffset,
+                                         characterOffset,
                                          cspi_ev ());
 
-  cspi_return_val_if_ex ("getLinkIndex", -1);
+  cspi_return_val_if_ev ("getLinkIndex", -1);
 
   return retval;
 }