Bug 920425 part.14 Use mozilla::WidgetEvent::AsCommandEvent() r=smaug

This commit is contained in:
Masayuki Nakano 2013-10-18 15:10:23 +09:00
parent 369cc09510
commit daf85a040a
3 changed files with 4 additions and 5 deletions

View File

@ -33,7 +33,7 @@ NS_IMPL_RELEASE_INHERITED(nsDOMCommandEvent, nsDOMEvent)
NS_IMETHODIMP
nsDOMCommandEvent::GetCommand(nsAString& aCommand)
{
nsIAtom* command = static_cast<WidgetCommandEvent*>(mEvent)->command;
nsIAtom* command = mEvent->AsCommandEvent()->command;
if (command) {
command->ToString(aCommand);
} else {
@ -51,7 +51,7 @@ nsDOMCommandEvent::InitCommandEvent(const nsAString& aTypeArg,
nsresult rv = nsDOMEvent::InitEvent(aTypeArg, aCanBubbleArg, aCancelableArg);
NS_ENSURE_SUCCESS(rv, rv);
static_cast<WidgetCommandEvent*>(mEvent)->command = do_GetAtom(aCommand);
mEvent->AsCommandEvent()->command = do_GetAtom(aCommand);
return NS_OK;
}

View File

@ -660,8 +660,7 @@ nsDOMEvent::DuplicatePrivateData()
}
case NS_COMMAND_EVENT:
{
WidgetCommandEvent* oldCommandEvent =
static_cast<WidgetCommandEvent*>(mEvent);
WidgetCommandEvent* oldCommandEvent = mEvent->AsCommandEvent();
WidgetCommandEvent* commandEvent =
new WidgetCommandEvent(false, mEvent->userType,
oldCommandEvent->command, nullptr);

View File

@ -737,7 +737,7 @@ nsEventDispatcher::CreateEvent(mozilla::dom::EventTarget* aOwner,
case NS_COMMAND_EVENT:
return NS_NewDOMCommandEvent(aDOMEvent, aOwner, aPresContext,
static_cast<WidgetCommandEvent*>(aEvent));
aEvent->AsCommandEvent());
case NS_SIMPLE_GESTURE_EVENT:
return NS_NewDOMSimpleGestureEvent(aDOMEvent, aOwner, aPresContext,
static_cast<WidgetSimpleGestureEvent*>(aEvent));