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:
@@ -75,6 +75,8 @@ All:
|
|||||||
- Handle strings with embedded NULs in wxDataStream (Nitch).
|
- Handle strings with embedded NULs in wxDataStream (Nitch).
|
||||||
- Don't crash in wxTextFile::GetLastLine() if the file is empty (crohr).
|
- Don't crash in wxTextFile::GetLastLine() if the file is empty (crohr).
|
||||||
- Add wxString::cbegin() and cend() method (Lauri Nurmi).
|
- Add wxString::cbegin() and cend() method (Lauri Nurmi).
|
||||||
|
- Return proper value from wxIAccessible::get_accSelection() if no children
|
||||||
|
are selected.
|
||||||
|
|
||||||
All (GUI):
|
All (GUI):
|
||||||
|
|
||||||
|
@@ -355,11 +355,13 @@ public:
|
|||||||
Gets a variant representing the selected children of this object.
|
Gets a variant representing the selected children of this object.
|
||||||
|
|
||||||
Acceptable values are:
|
Acceptable values are:
|
||||||
@li a null variant (IsNull() returns @true)
|
@li a null variant (@c IsNull() returns @true) if no children
|
||||||
@li a list variant (GetType() == "list")
|
are selected
|
||||||
|
@li a @c void* pointer to a wxAccessible of selected child object
|
||||||
@li an integer representing the selected child element,
|
@li an integer representing the selected child element,
|
||||||
or 0 if this object is selected (GetType() == "long")
|
or 0 if this object is selected (@c GetType() @c == @c "long")
|
||||||
@li a "void*" pointer to a wxAccessible child object
|
@li a list variant (@c GetType() @c == @c "list") if multiple child
|
||||||
|
objects are selected
|
||||||
*/
|
*/
|
||||||
virtual wxAccStatus GetSelections(wxVariant* selections);
|
virtual wxAccStatus GetSelections(wxVariant* selections);
|
||||||
|
|
||||||
|
@@ -1503,7 +1503,13 @@ STDMETHODIMP wxIAccessible::get_accSelection ( VARIANT * pVarChildren)
|
|||||||
}
|
}
|
||||||
else
|
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->vt = VT_I4;
|
||||||
pVarChildren->lVal = selections.GetLong();
|
pVarChildren->lVal = selections.GetLong();
|
||||||
@@ -1526,6 +1532,8 @@ STDMETHODIMP wxIAccessible::get_accSelection ( VARIANT * pVarChildren)
|
|||||||
}
|
}
|
||||||
else if (selections.GetType() == wxT("list"))
|
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??
|
// TODO: should we AddRef for every "void*" member??
|
||||||
|
|
||||||
wxIEnumVARIANT* enumVariant = new wxIEnumVARIANT(selections);
|
wxIEnumVARIANT* enumVariant = new wxIEnumVARIANT(selections);
|
||||||
|
Reference in New Issue
Block a user