diff options
author | dsinclair <dsinclair@chromium.org> | 2016-11-01 08:33:02 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-01 08:33:02 -0700 |
commit | 9ec22175f945d227e71c459e7e0b7c464159c18b (patch) | |
tree | 1c4836aa35a9e8a1da1761562088b1f9df6aa94f /xfa/fxfa/app/xfa_ffchoicelist.cpp | |
parent | 5a22582ca1dbe1d66b18d5253bfa1d202fcc3b4a (diff) | |
download | pdfium-9ec22175f945d227e71c459e7e0b7c464159c18b.tar.xz |
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
Diffstat (limited to 'xfa/fxfa/app/xfa_ffchoicelist.cpp')
-rw-r--r-- | xfa/fxfa/app/xfa_ffchoicelist.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp index 0c6c22c815..06bbc38eb9 100644 --- a/xfa/fxfa/app/xfa_ffchoicelist.cpp +++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp @@ -42,8 +42,11 @@ FX_BOOL CXFA_FFListBox::LoadWidget() { IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); CFWL_NoteDriver* pNoteDriver = pWidget->GetOwnerApp()->GetNoteDriver(); pNoteDriver->RegisterEventTarget(pWidget, pWidget); - m_pOldDelegate = m_pNormalWidget->SetDelegate(this); + + m_pOldDelegate = m_pNormalWidget->GetCurrentDelegate(); + m_pNormalWidget->SetCurrentDelegate(this); m_pNormalWidget->LockUpdate(); + CFX_WideStringArray wsLabelArray; m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE); int32_t iItems = wsLabelArray.GetSize(); @@ -238,8 +241,11 @@ FX_BOOL CXFA_FFComboBox::LoadWidget() { IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); CFWL_NoteDriver* pNoteDriver = pWidget->GetOwnerApp()->GetNoteDriver(); pNoteDriver->RegisterEventTarget(pWidget, pWidget); - m_pOldDelegate = m_pNormalWidget->SetDelegate(this); + + m_pOldDelegate = m_pNormalWidget->GetCurrentDelegate(); + m_pNormalWidget->SetCurrentDelegate(this); m_pNormalWidget->LockUpdate(); + CFX_WideStringArray wsLabelArray; m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE); int32_t iItems = wsLabelArray.GetSize(); |