summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-21 13:12:06 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-21 13:12:06 -0700
commit5d9da0c1255a75dd9b7b2005f8b7d6ae4948feaf (patch)
treedf40bedc2582cab695e7bf4b2056bfddd4969908 /xfa/fxfa/app
parent0f6425fff33e4096b4e1fbfb954edae1349c0145 (diff)
downloadpdfium-5d9da0c1255a75dd9b7b2005f8b7d6ae4948feaf.tar.xz
Remove CFWL_Note.
This CL removes the CFWL_Note class. The two subclasses, CFWL_Event and CFWL_Message are distinct types and should not be related by the subclass. The code has been updated to pass the correct types as needed. The various FWL_EVTHASH and FWL_MSGHASH defines have all been removed and turned into an FWL_EventType and FWL_MessageType enum classes. BUG=pdfium:474 Review URL: https://codereview.chromium.org/1901183002
Diffstat (limited to 'xfa/fxfa/app')
-rw-r--r--xfa/fxfa/app/xfa_ffcheckbutton.cpp10
-rw-r--r--xfa/fxfa/app/xfa_ffchoicelist.cpp24
-rw-r--r--xfa/fxfa/app/xfa_fffield.cpp12
-rw-r--r--xfa/fxfa/app/xfa_fftextedit.cpp31
4 files changed, 42 insertions, 35 deletions
diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.cpp b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
index 85f445fedc..4527afef7d 100644
--- a/xfa/fxfa/app/xfa_ffcheckbutton.cpp
+++ b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
@@ -298,11 +298,11 @@ FX_BOOL CXFA_FFCheckButton::UpdateFWLData() {
int32_t CXFA_FFCheckButton::OnProcessMessage(CFWL_Message* pMessage) {
return m_pOldDelegate->OnProcessMessage(pMessage);
}
+
FWL_ERR CXFA_FFCheckButton::OnProcessEvent(CFWL_Event* pEvent) {
CXFA_FFField::OnProcessEvent(pEvent);
- uint32_t dwEventID = pEvent->GetClassID();
- switch (dwEventID) {
- case FWL_EVTHASH_CKB_CheckStateChanged: {
+ switch (pEvent->GetClassID()) {
+ case CFWL_EventType::CheckStateChanged: {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_Change;
m_pDataAcc->GetValue(eParam.m_wsNewText, XFA_VALUEPICTURE_Raw);
@@ -327,10 +327,12 @@ FWL_ERR CXFA_FFCheckButton::OnProcessEvent(CFWL_Event* pEvent) {
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam);
break;
}
- default: {}
+ default:
+ break;
}
return m_pOldDelegate->OnProcessEvent(pEvent);
}
+
FWL_ERR CXFA_FFCheckButton::OnDrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) {
return m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp
index a13c36d973..cfd78c2035 100644
--- a/xfa/fxfa/app/xfa_ffchoicelist.cpp
+++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp
@@ -185,14 +185,14 @@ int32_t CXFA_FFListBox::OnProcessMessage(CFWL_Message* pMessage) {
}
FWL_ERR CXFA_FFListBox::OnProcessEvent(CFWL_Event* pEvent) {
CXFA_FFField::OnProcessEvent(pEvent);
- uint32_t dwEventID = pEvent->GetClassID();
- switch (dwEventID) {
- case FWL_EVTHASH_LTB_SelChanged: {
+ switch (pEvent->GetClassID()) {
+ case CFWL_EventType::SelectChanged: {
CFX_Int32Array arrSels;
OnSelectChanged(m_pNormalWidget->GetWidget(), arrSels);
break;
}
- default: {}
+ default:
+ break;
}
return m_pOldDelegate->OnProcessEvent(pEvent);
}
@@ -498,33 +498,35 @@ void CXFA_FFComboBox::OnPostOpen(IFWL_Widget* pWidget) {
int32_t CXFA_FFComboBox::OnProcessMessage(CFWL_Message* pMessage) {
return m_pOldDelegate->OnProcessMessage(pMessage);
}
+
FWL_ERR CXFA_FFComboBox::OnProcessEvent(CFWL_Event* pEvent) {
CXFA_FFField::OnProcessEvent(pEvent);
- uint32_t dwEventID = pEvent->GetClassID();
- switch (dwEventID) {
- case FWL_EVTHASH_CMB_SelChanged: {
+ switch (pEvent->GetClassID()) {
+ case CFWL_EventType::SelectChanged: {
CFWL_EvtCmbSelChanged* postEvent = (CFWL_EvtCmbSelChanged*)pEvent;
OnSelectChanged(m_pNormalWidget->GetWidget(), postEvent->iArraySels,
postEvent->bLButtonUp);
break;
}
- case FWL_EVTHASH_CMB_EditChanged: {
+ case CFWL_EventType::EditChanged: {
CFX_WideString wsChanged;
OnTextChanged(m_pNormalWidget->GetWidget(), wsChanged);
break;
}
- case FWL_EVTHASH_CMB_PreDropDown: {
+ case CFWL_EventType::PreDropDown: {
OnPreOpen(m_pNormalWidget->GetWidget());
break;
}
- case FWL_EVTHASH_CMB_PostDropDown: {
+ case CFWL_EventType::PostDropDown: {
OnPostOpen(m_pNormalWidget->GetWidget());
break;
}
- default: {}
+ default:
+ break;
}
return m_pOldDelegate->OnProcessEvent(pEvent);
}
+
FWL_ERR CXFA_FFComboBox::OnDrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) {
return m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp
index 745f44d7e3..872dc8f3ce 100644
--- a/xfa/fxfa/app/xfa_fffield.cpp
+++ b/xfa/fxfa/app/xfa_fffield.cpp
@@ -794,10 +794,10 @@ void CXFA_FFField::TranslateFWLMessage(CFWL_Message* pMessage) {
int32_t CXFA_FFField::OnProcessMessage(CFWL_Message* pMessage) {
return FWL_ERR_Succeeded;
}
+
FWL_ERR CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) {
- uint32_t dwEventID = pEvent->GetClassID();
- switch (dwEventID) {
- case FWL_EVTHASH_Mouse: {
+ switch (pEvent->GetClassID()) {
+ case CFWL_EventType::Mouse: {
CFWL_EvtMouse* event = (CFWL_EvtMouse*)pEvent;
if (event->m_dwCmd == FWL_MSGMOUSECMD_MouseEnter) {
CXFA_EventParam eParam;
@@ -822,17 +822,19 @@ FWL_ERR CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) {
}
break;
}
- case FWL_EVTHASH_Click: {
+ case CFWL_EventType::Click: {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_Click;
eParam.m_pTarget = m_pDataAcc;
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam);
break;
}
- default: {}
+ default:
+ break;
}
return FWL_ERR_Succeeded;
}
+
FWL_ERR CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) {
return FWL_ERR_Succeeded;
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp
index 5b543db14d..baa1d8aca6 100644
--- a/xfa/fxfa/app/xfa_fftextedit.cpp
+++ b/xfa/fxfa/app/xfa_fftextedit.cpp
@@ -403,36 +403,38 @@ FX_BOOL CXFA_FFTextEdit::GetSuggestWords(
int32_t CXFA_FFTextEdit::OnProcessMessage(CFWL_Message* pMessage) {
return m_pOldDelegate->OnProcessMessage(pMessage);
}
+
FWL_ERR CXFA_FFTextEdit::OnProcessEvent(CFWL_Event* pEvent) {
CXFA_FFField::OnProcessEvent(pEvent);
- uint32_t dwEventID = pEvent->GetClassID();
- switch (dwEventID) {
- case FWL_EVTHASH_EDT_TextChanged: {
+ switch (pEvent->GetClassID()) {
+ case CFWL_EventType::TextChanged: {
CFWL_EvtEdtTextChanged* event = (CFWL_EvtEdtTextChanged*)pEvent;
CFX_WideString wsChange;
OnTextChanged(m_pNormalWidget->GetWidget(), wsChange, event->wsPrevText);
break;
}
- case FWL_EVTHASH_EDT_TextFull: {
+ case CFWL_EventType::TextFull: {
OnTextFull(m_pNormalWidget->GetWidget());
break;
}
- case FWL_EVTHASH_EDT_CheckWord: {
+ case CFWL_EventType::CheckWord: {
CFX_WideString wstr(L"FWL_EVENT_DTP_SelectChanged");
CFWL_EvtEdtCheckWord* event = (CFWL_EvtEdtCheckWord*)pEvent;
event->bCheckWord = CheckWord(event->bsWord.AsStringC());
break;
}
- case FWL_EVTHASH_EDT_GetSuggestWords: {
+ case CFWL_EventType::GetSuggestedWords: {
CFWL_EvtEdtGetSuggestWords* event = (CFWL_EvtEdtGetSuggestWords*)pEvent;
event->bSuggestWords = GetSuggestWords(event->bsWord.AsStringC(),
event->bsArraySuggestWords);
break;
}
- default: {}
+ default:
+ break;
}
return m_pOldDelegate->OnProcessEvent(pEvent);
}
+
FWL_ERR CXFA_FFTextEdit::OnDrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) {
return m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
@@ -483,17 +485,17 @@ void CXFA_FFNumericEdit::UpdateWidgetProperty() {
}
m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF);
}
+
FWL_ERR CXFA_FFNumericEdit::OnProcessEvent(CFWL_Event* pEvent) {
- uint32_t dwEventID = pEvent->GetClassID();
- if (dwEventID == FWL_EVTHASH_EDT_Validate) {
+ if (pEvent->GetClassID() == CFWL_EventType::Validate) {
CFWL_EvtEdtValidate* event = (CFWL_EvtEdtValidate*)pEvent;
CFX_WideString wsChange = event->wsInsert;
event->bValidate = OnValidate(m_pNormalWidget->GetWidget(), wsChange);
return event->bValidate;
- } else {
- return CXFA_FFTextEdit::OnProcessEvent(pEvent);
}
+ return CXFA_FFTextEdit::OnProcessEvent(pEvent);
}
+
FX_BOOL CXFA_FFNumericEdit::OnValidate(IFWL_Widget* pWidget,
CFX_WideString& wsText) {
CFX_WideString wsPattern;
@@ -785,14 +787,13 @@ void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget* pWidget,
m_pDataAcc->GetValue(eParam.m_wsNewText, XFA_VALUEPICTURE_Raw);
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam);
}
+
FWL_ERR CXFA_FFDateTimeEdit::OnProcessEvent(CFWL_Event* pEvent) {
- uint32_t dwEventID = pEvent->GetClassID();
- if (dwEventID == FWL_EVTHASH_DTP_SelectChanged) {
+ if (pEvent->GetClassID() == CFWL_EventType::SelectChanged) {
CFWL_Event_DtpSelectChanged* event = (CFWL_Event_DtpSelectChanged*)pEvent;
OnSelectChanged(m_pNormalWidget->GetWidget(), event->iYear, event->iMonth,
event->iDay);
return TRUE;
- } else {
- return CXFA_FFTextEdit::OnProcessEvent(pEvent);
}
+ return CXFA_FFTextEdit::OnProcessEvent(pEvent);
}