From 0ca71ec811e33818d2ccba3221fdb660811b813c Mon Sep 17 00:00:00 2001 From: dsinclair Date: Wed, 19 Oct 2016 07:59:25 -0700 Subject: Remove FWL Create methods, use new instead Review-Url: https://chromiumcodereview.appspot.com/2422303003 --- xfa/fxfa/app/xfa_ffbarcode.cpp | 7 +++---- xfa/fxfa/app/xfa_ffcheckbutton.cpp | 2 +- xfa/fxfa/app/xfa_ffchoicelist.cpp | 4 ++-- xfa/fxfa/app/xfa_ffpushbutton.cpp | 7 +++---- xfa/fxfa/app/xfa_fftextedit.cpp | 8 ++++---- 5 files changed, 13 insertions(+), 15 deletions(-) (limited to 'xfa/fxfa/app') diff --git a/xfa/fxfa/app/xfa_ffbarcode.cpp b/xfa/fxfa/app/xfa_ffbarcode.cpp index 4bb3ba0a4d..42564e92f7 100644 --- a/xfa/fxfa/app/xfa_ffbarcode.cpp +++ b/xfa/fxfa/app/xfa_ffbarcode.cpp @@ -121,10 +121,9 @@ CXFA_FFBarcode::CXFA_FFBarcode(CXFA_FFPageView* pPageView, : CXFA_FFTextEdit(pPageView, pDataAcc) {} CXFA_FFBarcode::~CXFA_FFBarcode() {} FX_BOOL CXFA_FFBarcode::LoadWidget() { - CFWL_Barcode* pFWLBarcode = CFWL_Barcode::Create(); - if (pFWLBarcode) { - pFWLBarcode->Initialize(); - } + CFWL_Barcode* pFWLBarcode = new CFWL_Barcode; + pFWLBarcode->Initialize(); + m_pNormalWidget = pFWLBarcode; m_pNormalWidget->SetLayoutItem(this); IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.cpp b/xfa/fxfa/app/xfa_ffcheckbutton.cpp index 15ff960a15..726abf7f14 100644 --- a/xfa/fxfa/app/xfa_ffcheckbutton.cpp +++ b/xfa/fxfa/app/xfa_ffcheckbutton.cpp @@ -25,7 +25,7 @@ CXFA_FFCheckButton::CXFA_FFCheckButton(CXFA_FFPageView* pPageView, } CXFA_FFCheckButton::~CXFA_FFCheckButton() {} FX_BOOL CXFA_FFCheckButton::LoadWidget() { - CFWL_CheckBox* pCheckBox = CFWL_CheckBox::Create(); + CFWL_CheckBox* pCheckBox = new CFWL_CheckBox; pCheckBox->Initialize(); m_pNormalWidget = pCheckBox; m_pNormalWidget->SetLayoutItem(this); diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp index 641b163ce7..00c83489b2 100644 --- a/xfa/fxfa/app/xfa_ffchoicelist.cpp +++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp @@ -30,7 +30,7 @@ CXFA_FFListBox::~CXFA_FFListBox() { } } FX_BOOL CXFA_FFListBox::LoadWidget() { - CFWL_ListBox* pListBox = CFWL_ListBox::Create(); + CFWL_ListBox* pListBox = new CFWL_ListBox; pListBox->Initialize(); pListBox->ModifyStyles(FWL_WGTSTYLE_VScroll | FWL_WGTSTYLE_NoBackground, 0xFFFFFFFF); @@ -227,7 +227,7 @@ FX_BOOL CXFA_FFComboBox::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { return FALSE; } FX_BOOL CXFA_FFComboBox::LoadWidget() { - CFWL_ComboBox* pComboBox = CFWL_ComboBox::Create(); + CFWL_ComboBox* pComboBox = new CFWL_ComboBox; pComboBox->Initialize(); m_pNormalWidget = (CFWL_Widget*)pComboBox; m_pNormalWidget->SetLayoutItem(this); diff --git a/xfa/fxfa/app/xfa_ffpushbutton.cpp b/xfa/fxfa/app/xfa_ffpushbutton.cpp index cd395b4703..77341cd53e 100644 --- a/xfa/fxfa/app/xfa_ffpushbutton.cpp +++ b/xfa/fxfa/app/xfa_ffpushbutton.cpp @@ -52,10 +52,9 @@ void CXFA_FFPushButton::RenderWidget(CFX_Graphics* pGS, } FX_BOOL CXFA_FFPushButton::LoadWidget() { ASSERT(!m_pNormalWidget); - CFWL_PushButton* pPushButton = CFWL_PushButton::Create(); - if (pPushButton) { - pPushButton->Initialize(); - } + CFWL_PushButton* pPushButton = new CFWL_PushButton; + pPushButton->Initialize(); + m_pOldDelegate = pPushButton->SetDelegate(this); m_pNormalWidget = pPushButton; m_pNormalWidget->SetLayoutItem(this); diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp index 9d0f35e303..bd5b22ff77 100644 --- a/xfa/fxfa/app/xfa_fftextedit.cpp +++ b/xfa/fxfa/app/xfa_fftextedit.cpp @@ -35,7 +35,7 @@ CXFA_FFTextEdit::~CXFA_FFTextEdit() { } } FX_BOOL CXFA_FFTextEdit::LoadWidget() { - CFWL_Edit* pFWLEdit = CFWL_Edit::Create(); + CFWL_Edit* pFWLEdit = new CFWL_Edit; pFWLEdit->Initialize(); m_pNormalWidget = pFWLEdit; m_pNormalWidget->SetLayoutItem(this); @@ -436,7 +436,7 @@ CXFA_FFNumericEdit::CXFA_FFNumericEdit(CXFA_FFPageView* pPageView, : CXFA_FFTextEdit(pPageView, pDataAcc) {} CXFA_FFNumericEdit::~CXFA_FFNumericEdit() {} FX_BOOL CXFA_FFNumericEdit::LoadWidget() { - CFWL_Edit* pWidget = CFWL_Edit::Create(); + CFWL_Edit* pWidget = new CFWL_Edit; pWidget->Initialize(); m_pNormalWidget = pWidget; IFWL_Widget* pIWidget = m_pNormalWidget->GetWidget(); @@ -510,7 +510,7 @@ CXFA_FFPasswordEdit::CXFA_FFPasswordEdit(CXFA_FFPageView* pPageView, : CXFA_FFTextEdit(pPageView, pDataAcc) {} CXFA_FFPasswordEdit::~CXFA_FFPasswordEdit() {} FX_BOOL CXFA_FFPasswordEdit::LoadWidget() { - CFWL_Edit* pWidget = CFWL_Edit::Create(); + CFWL_Edit* pWidget = new CFWL_Edit; pWidget->Initialize(); m_pNormalWidget = pWidget; m_pNormalWidget->SetLayoutItem(this); @@ -576,7 +576,7 @@ FX_BOOL CXFA_FFDateTimeEdit::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { return FALSE; } FX_BOOL CXFA_FFDateTimeEdit::LoadWidget() { - CFWL_DateTimePicker* pWidget = CFWL_DateTimePicker::Create(); + CFWL_DateTimePicker* pWidget = new CFWL_DateTimePicker; pWidget->Initialize(); m_pNormalWidget = pWidget; m_pNormalWidget->SetLayoutItem(this); -- cgit v1.2.3