summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-02-17 11:27:01 -0500
committerPietro Gagliardi <[email protected]>2015-02-17 11:27:01 -0500
commit5eade7c8313f4ac69067988940373fdb216a319d (patch)
tree49a905516a65f802d37d6870ef0f76f635a3195b
parent94a6cd7ab0f1063f7c5b7846fe455b1d94ec5296 (diff)
Implemented get_accSelection().
-rw-r--r--wintable/accessibility.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/wintable/accessibility.h b/wintable/accessibility.h
index f486413..461c25f 100644
--- a/wintable/accessibility.h
+++ b/wintable/accessibility.h
@@ -494,13 +494,25 @@ selectedCell:
return S_OK;
}
+// note: https://msdn.microsoft.com/en-us/library/ms971325 is geared toward cell-based selection
+// we have row-based selection, so only Tables implement this method, and they return a row
static HRESULT STDMETHODCALLTYPE tableAccget_accSelection(IAccessible *this, VARIANT *pvarChildren)
{
- if (TA->t == NULL || TA->std == NULL) {
- // TODO set values on error
+ if (pvarChildren == NULL)
+ return E_POINTER;
+ // TOOD set pvarChildren to VT_EMPTY?
+ if (TA->t == NULL || TA->std == NULL)
return RPC_E_DISCONNECTED;
+ if (TA->what.role != ROLE_SYSTEM_TABLE)
+ // TODO [EDGE CASE] implement this for row anyway? how?
+ return DISP_E_MEMBERNOTFOUND;
+ if (TA->t->selectedRow == -1) {
+ pvarChildren->vt = VT_EMPTY;
+ return S_OK;
}
- return IAccessible_get_accSelection(TA->std, pvarChildren);
+ pvarChildren->vt = VT_DISPATCH;
+ pvarChildren->pdispVal = (IDispatch *) newTableAcc(TA->t, ROLE_SYSTEM_ROW, TA->t->selectedRow, -1);
+ return S_OK;
}
static HRESULT STDMETHODCALLTYPE tableAccget_accDefaultAction(IAccessible *this, VARIANT varChild, BSTR *pszDefaultAction)