### Eclipse Workspace Patch 1.0 #P org.eclipse.swt Index: Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java,v retrieving revision 1.98 diff -u -r1.98 Accessible.java --- Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java 12 May 2010 15:35:15 -0000 1.98 +++ Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java 13 May 2010 16:50:42 -0000 @@ -1751,8 +1751,9 @@ VARIANT v = getVARIANT(pvarChild); if (v.vt == COM.VT_I4) osChild = v.lVal; else if (v.vt == COM.VT_DISPATCH) { - osChildObject = v.lVal; // TODO: don't use struct. lVal is an int. - if (DEBUG) print(this + ".IAccessible::accHitTest() super returned VT_DISPATCH"); + int /*long*/[] pdispVal = new int /*long*/[1]; + COM.MoveMemory(pdispVal, pvarChild + 2, OS.PTR_SIZEOF); + osChildObject = pdispVal[0]; } } if (accessibleControlListeners.size() == 0) { @@ -2048,14 +2049,18 @@ */ int get_accFocus(int /*long*/ pvarChild) { int osChild = ACC.CHILDID_NONE; + int /*long*/ osChildObject = 0; if (iaccessible != null) { /* Get the default focus child from the OS. */ int code = iaccessible.get_accFocus(pvarChild); if (code == COM.S_OK) { VARIANT v = getVARIANT(pvarChild); if (v.vt == COM.VT_I4) osChild = v.lVal; - // TODO: need to check VT_DISPATCH (don't use struct) - if (DEBUG) if (v.vt == COM.VT_DISPATCH) print("IAccessible::get_accFocus() super returned VT_DISPATCH"); + else if (v.vt == COM.VT_DISPATCH) { + int /*long*/[] pdispVal = new int /*long*/[1]; + COM.MoveMemory(pdispVal, pvarChild + 2, OS.PTR_SIZEOF); + osChildObject = pdispVal[0]; + } } if (accessibleControlListeners.size() == 0) { if (DEBUG) print(this + ".IAccessible::get_accFocus() returning childID=" + osChild + " from super" + hresult(code)); @@ -2078,6 +2083,10 @@ } int childID = event.childID; if (childID == ACC.CHILDID_NONE) { + if (osChildObject != 0) { + if (DEBUG) print(this + ".IAccessible::get_accFocus() returning accessible " + osChildObject + hresult(COM.S_OK)); + return COM.S_OK; + } if (DEBUG) print(this + ".IAccessible::get_accFocus() returning VT_EMPTY" + hresult(COM.S_FALSE)); setIntVARIANT(pvarChild, COM.VT_EMPTY, 0); return COM.S_FALSE; @@ -2290,7 +2299,9 @@ if (v.vt == COM.VT_I4) { osChild = osToChildID(v.lVal); } else if (v.vt == COM.VT_DISPATCH) { - osChildObject = v.lVal; // TODO: don't use struct; lVal is an int + int /*long*/[] pdispVal = new int /*long*/[1]; + COM.MoveMemory(pdispVal, pvarChildren + 2, OS.PTR_SIZEOF); + osChildObject = pdispVal[0]; } else if (v.vt == COM.VT_UNKNOWN) { osChild = ACC.CHILDID_MULTIPLE; // TODO: Should get IEnumVARIANT from punkVal field, and enumerate children...