Bug 678016 - Fix c++0x initializer list error found by clang; r=josh

Add explict casts to short.
    ::Point is a OS provided data type, so we cannot change it. I could try adding
    a nsShortPoint type and have WidgetToScreenOffset to return it, but that
    is a virtual method used in other OSs, so doing the cast looked like the
    best solution.
This commit is contained in:
Rafael Ávila de Espíndola 2011-08-10 15:45:44 -04:00
parent e7a2202774
commit 3e1d86aa57

View File

@ -1942,7 +1942,8 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent)
presContext->AppUnitsToDevPixels(pt.y));
#ifndef NP_NO_CARBON
nsIntPoint geckoScreenCoords = mWidget->WidgetToScreenOffset();
::Point carbonPt = { ptPx.y + geckoScreenCoords.y, ptPx.x + geckoScreenCoords.x };
::Point carbonPt = { static_cast<short>(ptPx.y + geckoScreenCoords.y),
static_cast<short>(ptPx.x + geckoScreenCoords.x) };
if (eventModel == NPEventModelCarbon) {
if (event && anEvent.eventStructType == NS_MOUSE_EVENT) {
static_cast<EventRecord*>(event)->where = carbonPt;