diff options
author | dsinclair <dsinclair@chromium.org> | 2016-10-31 07:29:34 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-31 07:29:34 -0700 |
commit | 20855384b8149a631c3c1d229551523c12eb767b (patch) | |
tree | e3cef278e322742bea6c4b48f40ed580754ebd80 /xfa/fxfa/app/xfa_ffchoicelist.cpp | |
parent | 747dcf775c5cb661e96a639f73322cc489d8590f (diff) | |
download | pdfium-20855384b8149a631c3c1d229551523c12eb767b.tar.xz |
Remove FWL globals.
This CL removes the FWL_GetApp, FWL_SetApp and FWL_GetWidgetAdapter methods.
In the process it changes the various Initialize methods to return void.
Review-Url: https://codereview.chromium.org/2436103002
Diffstat (limited to 'xfa/fxfa/app/xfa_ffchoicelist.cpp')
-rw-r--r-- | xfa/fxfa/app/xfa_ffchoicelist.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp index 699f890d52..26efee94b1 100644 --- a/xfa/fxfa/app/xfa_ffchoicelist.cpp +++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp @@ -22,22 +22,25 @@ CXFA_FFListBox::CXFA_FFListBox(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) {} + CXFA_FFListBox::~CXFA_FFListBox() { if (m_pNormalWidget) { IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); - CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); + CFWL_NoteDriver* pNoteDriver = pWidget->GetOwnerApp()->GetNoteDriver(); pNoteDriver->UnregisterEventTarget(pWidget); } } + FX_BOOL CXFA_FFListBox::LoadWidget() { - CFWL_ListBox* pListBox = new CFWL_ListBox; - pListBox->Initialize(); + CFWL_ListBox* pListBox = new CFWL_ListBox(GetFWLApp()); + pListBox->Initialize(nullptr); pListBox->ModifyStyles(FWL_WGTSTYLE_VScroll | FWL_WGTSTYLE_NoBackground, 0xFFFFFFFF); m_pNormalWidget = (CFWL_Widget*)pListBox; m_pNormalWidget->SetLayoutItem(this); + IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); - CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); + CFWL_NoteDriver* pNoteDriver = pWidget->GetOwnerApp()->GetNoteDriver(); pNoteDriver->RegisterEventTarget(pWidget, pWidget); m_pOldDelegate = m_pNormalWidget->SetDelegate(this); m_pNormalWidget->LockUpdate(); @@ -227,12 +230,13 @@ FX_BOOL CXFA_FFComboBox::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { return FALSE; } FX_BOOL CXFA_FFComboBox::LoadWidget() { - CFWL_ComboBox* pComboBox = new CFWL_ComboBox; - pComboBox->Initialize(); + CFWL_ComboBox* pComboBox = new CFWL_ComboBox(GetFWLApp()); + pComboBox->Initialize(nullptr); m_pNormalWidget = (CFWL_Widget*)pComboBox; m_pNormalWidget->SetLayoutItem(this); + IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); - CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); + CFWL_NoteDriver* pNoteDriver = pWidget->GetOwnerApp()->GetNoteDriver(); pNoteDriver->RegisterEventTarget(pWidget, pWidget); m_pOldDelegate = m_pNormalWidget->SetDelegate(this); m_pNormalWidget->LockUpdate(); |