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/fxfa/app/xfa_ffpushbutton.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xfa/fxfa/app/xfa_ffpushbutton.cpp') diff --git a/xfa/fxfa/app/xfa_ffpushbutton.cpp b/xfa/fxfa/app/xfa_ffpushbutton.cpp index 527cfbc239..e648581011 100644 --- a/xfa/fxfa/app/xfa_ffpushbutton.cpp +++ b/xfa/fxfa/app/xfa_ffpushbutton.cpp @@ -55,7 +55,9 @@ FX_BOOL CXFA_FFPushButton::LoadWidget() { CFWL_PushButton* pPushButton = new CFWL_PushButton(GetFWLApp()); pPushButton->Initialize(); - m_pOldDelegate = pPushButton->SetDelegate(this); + m_pOldDelegate = pPushButton->GetCurrentDelegate(); + pPushButton->SetCurrentDelegate(this); + m_pNormalWidget = pPushButton; m_pNormalWidget->SetLayoutItem(this); IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); -- cgit v1.2.3