GNOME Bugzilla – Bug 448007
getSize and getPosition do not set IntHolder values correctly
Last modified: 2007-06-19 11:04:30 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; } }
The patch has been committed to upstream.