summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-02-17 10:54:04 -0500
committerPietro Gagliardi <[email protected]>2015-02-17 10:54:04 -0500
commite383199547e5cea38864df5a8454f8f293f0ec6e (patch)
tree87313b02d971b9da7be606225a6d05b513f8ee42
parentbad241bd931170282c5f4cff9c4aec0980a72530 (diff)
Implemented get_accParent().
-rw-r--r--wintable/accessibility.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/wintable/accessibility.h b/wintable/accessibility.h
index 32a0fa2..df8b6ce 100644
--- a/wintable/accessibility.h
+++ b/wintable/accessibility.h
@@ -191,11 +191,28 @@ static HRESULT STDMETHODCALLTYPE tableAccInvoke(IAccessible *this, DISPID dispId
static HRESULT STDMETHODCALLTYPE tableAccget_accParent(IAccessible *this, IDispatch **ppdispParent)
{
- if (TA->t == NULL || TA->std == NULL) {
- // TODO set values on error
+ if (ppdispParent == NULL)
+ return E_POINTER;
+ // TODO set ppdispParent to zero?
+ if (TA->t == NULL || TA->std == NULL)
return RPC_E_DISCONNECTED;
+ // TODO check if row/column is still valid
+ switch (TA->what.role) {
+ case ROLE_SYSTEM_TABLE:
+ // defer to standard accessible object
+ // TODO [EDGE CASE/POOR DOCUMENTATION?] https://msdn.microsoft.com/en-us/library/ms971325 says "Returns the IDispatch interface of the Table object."; isn't that just returning self?
+ return IAccessible_get_accParent(TA->std, ppdispParent);
+ case ROLE_SYSTEM_ROW:
+ *ppdispParent = (IDispatch *) newTableAcc(TA->t, ROLE_SYSTEM_TABLE, -1, -1);
+ return S_OK;
+ case ROLE_SYSTEM_CELL:
+ *ppdispParent = (IDispatch *) newTableAcc(TA->t, ROLE_SYSTEM_ROW, TA->what.row, -1);
+ return S_OK;
}
- return IAccessible_get_accParent(TA->std, ppdispParent);
+ // TODO actually do this right
+ // TODO un-GetLastError() this
+ panic("impossible blah blah blah TODO write this");
+ return E_FAIL;
}
static HRESULT STDMETHODCALLTYPE tableAccget_accChildCount(IAccessible *this, long *pcountChildren)
@@ -278,6 +295,7 @@ static HRESULT STDMETHODCALLTYPE tableAccget_accName(IAccessible *this, VARIANT
if (pszName == NULL)
return E_POINTER;
+ // TODO double-check that this must be set to zero
*pszName = NULL;
if (TA->t == NULL || TA->std == NULL)
return RPC_E_DISCONNECTED;