mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 09:49:14 +00:00
bug 429642 - cleanup and fix crash in nsAccessibleWrap::get_accKeyboardShortcut() r=surkov
This commit is contained in:
parent
c577b30118
commit
50158a9e44
@ -484,18 +484,22 @@ STDMETHODIMP nsAccessibleWrap::get_accKeyboardShortcut(
|
||||
/* [retval][out] */ BSTR __RPC_FAR *pszKeyboardShortcut)
|
||||
{
|
||||
__try {
|
||||
if (!pszKeyboardShortcut)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*pszKeyboardShortcut = NULL;
|
||||
nsAccessible *xpAccessible = GetXPAccessibleFor(varChild);
|
||||
if (xpAccessible) {
|
||||
nsAutoString shortcut;
|
||||
nsresult rv = xpAccessible->GetKeyboardShortcut(shortcut);
|
||||
if (NS_FAILED(rv))
|
||||
return E_FAIL;
|
||||
if (!xpAccessible || xpAccessible->IsDefunct())
|
||||
return E_FAIL;
|
||||
|
||||
*pszKeyboardShortcut = ::SysAllocStringLen(shortcut.get(),
|
||||
shortcut.Length());
|
||||
return *pszKeyboardShortcut ? S_OK : E_OUTOFMEMORY;
|
||||
}
|
||||
nsAutoString shortcut;
|
||||
nsresult rv = xpAccessible->GetKeyboardShortcut(shortcut);
|
||||
if (NS_FAILED(rv))
|
||||
return GetHRESULT(rv);
|
||||
|
||||
*pszKeyboardShortcut = ::SysAllocStringLen(shortcut.get(),
|
||||
shortcut.Length());
|
||||
return *pszKeyboardShortcut ? S_OK : E_OUTOFMEMORY;
|
||||
} __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
|
||||
return E_FAIL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user