Return null BSTR from wxIAccessible if string returned from wxAccessible method is empty

wxIAccessible should return a NULL BSTR to the accessibility framework if strings returned from wxIAccessible::get_accName() and get_accValue() are empty because this convention is already applied to the other methods returning string values, like get_accHelp(), get_accDescription().
This commit is contained in:
Artur Wieczorek
2016-10-06 20:48:59 +02:00
parent e2a5b19fac
commit 8980abacad
2 changed files with 23 additions and 5 deletions

View File

@@ -143,6 +143,8 @@ wxMSW:
errors in wxAccessible methods.
- Return DISP_E_MEMBERNOTFOUND error code from wxIAccessible if wxAccessible
methods return wxAccStatus::wxACC_NOT_SUPPORTED.
- Return null BSTR from wxIAccessible if string returned from wxAccesible
method is empty.
wxOSX:

View File

@@ -1232,9 +1232,17 @@ STDMETHODIMP wxIAccessible::get_accName ( VARIANT varID, BSTR* pszName)
return ((IAccessible*) m_pAccessible->GetIAccessibleStd())->get_accName (varID, pszName);
}
else
{
if ( name.empty() )
{
*pszName = NULL;
return S_FALSE;
}
else
{
wxBasicString basicString(name);
*pszName = basicString.Get();
}
return S_OK;
}
return E_NOTIMPL;
@@ -1405,11 +1413,19 @@ STDMETHODIMP wxIAccessible::get_accValue ( VARIANT varID, BSTR* pszValue)
return ((IAccessible*) m_pAccessible->GetIAccessibleStd())->get_accValue (varID, pszValue);
}
else
{
if ( strValue.empty() )
{
*pszValue = NULL;
return S_FALSE;
}
else
{
wxBasicString basicString(strValue);
* pszValue = basicString.Get();
return S_OK;
}
}
return E_NOTIMPL;
}