summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_fftextedit.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-12-07 17:01:58 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-07 17:01:58 -0800
commit4614b45a6592530c4cd930f139c366ce20d359f4 (patch)
tree72a6098a19945cfbdf0877e6e2ba02323ebde33f /xfa/fxfa/app/xfa_fftextedit.cpp
parent248cb27e64b3a25230f53fc2f4ab9d483facc5f9 (diff)
downloadpdfium-4614b45a6592530c4cd930f139c366ce20d359f4.tar.xz
Cleanup FWL Event and Message code.
This CL removes any CFWL_Evt classes for which nothing was listening to the events. For events with no parameters the override class was removed and the event type passed into CFWL_Event which is used instead. Any event or message parameters which are un-read have been removed. Review-Url: https://codereview.chromium.org/2530993002
Diffstat (limited to 'xfa/fxfa/app/xfa_fftextedit.cpp')
-rw-r--r--xfa/fxfa/app/xfa_fftextedit.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp
index a070f90b99..89c323c23b 100644
--- a/xfa/fxfa/app/xfa_fftextedit.cpp
+++ b/xfa/fxfa/app/xfa_fftextedit.cpp
@@ -117,12 +117,11 @@ bool CXFA_FFTextEdit::OnLButtonDown(uint32_t dwFlags,
AddInvalidateRect();
}
SetButtonDown(true);
- CFWL_MsgMouse ms;
+ CFWL_MsgMouse ms(nullptr, m_pNormalWidget);
ms.m_dwCmd = FWL_MouseCommand::LeftButtonDown;
ms.m_dwFlags = dwFlags;
ms.m_fx = fx;
ms.m_fy = fy;
- ms.m_pDstTarget = m_pNormalWidget;
FWLToClient(ms.m_fx, ms.m_fy);
TranslateFWLMessage(&ms);
return true;
@@ -142,7 +141,7 @@ bool CXFA_FFTextEdit::OnRButtonDown(uint32_t dwFlags,
AddInvalidateRect();
}
SetButtonDown(true);
- CFWL_MsgMouse ms;
+ CFWL_MsgMouse ms(nullptr, nullptr);
ms.m_dwCmd = FWL_MouseCommand::RightButtonDown;
ms.m_dwFlags = dwFlags;
ms.m_fx = fx;
@@ -166,16 +165,12 @@ bool CXFA_FFTextEdit::OnSetFocus(CXFA_FFWidget* pOldWidget) {
AddInvalidateRect();
}
CXFA_FFWidget::OnSetFocus(pOldWidget);
- CFWL_MsgSetFocus ms;
- ms.m_pDstTarget = m_pNormalWidget;
- ms.m_pSrcTarget = nullptr;
+ CFWL_MsgSetFocus ms(nullptr, m_pNormalWidget);
TranslateFWLMessage(&ms);
return true;
}
bool CXFA_FFTextEdit::OnKillFocus(CXFA_FFWidget* pNewWidget) {
- CFWL_MsgKillFocus ms;
- ms.m_pDstTarget = m_pNormalWidget;
- ms.m_pSrcTarget = nullptr;
+ CFWL_MsgKillFocus ms(nullptr, m_pNormalWidget);
TranslateFWLMessage(&ms);
m_dwStatus &= ~XFA_WidgetStatus_Focused;
SetEditScrollOffset();
@@ -338,18 +333,18 @@ void CXFA_FFTextEdit::OnProcessMessage(CFWL_Message* pMessage) {
void CXFA_FFTextEdit::OnProcessEvent(CFWL_Event* pEvent) {
CXFA_FFField::OnProcessEvent(pEvent);
- switch (pEvent->GetClassID()) {
- case CFWL_EventType::TextChanged: {
+ switch (pEvent->GetType()) {
+ case CFWL_Event::Type::TextChanged: {
CFWL_EvtTextChanged* event = static_cast<CFWL_EvtTextChanged*>(pEvent);
CFX_WideString wsChange;
OnTextChanged(m_pNormalWidget, wsChange, event->wsPrevText);
break;
}
- case CFWL_EventType::TextFull: {
+ case CFWL_Event::Type::TextFull: {
OnTextFull(m_pNormalWidget);
break;
}
- case CFWL_EventType::CheckWord: {
+ case CFWL_Event::Type::CheckWord: {
CFX_WideString wstr(L"FWL_EVENT_DTP_SelectChanged");
CFWL_EvtCheckWord* event = static_cast<CFWL_EvtCheckWord*>(pEvent);
event->bCheckWord = CheckWord(event->bsWord.AsStringC());
@@ -418,7 +413,7 @@ void CXFA_FFNumericEdit::UpdateWidgetProperty() {
}
void CXFA_FFNumericEdit::OnProcessEvent(CFWL_Event* pEvent) {
- if (pEvent->GetClassID() == CFWL_EventType::Validate) {
+ if (pEvent->GetType() == CFWL_Event::Type::Validate) {
CFWL_EvtValidate* event = static_cast<CFWL_EvtValidate*>(pEvent);
event->bValidate = OnValidate(m_pNormalWidget, event->wsInsert);
return;
@@ -683,7 +678,7 @@ void CXFA_FFDateTimeEdit::OnSelectChanged(CFWL_Widget* pWidget,
}
void CXFA_FFDateTimeEdit::OnProcessEvent(CFWL_Event* pEvent) {
- if (pEvent->GetClassID() == CFWL_EventType::SelectChanged) {
+ if (pEvent->GetType() == CFWL_Event::Type::SelectChanged) {
CFWL_EvtSelectChanged* event = static_cast<CFWL_EvtSelectChanged*>(pEvent);
OnSelectChanged(m_pNormalWidget, event->iYear, event->iMonth, event->iDay);
return;