Return proper value from wxIAccessible::get_accSelection() if no children are selected

VT_EMPTY VARIANT should be returned if wxAccessible::GetSelections() returns empty list of selected children.
This commit is contained in:
Artur Wieczorek
2016-09-29 23:44:30 +02:00
parent fae271c21c
commit ac96d3949b
3 changed files with 17 additions and 5 deletions

View File

@@ -1503,7 +1503,13 @@ STDMETHODIMP wxIAccessible::get_accSelection ( VARIANT * pVarChildren)
}
else
{
if (selections.GetType() == wxT("long"))
if ( selections.IsNull() )
{
pVarChildren->vt = VT_EMPTY;
return S_OK;
}
else if (selections.GetType() == wxT("long"))
{
pVarChildren->vt = VT_I4;
pVarChildren->lVal = selections.GetLong();
@@ -1526,6 +1532,8 @@ STDMETHODIMP wxIAccessible::get_accSelection ( VARIANT * pVarChildren)
}
else if (selections.GetType() == wxT("list"))
{
wxASSERT_MSG( selections.GetCount() > 1,
wxS("Multiple child objects should be selected") );
// TODO: should we AddRef for every "void*" member??
wxIEnumVARIANT* enumVariant = new wxIEnumVARIANT(selections);