Details
        
                          [Home]
Issue of the Implementation # S0572
Brief
Incorrect registration of the "start-index" property for AtkHyperlink
Detailed Description
The "start-index" property of AtkHyperlink is not registered correctly: PROP_END_INDEX identifier is used instead of PROP_START_INDEX. So if one tries to get the value of the property, the value of the "end-index" property will be returned instead.
Problem location(s) in the standard
ATK 1.9.0 Reference Manual, AtkHyperlink
Example
//Object MyAtkHyperlink, which derives from AtkHyperlink
//and implements its interfaces
guint my_atk_hyperlink_get_start_index(AtkHyperlink* link_)
{
    return 10;
}
guint my_atk_hyperlink_get_end_index(AtkHyperlink* link_)
{
    return 20;
}
//...
int main()
{
    AtkHyperlink* link = g_object_new(MY_TYPE_ATK_HYPERLINK, NULL);
    gint start_index = 0;
    g_object_get(link, "start-index", &start_index, NULL);
    //now start_index is 20, but should be 10
    return 0;
}
                    Possible solutions
It is required to fix installation of the "start-index" property in the atk_hyperlink_class_init() function:
--- atk-1.18.0/atk/atkhyperlink.c
+++ atk-1.18.0-fixed/atk/atkhyperlink.c
@@ -126,7 +126,7 @@
  g_object_class_install_property (gobject_class,
-                                   PROP_END_INDEX,
+                                   PROP_START_INDEX,
                                   g_param_spec_int ("start-index",
                                                     _("Start index"),
                                                     _("The start index of the AtkHyperlink object"),
                                                     0,
                                                     G_MAXINT,
                                                     0,
                                                     G_PARAM_READABLE));
                    Component
gtk-atk 1.9.0 or later
Accepted
Gnome Bugzilla 477763
Status
Fixed in ATK 1.21.5 for GNOME 2.21.5.
[Home]
»