Fix for bug #372172. - (Text.getAttributeRun was broken)
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Mon, 11 Dec 2006 22:03:54 +0000 (22:03 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Mon, 11 Dec 2006 22:03:54 +0000 (22:03 +0000)
git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@867 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
libspi/text.c

index e0d8b6d..4ca030c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-12-11 Bill Haneman <bill.haneman@sun.com>
+
+       * libspi/text.c:
+       (impl_getAttributeRun):Return an empty CORBA_seq instead of NULL,
+       if there are no non-default attributes defined at the current offset.
+       Fixes bug #372172.
+
 2006-12-04  Bill Haneman <bill.haneman@sun.com>
 
        * idl/Accessibility_Role.idl: Fixed the documentation for
index 88fcf02..5ac245d 100644 (file)
@@ -551,6 +551,7 @@ impl_getAttributeRun (PortableServer_Servant servant,
                                               &intstart_offset, &intend_offset);
 
      if (attributes) total_attributes = n_attributes = g_slist_length (attributes);
+
      if (includeDefaults)
      {
         default_attributes = atk_text_get_default_attributes (text);
@@ -562,13 +563,13 @@ impl_getAttributeRun (PortableServer_Servant servant,
      *startOffset = intstart_offset;
      *endOffset = intend_offset; 
 
+     retval = CORBA_sequence_CORBA_string__alloc ();
+     retval->_length = retval->_maximum = total_attributes;
+     retval->_buffer = CORBA_sequence_CORBA_string_allocbuf (total_attributes);
+     CORBA_sequence_set_release (retval, CORBA_TRUE);
+
      if (total_attributes)
-     {
-        retval = CORBA_sequence_CORBA_string__alloc ();
-        retval->_length = retval->_maximum = total_attributes;
-        retval->_buffer = CORBA_sequence_CORBA_string_allocbuf (total_attributes);
-        CORBA_sequence_set_release (retval, CORBA_TRUE);
-        
+     {  
         for (i = 0; i < n_attributes; ++i)
         {
             attr = g_slist_nth_data (attributes, i);