2003-08-13 Padraig O'Briain <padraig.obriain@sun.com>
[platform/core/uifw/at-spi2-atk.git] / libspi / table.c
index d0df142..75d3cec 100644 (file)
@@ -2,7 +2,8 @@
  * AT-SPI - Assistive Technology Service Provider Interface
  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
  *
- * Copyright 2001 Sun Microsystems Inc.
+ * 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
@@ -90,7 +91,7 @@ impl__get_nRows (PortableServer_Servant servant,
 
   g_return_val_if_fail (table != NULL, 0);
 
-  return (CORBA_long) atk_table_get_n_rows (table);
+  return atk_table_get_n_rows (table);
 }
 
 
@@ -102,7 +103,7 @@ impl__get_nColumns (PortableServer_Servant servant,
 
   g_return_val_if_fail (table != NULL, 0);
 
-  return (CORBA_long) atk_table_get_n_columns (table);
+  return atk_table_get_n_columns (table);
 }
 
 
@@ -285,15 +286,15 @@ impl_getSelectedRows (PortableServer_Servant servant,
   bonobo_return_val_if_fail (length > 0, NULL, ev);
 
   retval = Accessibility_LongSeq__alloc ();
-  retval->_maximum = retval->_length = (CORBA_long) length;
+  retval->_maximum = retval->_length = length;
   retval->_buffer = Accessibility_LongSeq_allocbuf (length);
 
-  while (--length)
+  while (--length >= 0)
     {
-      retval->_buffer[length] = (CORBA_long) selectedRows[length];
+      retval->_buffer[length] = selectedRows[length];
     }
 
-  g_free ((gpointer) selectedRows);
+  g_free (selectedRows);
 
   return retval;
 }
@@ -315,15 +316,15 @@ impl_getSelectedColumns (PortableServer_Servant servant,
   bonobo_return_val_if_fail (length >= 0, NULL, ev);
 
   retval = Accessibility_LongSeq__alloc ();
-  retval->_maximum = retval->_length = (CORBA_long) length;
+  retval->_maximum = retval->_length = length;
   retval->_buffer = Accessibility_LongSeq_allocbuf (length);
 
-  while (--length)
+  while (--length >= 0)
     {
       retval->_buffer[length] = (CORBA_long) selectedColumns[length];
     }
 
-  g_free ((gpointer) selectedColumns);
+  g_free (selectedColumns);
 
   return retval;
 }
@@ -461,4 +462,4 @@ spi_table_init (SpiTable *table)
 BONOBO_TYPE_FUNC_FULL (SpiTable,
                       Accessibility_Table,
                       SPI_TYPE_BASE,
-                      spi_table);
+                      spi_table)