From 9ec22175f945d227e71c459e7e0b7c464159c18b Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 1 Nov 2016 08:33:02 -0700 Subject: Rename IFWL_Widget::SetDelegate The ::SetDelegate method was misleading. The primary use was SetDelegate(nullptr) which returned the current delegate and didn't actually set anything. When a value was passed it would set the |m_pCurDelegate| not the |m_pDelegate|. This Cl breaks ::SetDelegate into ::GetCurrentDelegate and ::SetCurrentDelegate to make it clear what is happening and that this does not effect the |m_pDelegate| variable. Review-Url: https://codereview.chromium.org/2459423003 --- xfa/fwl/core/ifwl_combolist.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'xfa/fwl/core/ifwl_combolist.cpp') diff --git a/xfa/fwl/core/ifwl_combolist.cpp b/xfa/fwl/core/ifwl_combolist.cpp index 6538bff20d..23392a5c70 100644 --- a/xfa/fwl/core/ifwl_combolist.cpp +++ b/xfa/fwl/core/ifwl_combolist.cpp @@ -124,9 +124,8 @@ void CFWL_ComboListImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) { pMsg->m_fx -= rect.left; pMsg->m_fy -= rect.top; - IFWL_WidgetDelegate* pDelegate = - m_pOwner->m_pVertScrollBar->SetDelegate(nullptr); - pDelegate->OnProcessMessage(pMsg); + m_pOwner->m_pVertScrollBar->GetCurrentDelegate()->OnProcessMessage( + pMsg); return; } } @@ -246,7 +245,6 @@ int32_t CFWL_ComboListImpDelegate::OnDropListKey(CFWL_MsgKey* pKey) { case FWL_VKEY_Up: case FWL_VKEY_Down: { OnDropListKeyDown(pKey); - pOuter->SetDelegate(nullptr); pOuter->ProcessSelChanged(FALSE); return 1; } -- cgit v1.2.3