Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1261)

Unified Diff: xfa/fwl/core/ifwl_combobox.cpp

Issue 2466273003: Change IFWL_Widget to store a single delegate. (Closed)
Patch Set: Fix Mac Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/core/fwl_noteimp.cpp ('k') | xfa/fwl/core/ifwl_combolist.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/ifwl_combobox.cpp
diff --git a/xfa/fwl/core/ifwl_combobox.cpp b/xfa/fwl/core/ifwl_combobox.cpp
index 28a5977425a3c588673228bf10ef3eed2690ad17..3680bdfb79e702468c3e2d479ce2991d7ae6f8a4 100644
--- a/xfa/fwl/core/ifwl_combobox.cpp
+++ b/xfa/fwl/core/ifwl_combobox.cpp
@@ -465,7 +465,7 @@ void IFWL_ComboBox::ShowDropList(FX_BOOL bActivate) {
if (!m_pForm) {
InitProxyForm();
}
- m_pListProxyDelegate->Reset();
+ static_cast<CFWL_ComboProxyImpDelegate*>(m_pForm->GetDelegate())->Reset();
if (bActivate) {
m_pListBox->ChangeSelected(m_iCurSel);
ReSetListItemAlignment();
@@ -701,8 +701,8 @@ void IFWL_ComboBox::InitProxyForm() {
m_pForm = new IFWL_FormProxy(m_pOwnerApp, propForm, m_pListBox.get());
m_pListBox->SetParent(m_pForm);
- m_pListProxyDelegate = new CFWL_ComboProxyImpDelegate(m_pForm, this);
- m_pForm->SetCurrentDelegate(m_pListProxyDelegate);
+ m_pForm->SetDelegate(
+ pdfium::MakeUnique<CFWL_ComboProxyImpDelegate>(m_pForm, this));
}
void IFWL_ComboBox::DisForm_InitComboList() {
@@ -1141,7 +1141,7 @@ void CFWL_ComboBoxImpDelegate::DoSubCtrlKey(CFWL_MsgKey* pMsg) {
}
FX_BOOL bDropDown = m_pOwner->IsDropDownStyle();
if (bDropDown)
- m_pOwner->m_pEdit->GetCurrentDelegate()->OnProcessMessage(pMsg);
+ m_pOwner->m_pEdit->GetDelegate()->OnProcessMessage(pMsg);
}
void CFWL_ComboBoxImpDelegate::DisForm_OnProcessMessage(
@@ -1190,8 +1190,7 @@ void CFWL_ComboBoxImpDelegate::DisForm_OnProcessMessage(
pKey->m_dwKeyCode == FWL_VKEY_Return ||
pKey->m_dwKeyCode == FWL_VKEY_Escape;
if (bListKey) {
- m_pOwner->m_pListBox->GetCurrentDelegate()->OnProcessMessage(
- pMessage);
+ m_pOwner->m_pListBox->GetDelegate()->OnProcessMessage(pMessage);
break;
}
}
@@ -1231,7 +1230,7 @@ void CFWL_ComboBoxImpDelegate::DisForm_OnFocusChanged(CFWL_Message* pMsg,
CFWL_MsgSetFocus msg;
msg.m_pDstTarget = m_pOwner->m_pEdit.get();
msg.m_pSrcTarget = nullptr;
- m_pOwner->m_pEdit->GetCurrentDelegate()->OnProcessMessage(&msg);
+ m_pOwner->m_pEdit->GetDelegate()->OnProcessMessage(&msg);
}
} else {
m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused;
@@ -1239,7 +1238,7 @@ void CFWL_ComboBoxImpDelegate::DisForm_OnFocusChanged(CFWL_Message* pMsg,
CFWL_MsgKillFocus msg;
msg.m_pDstTarget = nullptr;
msg.m_pSrcTarget = m_pOwner->m_pEdit.get();
- m_pOwner->m_pEdit->GetCurrentDelegate()->OnProcessMessage(&msg);
+ m_pOwner->m_pEdit->GetDelegate()->OnProcessMessage(&msg);
}
}
@@ -1283,7 +1282,7 @@ void CFWL_ComboBoxImpDelegate::DisForm_OnKey(CFWL_MsgKey* pMsg) {
return;
}
if (m_pOwner->m_pEdit)
- m_pOwner->m_pEdit->GetCurrentDelegate()->OnProcessMessage(pMsg);
+ m_pOwner->m_pEdit->GetDelegate()->OnProcessMessage(pMsg);
}
CFWL_ComboProxyImpDelegate::CFWL_ComboProxyImpDelegate(IFWL_Form* pForm,
« no previous file with comments | « xfa/fwl/core/fwl_noteimp.cpp ('k') | xfa/fwl/core/ifwl_combolist.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698