bug 1241453 - switch MaiAtkObject to use AccessibleOrProxy r=davidb

This commit is contained in:
Trevor Saunders 2016-01-19 07:12:03 -05:00
parent 5a6d7c2794
commit 65cdeb5b7b
2 changed files with 9 additions and 9 deletions

View File

@ -135,7 +135,7 @@ MaiAtkObject::GetAtkHyperlink()
MaiHyperlink* maiHyperlink =
(MaiHyperlink*)g_object_get_qdata(G_OBJECT(this), quark_mai_hyperlink);
if (!maiHyperlink) {
maiHyperlink = new MaiHyperlink(accWrap);
maiHyperlink = new MaiHyperlink(accWrap.Bits());
g_object_set_qdata(G_OBJECT(this), quark_mai_hyperlink, maiHyperlink);
}
@ -145,7 +145,7 @@ MaiAtkObject::GetAtkHyperlink()
void
MaiAtkObject::Shutdown()
{
accWrap = 0;
accWrap.SetBits(0);
MaiHyperlink* maiHyperlink =
(MaiHyperlink*)g_object_get_qdata(G_OBJECT(this), quark_mai_hyperlink);
if (maiHyperlink) {
@ -559,7 +559,7 @@ initializeCB(AtkObject *aAtkObj, gpointer aData)
ATK_OBJECT_CLASS(parent_class)->initialize(aAtkObj, aData);
/* initialize object */
MAI_ATK_OBJECT(aAtkObj)->accWrap = reinterpret_cast<uintptr_t>(aData);
MAI_ATK_OBJECT(aAtkObj)->accWrap.SetBits(reinterpret_cast<uintptr_t>(aData));
}
void
@ -567,7 +567,7 @@ finalizeCB(GObject *aObj)
{
if (!IS_MAI_OBJECT(aObj))
return;
NS_ASSERTION(MAI_ATK_OBJECT(aObj)->accWrap == 0, "AccWrap NOT null");
NS_ASSERTION(MAI_ATK_OBJECT(aObj)->accWrap.Bits() == 0, "AccWrap NOT null");
// call parent finalize function
// finalize of GObjectClass will unref the accessible parent if has
@ -1065,7 +1065,7 @@ GetAccessibleWrap(AtkObject* aAtkObj)
nullptr);
uintptr_t accWrapPtr = isMAIObject ?
MAI_ATK_OBJECT(aAtkObj)->accWrap :
MAI_ATK_OBJECT(aAtkObj)->accWrap.Bits() :
reinterpret_cast<uintptr_t>(MAI_ATK_SOCKET(aAtkObj)->accWrap);
if (accWrapPtr & IS_PROXY)
return nullptr;
@ -1089,11 +1089,10 @@ ProxyAccessible*
GetProxy(AtkObject* aObj)
{
if (!aObj || !IS_MAI_OBJECT(aObj) ||
!(MAI_ATK_OBJECT(aObj)->accWrap & IS_PROXY))
!MAI_ATK_OBJECT(aObj)->accWrap.IsProxy())
return nullptr;
return reinterpret_cast<ProxyAccessible*>(MAI_ATK_OBJECT(aObj)->accWrap
& ~IS_PROXY);
return MAI_ATK_OBJECT(aObj)->accWrap.AsProxy();
}
AtkObject*

View File

@ -11,6 +11,7 @@
#include <glib.h>
#include <glib-object.h>
#include "AccessibleOrProxy.h"
#include "AccessibleWrap.h"
namespace mozilla {
@ -95,7 +96,7 @@ struct MaiAtkObject
* The AccessibleWrap whose properties and features are exported
* via this object instance.
*/
uintptr_t accWrap;
mozilla::a11y::AccessibleOrProxy accWrap;
/*
* Get the AtkHyperlink for this atk object.