View | Details | Raw Unified | Return to bug 313075
Collapse All | Expand All

(-)Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java (-5 / +16 lines)
Lines 1751-1758 Link Here
1751
				VARIANT v = getVARIANT(pvarChild);
1751
				VARIANT v = getVARIANT(pvarChild);
1752
				if (v.vt == COM.VT_I4) osChild = v.lVal;
1752
				if (v.vt == COM.VT_I4) osChild = v.lVal;
1753
				else if (v.vt == COM.VT_DISPATCH) {
1753
				else if (v.vt == COM.VT_DISPATCH) {
1754
					osChildObject = v.lVal; // TODO: don't use struct. lVal is an int.
1754
					int /*long*/[] pdispVal = new int /*long*/[1];
1755
					if (DEBUG) print(this + ".IAccessible::accHitTest() super returned VT_DISPATCH");
1755
					COM.MoveMemory(pdispVal, pvarChild + 2, OS.PTR_SIZEOF);
1756
					osChildObject = pdispVal[0];
1756
				}
1757
				}
1757
			}
1758
			}
1758
			if (accessibleControlListeners.size() == 0) {
1759
			if (accessibleControlListeners.size() == 0) {
Lines 2048-2061 Link Here
2048
	 */
2049
	 */
2049
	int get_accFocus(int /*long*/ pvarChild) {
2050
	int get_accFocus(int /*long*/ pvarChild) {
2050
		int osChild = ACC.CHILDID_NONE;
2051
		int osChild = ACC.CHILDID_NONE;
2052
		int /*long*/ osChildObject = 0;
2051
		if (iaccessible != null) {
2053
		if (iaccessible != null) {
2052
			/* Get the default focus child from the OS. */
2054
			/* Get the default focus child from the OS. */
2053
			int code = iaccessible.get_accFocus(pvarChild);
2055
			int code = iaccessible.get_accFocus(pvarChild);
2054
			if (code == COM.S_OK) {
2056
			if (code == COM.S_OK) {
2055
				VARIANT v = getVARIANT(pvarChild);
2057
				VARIANT v = getVARIANT(pvarChild);
2056
				if (v.vt == COM.VT_I4) osChild = v.lVal;
2058
				if (v.vt == COM.VT_I4) osChild = v.lVal;
2057
				// TODO: need to check VT_DISPATCH (don't use struct)
2059
				else if (v.vt == COM.VT_DISPATCH) {
2058
				if (DEBUG) if (v.vt == COM.VT_DISPATCH) print("IAccessible::get_accFocus() super returned VT_DISPATCH"); 
2060
					int /*long*/[] pdispVal = new int /*long*/[1];
2061
					COM.MoveMemory(pdispVal, pvarChild + 2, OS.PTR_SIZEOF);
2062
					osChildObject = pdispVal[0];
2063
				}
2059
			}
2064
			}
2060
			if (accessibleControlListeners.size() == 0) {
2065
			if (accessibleControlListeners.size() == 0) {
2061
				if (DEBUG) print(this + ".IAccessible::get_accFocus() returning childID=" + osChild + " from super" + hresult(code));
2066
				if (DEBUG) print(this + ".IAccessible::get_accFocus() returning childID=" + osChild + " from super" + hresult(code));
Lines 2078-2083 Link Here
2078
		}
2083
		}
2079
		int childID = event.childID;
2084
		int childID = event.childID;
2080
		if (childID == ACC.CHILDID_NONE) {
2085
		if (childID == ACC.CHILDID_NONE) {
2086
			if (osChildObject != 0) {
2087
				if (DEBUG) print(this + ".IAccessible::get_accFocus() returning accessible " + osChildObject + hresult(COM.S_OK));
2088
				return COM.S_OK;
2089
			}
2081
			if (DEBUG) print(this + ".IAccessible::get_accFocus() returning VT_EMPTY" + hresult(COM.S_FALSE));
2090
			if (DEBUG) print(this + ".IAccessible::get_accFocus() returning VT_EMPTY" + hresult(COM.S_FALSE));
2082
			setIntVARIANT(pvarChild, COM.VT_EMPTY, 0);
2091
			setIntVARIANT(pvarChild, COM.VT_EMPTY, 0);
2083
			return COM.S_FALSE;
2092
			return COM.S_FALSE;
Lines 2290-2296 Link Here
2290
				if (v.vt == COM.VT_I4) {
2299
				if (v.vt == COM.VT_I4) {
2291
					osChild = osToChildID(v.lVal);
2300
					osChild = osToChildID(v.lVal);
2292
				} else if (v.vt == COM.VT_DISPATCH) {
2301
				} else if (v.vt == COM.VT_DISPATCH) {
2293
					osChildObject = v.lVal; // TODO: don't use struct; lVal is an int
2302
					int /*long*/[] pdispVal = new int /*long*/[1];
2303
					COM.MoveMemory(pdispVal, pvarChildren + 2, OS.PTR_SIZEOF);
2304
					osChildObject = pdispVal[0];
2294
				} else if (v.vt == COM.VT_UNKNOWN) {
2305
				} else if (v.vt == COM.VT_UNKNOWN) {
2295
					osChild = ACC.CHILDID_MULTIPLE;
2306
					osChild = ACC.CHILDID_MULTIPLE;
2296
					// TODO: Should get IEnumVARIANT from punkVal field, and enumerate children...
2307
					// TODO: Should get IEnumVARIANT from punkVal field, and enumerate children...

Return to bug 313075