diff options
-rw-r--r-- | xfa/include/fwl/core/fwl_note.h | 12 | ||||
-rw-r--r-- | xfa/src/fwl/src/core/fwl_widgetimp.cpp | 4 |
2 files changed, 5 insertions, 11 deletions
diff --git a/xfa/include/fwl/core/fwl_note.h b/xfa/include/fwl/core/fwl_note.h index e6579bff10..a838d8047f 100644 --- a/xfa/include/fwl/core/fwl_note.h +++ b/xfa/include/fwl/core/fwl_note.h @@ -170,7 +170,6 @@ class CFWL_Message : public CFWL_Note { public:
CFWL_Message() : CFWL_Note(FALSE) {}
virtual ~CFWL_Message() {}
- virtual CFWL_Event* CloneToEvent() { return NULL; }
};
#define BEGIN_FWL_MESSAGE_DEF(classname, msghashcode) \
class classname : public CFWL_Message { \
@@ -178,15 +177,10 @@ class CFWL_Message : public CFWL_Note { classname() : CFWL_Message() {} \
virtual CFWL_Note* Clone() { return new classname(*this); } \
virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { \
- wsClass = L" ## classname ## "; \
+ wsClass = L## #classname; \
return FWL_ERR_Succeeded; \
} \
- virtual FX_DWORD GetClassID() const { return msghashcode; } \
- virtual CFWL_Event* CloneToEvent() { \
- classname* pEvent = new classname; \
- pEvent->m_bIsEvent = TRUE; \
- return (CFWL_Event*)pEvent; \
- }
+ virtual FX_DWORD GetClassID() const { return msghashcode; }
#define END_FWL_MESSAGE_DEF \
} \
;
@@ -258,7 +252,7 @@ class CFWL_Event : public CFWL_Note { public: \
classname() : CFWL_Event() {} \
virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { \
- wsClass = L" ## classname ## "; \
+ wsClass = L## #classname; \
return FWL_ERR_Succeeded; \
} \
virtual FX_DWORD GetClassID() const { return eventhashcode; }
diff --git a/xfa/src/fwl/src/core/fwl_widgetimp.cpp b/xfa/src/fwl/src/core/fwl_widgetimp.cpp index 95e235d12a..c48bfb9ca9 100644 --- a/xfa/src/fwl/src/core/fwl_widgetimp.cpp +++ b/xfa/src/fwl/src/core/fwl_widgetimp.cpp @@ -832,12 +832,12 @@ void CFWL_WidgetImp::UnregisterEventTarget() { void CFWL_WidgetImp::DispatchKeyEvent(CFWL_MsgKey* pNote) {
if (!pNote)
return;
- CFWL_MsgKey* pEvent = (CFWL_MsgKey*)pNote->CloneToEvent();
+ CFWL_EvtKey* pEvent = new CFWL_EvtKey;
pEvent->m_pSrcTarget = m_pInterface;
pEvent->m_dwCmd = pNote->m_dwCmd;
pEvent->m_dwKeyCode = pNote->m_dwKeyCode;
pEvent->m_dwFlags = pNote->m_dwFlags;
- DispatchEvent((CFWL_Event*)pEvent);
+ DispatchEvent(pEvent);
pEvent->Release();
}
void CFWL_WidgetImp::DispatchEvent(CFWL_Event* pEvent) {
|