Bug 823201 - Keyboard doesn't work in OOP apps. r=cjones

This commit is contained in:
Gregor Wagner 2012-12-19 19:42:29 -08:00
parent 8c3e8f0d58
commit ef37083bac

View File

@ -20,13 +20,17 @@ struct ParamTraits<mozilla::widget::EventFlags>
static void Write(Message* aMsg, const paramType& aParam)
{
aMsg->WriteBytes(&aParam, sizeof(paramType));
aMsg->WriteBytes(&aParam, sizeof(aParam));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
{
return aMsg->ReadBytes(aIter, reinterpret_cast<const char**>(aResult),
sizeof(paramType));
const char* outp;
if (!aMsg->ReadBytes(aIter, &outp, sizeof(*aResult))) {
return false;
}
*aResult = *reinterpret_cast<const paramType*>(outp);
return true;
}
};