tdf#147083 wina11y: Return a11y object instead of child ID
Quoting MSAA doc about implementing child IDs [1]: > # How Servers Implement Child IDs > > Server developers can assign child IDs to both simple elements and > accessible objects. However, the recommended approach is to support the > standard Component Object Model (COM) interface IEnumVARIANT in every > accessible object that has children. > > If you implement IEnumVARIANT, you must: > > * Enumerate all children, both simple elements and accessible objects. > Provide child IDs for all simple elements and provide the IDispatch to > each accessible object. > * For accessible objects, set the vt member of the VARIANT to > VT_DISPATCH. The pdispVal member must contain a pointer to the IDispatch > interface. Note that the VARIANT is allocated and freed by the client. > * For simple elements, the child ID is any 32-bit positive integer. > Note that zero and negative integers are reserved by Microsoft Active > Accessibility. Set the VARIANT structure vt member to VT_I4 and the lVal > member to the child ID. > > If you do not support IEnumVARIANT, you must assign child IDs and > number the children in each object sequentially starting with one. So far, LibreOffice was returning negative "child IDs" instead of pointers to accessible objects, which were not conformant to the MSAA specification and not accepted by NVDA as valid child IDs (s.a. discussion on the first version of my related NVDA pull request to fix the announcement of a single selected cell in Calc, [2]). Adapt that to return pointers to accessible objects and drop the now unused 'CMAccessible::Get_XAccChildID'. [1] https://docs.microsoft.com/en-us/windows/win32/winauto/how-servers-implement-child-ids [2] https://github.com/nvaccess/nvda/pull/13277 Change-Id: I52a6f637adf334dee66627e6992451e6d81a7c9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129201 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
parent
d92b4dc5c9
commit
00c0ee8cf0
4 changed files with 8 additions and 20 deletions
|
@ -69,8 +69,9 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Next(ULONG cElements,VARIANT __RPC_FAR *
|
|||
&pChild);
|
||||
if(isGet)
|
||||
{
|
||||
pvar[l2].vt = VT_I4;
|
||||
static_cast<IMAccessible*>(pChild)->Get_XAccChildID(&pvar[l2].lVal);
|
||||
pvar[l2].vt = VT_DISPATCH;
|
||||
pvar[l2].pdispVal = pChild;
|
||||
pChild->AddRef();
|
||||
}
|
||||
else if(pRXAcc.is())
|
||||
{
|
||||
|
@ -80,8 +81,9 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Next(ULONG cElements,VARIANT __RPC_FAR *
|
|||
pRXAcc.get(), &pChild);
|
||||
if(isGet)
|
||||
{
|
||||
pvar[l2].vt = VT_I4;
|
||||
static_cast<IMAccessible*>(pChild)->Get_XAccChildID(&pvar[l2].lVal);
|
||||
pvar[l2].vt = VT_DISPATCH;
|
||||
pvar[l2].pdispVal = pChild;
|
||||
pChild->AddRef();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -856,8 +856,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accSelection(VARIANT *pvarCh
|
|||
m_pEnumVar->Next(1,varTmp,&count);
|
||||
if(count!=1)
|
||||
return S_FALSE;
|
||||
pvarChildren->vt = VT_I4;
|
||||
pvarChildren->lVal = varTmp[0].lVal;
|
||||
pvarChildren->vt = VT_DISPATCH;
|
||||
pvarChildren->pdispVal = varTmp[0].pdispVal;
|
||||
VariantClear(&varTmp[0]);
|
||||
m_pEnumVar->Reset();
|
||||
break;
|
||||
|
@ -2989,18 +2989,6 @@ void CMAccessible::ConvertAnyToVariant(const css::uno::Any &rAnyVal, VARIANT *pv
|
|||
}
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::Get_XAccChildID(long* childID)
|
||||
{
|
||||
// internal IMAccessible - no mutex meeded
|
||||
|
||||
if(childID == nullptr)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
*childID = m_dChildID;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_states(AccessibleStates __RPC_FAR *states)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
|
|
@ -209,7 +209,6 @@ private:
|
|||
HRESULT WINAPI SmartQI(void* pv, REFIID iid, void** ppvObject);
|
||||
|
||||
public:
|
||||
STDMETHOD(Get_XAccChildID)(/*[out,retval]*/ long* childID) override;
|
||||
// AccObjectManagerAgent is a management object in UNO, here keep its pointer for
|
||||
// the implementation of accNavigate when descendant manage happens for List,Tree, or Table
|
||||
// AccObjectManagerAgent and the following UNO objects XAccessible,XAccessibleSelection,
|
||||
|
|
|
@ -49,7 +49,6 @@ import "defines.idl";
|
|||
[id(24), helpstring("method Put_ActionDescription")] HRESULT Put_ActionDescription( const OLECHAR* szAction);
|
||||
[id(25), helpstring("method Put_XAccAgent")] HRESULT Put_XAccAgent(hyper pAgent);
|
||||
[id(26), helpstring("method NotifyDestroy")] HRESULT NotifyDestroy();
|
||||
[id(30), helpstring("method Get_XAccChildID")] HRESULT Get_XAccChildID([out,retval] long* childID);
|
||||
};
|
||||
[
|
||||
object,
|
||||
|
|
Loading…
Reference in a new issue