From 7ca8ebadf7878bec472e0982d3f17ee2dbcbd0cc Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 17 Feb 2015 09:56:12 -0500 Subject: [PATCH] Implemented get_accKeyboardShortcut(). --- wintable/accessibility.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/wintable/accessibility.h b/wintable/accessibility.h index ca98f01..81c4589 100644 --- a/wintable/accessibility.h +++ b/wintable/accessibility.h @@ -379,11 +379,24 @@ static HRESULT STDMETHODCALLTYPE tableAccget_accHelpTopic(IAccessible *this, BST static HRESULT STDMETHODCALLTYPE tableAccget_accKeyboardShortcut(IAccessible *this, VARIANT varChild, BSTR *pszKeyboardShortcut) { - if (TA->t == NULL || TA->std == NULL) { - // TODO set values on error + HRESULT hr; + tableAccWhat what; + + if (pszKeyboardShortcut == NULL) + return E_POINTER; + // TODO set pszKeyboardShortcut to zero? + if (TA->t == NULL || TA->std == NULL) return RPC_E_DISCONNECTED; - } - return IAccessible_get_accKeyboardShortcut(TA->std, varChild, pszKeyboardShortcut); + what = TA->what; + hr = normalizeWhat(TA, varChild, &what); + if (hr != S_OK) + return hr; + // defer to the standard accessible object for the table itself in case a program assigns an access key somehow (adjacent label?); MSDN says to, anyway + if (what.role == ROLE_SYSTEM_TABLE) + return IAccessible_get_accKeyboardShortcut(TA->std, varChild, pszKeyboardShortcut); + if (what.role == ROLE_SYSTEM_CELL) + ; // TODO implement this for checkbox cells? + return DISP_E_MEMBERNOTFOUND; } // TODO TEST THIS