bug 1243077 - make it possible to get MaiAtkObject::mAccWrap from an AtkObject* without casting to Accessible* or ProxyAccessible* r=davidb

This commit is contained in:
Trevor Saunders 2016-01-22 05:49:30 -05:00
parent 68157e1e81
commit ed7112af70
2 changed files with 9 additions and 3 deletions

View File

@ -1088,11 +1088,16 @@ GetAccessibleWrap(AtkObject* aAtkObj)
ProxyAccessible* ProxyAccessible*
GetProxy(AtkObject* aObj) GetProxy(AtkObject* aObj)
{ {
if (!aObj || !IS_MAI_OBJECT(aObj) || return GetInternalObj(aObj).AsProxy();
!MAI_ATK_OBJECT(aObj)->accWrap.IsProxy()) }
AccessibleOrProxy
GetInternalObj(AtkObject* aObj)
{
if (!aObj || !IS_MAI_OBJECT(aObj))
return nullptr; return nullptr;
return MAI_ATK_OBJECT(aObj)->accWrap.AsProxy(); return MAI_ATK_OBJECT(aObj)->accWrap;
} }
AtkObject* AtkObject*

View File

@ -67,6 +67,7 @@ typedef struct _MaiAtkSocketClass
mozilla::a11y::AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj); mozilla::a11y::AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj);
mozilla::a11y::ProxyAccessible* GetProxy(AtkObject* aAtkObj); mozilla::a11y::ProxyAccessible* GetProxy(AtkObject* aAtkObj);
mozilla::a11y::AccessibleOrProxy GetInternalObj(AtkObject* aObj);
AtkObject* GetWrapperFor(mozilla::a11y::ProxyAccessible* aProxy); AtkObject* GetWrapperFor(mozilla::a11y::ProxyAccessible* aProxy);
extern int atkMajorVersion, atkMinorVersion; extern int atkMajorVersion, atkMinorVersion;