bug 1262563 - make FireShowHideEvent() return void r=davidb

This commit is contained in:
Trevor Saunders 2016-04-05 19:52:35 -04:00
parent 5509e10d38
commit ce3d231aa4
2 changed files with 9 additions and 11 deletions

View File

@ -1358,8 +1358,9 @@ AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
AccMutationEvent* event = downcast_accEvent(aEvent);
Accessible* parentAcc = event ? event->Parent() : accessible->Parent();
AtkObject* parent = AccessibleWrap::GetAtkObject(parentAcc);
return FireAtkShowHideEvent(atkObj, parent, true,
aEvent->IsFromUserInput());
NS_ENSURE_STATE(parent);
FireAtkShowHideEvent(atkObj, parent, true, aEvent->IsFromUserInput());
return NS_OK;
}
case nsIAccessibleEvent::EVENT_HIDE:
@ -1374,8 +1375,9 @@ AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
AccMutationEvent* event = downcast_accEvent(aEvent);
Accessible* parentAcc = event ? event->Parent() : accessible->Parent();
AtkObject* parent = AccessibleWrap::GetAtkObject(parentAcc);
return FireAtkShowHideEvent(atkObj, parent, false,
aEvent->IsFromUserInput());
NS_ENSURE_STATE(parent);
FireAtkShowHideEvent(atkObj, parent, false, aEvent->IsFromUserInput());
return NS_OK;
}
/*
@ -1589,17 +1591,13 @@ static const char *kMutationStrings[2][2] = {
{ HIDE_EVENT, ADD_EVENT },
};
nsresult
void
AccessibleWrap::FireAtkShowHideEvent(AtkObject* aObject, AtkObject* aParent,
bool aIsAdded, bool aFromUser)
{
int32_t indexInParent = getIndexInParentCB(aObject);
NS_ENSURE_STATE(aParent);
const char *signal_name = kMutationStrings[aFromUser][aIsAdded];
g_signal_emit_by_name(aParent, signal_name, indexInParent, aObject, nullptr);
return NS_OK;
}
// static

View File

@ -79,8 +79,8 @@ protected:
nsresult FireAtkStateChangeEvent(AccEvent* aEvent, AtkObject *aObject);
nsresult FireAtkTextChangedEvent(AccEvent* aEvent, AtkObject *aObject);
nsresult FireAtkShowHideEvent(AtkObject *aObject, AtkObject* aParent,
bool aIsAdded, bool aFromUser);
void FireAtkShowHideEvent(AtkObject *aObject, AtkObject* aParent,
bool aIsAdded, bool aFromUser);
AtkObject *mAtkObject;