After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 448007 - getSize and getPosition do not set IntHolder values correctly
getSize and getPosition do not set IntHolder values correctly
Status: RESOLVED FIXED
Product: at-spi
Classification: Platform
Component: javabridge
unspecified
Other Linux
: Normal major
: ---
Assigned To: Jeff Cai
Jeff Cai
Depends on:
Blocks: 448011
 
 
Reported: 2007-06-15 20:19 UTC by Lynn Monsanto
Modified: 2007-06-19 11:04 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18



Description Lynn Monsanto 2007-06-15 20:19:58 UTC
The getSize and getPosition methods in impl/org/GNOME/Accessibility/ComponentImpl.java are not implemented correctly. They assign new IntHolder objects to the IntHolder method arguments. They should set the 'value' field in the IntHolder arguments.,

        public void getSize (org.omg.CORBA.IntHolder width, org.omg.CORBA.IntHolder height){
    if (accComponent != null ) {
                        Dimension d = null;
                        try {
                                d = accComponent.getSize();
                        } catch (Exception ex) {
                                d = new Dimension (0, 0);
                        }
                        width = new org.omg.CORBA.IntHolder(d.width);
                        height = new org.omg.CORBA.IntHolder(d.height);
                }
        }

should be changed to:

        public void getSize (org.omg.CORBA.IntHolder width, org.omg.CORBA.IntHolder height){
    if (accComponent != null ) {
                        Dimension d = null;
                        try {
                                d = accComponent.getSize();
                        } catch (Exception ex) {
                                d = new Dimension (0, 0);
                        }
                        width.value = d.width;
                        height.value = d.height;
                }
        }

And

        public void getPosition (org.omg.CORBA.IntHolder x, org.omg.CORBA.IntHolder y, short coord_type) {

                if (accComponent != null ) {
                        Point p = accComponent.getLocationOnScreen();
                        if (coord_type != 0) {
                                Point toplevelp = getToplevelLocationOnScreen();
                                p.x -= toplevelp.x;
                                p.y -= toplevelp.y;
                        }
                        x =  new org.omg.CORBA.IntHolder(p.x);
                        y =  new org.omg.CORBA.IntHolder(p.y);
                }
        }

should be changed to:

        public void getPosition (org.omg.CORBA.IntHolder x, org.omg.CORBA.IntHolder y, short coord_type) {

                if (accComponent != null ) {
                        Point p = accComponent.getLocationOnScreen();
                        if (coord_type != 0) {
                                Point toplevelp = getToplevelLocationOnScreen();
                                p.x -= toplevelp.x;
                                p.y -= toplevelp.y;
                        }
                        x.value =  p.x;
                        y.value =  p.y;
                }
        }
Comment 1 Jeff Cai 2007-06-19 11:04:12 UTC
The patch has been committed to upstream.