Do not overwrite text attributes with the default ones
authorJacobo Aragunde Pérez <jaragunde@igalia.com>
Thu, 19 Jun 2014 15:27:51 +0000 (17:27 +0200)
committerMike Gorse <mgorse@suse.com>
Fri, 20 Jun 2014 17:54:27 +0000 (12:54 -0500)
As it was implemented, the default attributes are appended to the end
of the list, and later in time only the last occurence of every
attribute will be preserved.

Just changing the order of the list fixes this bug.

https://bugzilla.gnome.org/show_bug.cgi?id=731980

atk-adaptor/adaptors/text-adaptor.c

index be1034972ad2aa56ae1fa7ea6810f16942bb1e61..e80daf8159081458cfca0982c70dda35b0fe5565 100644 (file)
@@ -799,16 +799,17 @@ impl_GetAttributeRun (DBusConnection * bus, DBusMessage * message,
       return droute_invalid_arguments_error (message);
     }
 
-  attributes =
-    atk_text_get_run_attributes (text, offset, &intstart_offset,
-                                 &intend_offset);
-
   if (includeDefaults)
     {
       attributes = g_slist_concat (attributes,
                                    atk_text_get_default_attributes (text));
     }
 
+  attributes = g_slist_concat (attributes,
+                               atk_text_get_run_attributes (text, offset,
+                                                            &intstart_offset,
+                                                            &intend_offset));
+
   reply = dbus_message_new_method_return (message);
   if (!reply)
     return NULL;