From 96c7b33510c5d48ef5707326de88b35dcd2e4b45 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Mon, 31 Oct 2016 09:44:45 -0700 Subject: Remove unused parameter to CFWL_* Initialize methods. This parameter is always nullptr, removed. Review-Url: https://codereview.chromium.org/2463073002 --- xfa/fwl/core/cfwl_barcode.cpp | 8 ++------ xfa/fwl/core/cfwl_barcode.h | 2 +- xfa/fwl/core/cfwl_checkbox.cpp | 7 ++----- xfa/fwl/core/cfwl_checkbox.h | 2 +- xfa/fwl/core/cfwl_combobox.cpp | 7 ++----- xfa/fwl/core/cfwl_combobox.h | 2 +- xfa/fwl/core/cfwl_datetimepicker.cpp | 7 ++----- xfa/fwl/core/cfwl_datetimepicker.h | 2 +- xfa/fwl/core/cfwl_edit.cpp | 7 ++----- xfa/fwl/core/cfwl_edit.h | 2 +- xfa/fwl/core/cfwl_listbox.cpp | 7 ++----- xfa/fwl/core/cfwl_listbox.h | 2 +- xfa/fwl/core/cfwl_picturebox.cpp | 7 ++----- xfa/fwl/core/cfwl_picturebox.h | 2 +- xfa/fwl/core/cfwl_pushbutton.cpp | 7 ++----- xfa/fwl/core/cfwl_pushbutton.h | 2 +- xfa/fwl/core/cfwl_widget.cpp | 2 +- xfa/fwl/core/cfwl_widget.h | 2 +- xfa/fxfa/app/xfa_ffbarcode.cpp | 2 +- xfa/fxfa/app/xfa_ffcheckbutton.cpp | 2 +- xfa/fxfa/app/xfa_ffchoicelist.cpp | 4 ++-- xfa/fxfa/app/xfa_ffimageedit.cpp | 2 +- xfa/fxfa/app/xfa_ffpushbutton.cpp | 2 +- xfa/fxfa/app/xfa_fftextedit.cpp | 8 ++++---- 24 files changed, 36 insertions(+), 61 deletions(-) diff --git a/xfa/fwl/core/cfwl_barcode.cpp b/xfa/fwl/core/cfwl_barcode.cpp index c17185990e..996667d874 100644 --- a/xfa/fwl/core/cfwl_barcode.cpp +++ b/xfa/fwl/core/cfwl_barcode.cpp @@ -12,18 +12,14 @@ CFWL_Barcode::CFWL_Barcode(const IFWL_App* app) : CFWL_Edit(app) {} CFWL_Barcode::~CFWL_Barcode() {} -void CFWL_Barcode::Initialize(const CFWL_WidgetProperties* pProperties) { +void CFWL_Barcode::Initialize() { ASSERT(!m_pIface); - - if (pProperties) - *m_pProperties = *pProperties; - std::unique_ptr pBarcode(new IFWL_Barcode( m_pApp, m_pProperties->MakeWidgetImpProperties(&m_barcodeData))); pBarcode->Initialize(); m_pIface = std::move(pBarcode); - CFWL_Widget::Initialize(pProperties); + CFWL_Widget::Initialize(); } IFWL_Barcode* CFWL_Barcode::GetWidget() { diff --git a/xfa/fwl/core/cfwl_barcode.h b/xfa/fwl/core/cfwl_barcode.h index c2bf38ad40..b610a27f51 100644 --- a/xfa/fwl/core/cfwl_barcode.h +++ b/xfa/fwl/core/cfwl_barcode.h @@ -22,7 +22,7 @@ class CFWL_Barcode : public CFWL_Edit { IFWL_Barcode* GetWidget() override; const IFWL_Barcode* GetWidget() const override; - void Initialize(const CFWL_WidgetProperties* pProperties); + void Initialize(); void SetType(BC_TYPE type); FX_BOOL IsProtectedType(); diff --git a/xfa/fwl/core/cfwl_checkbox.cpp b/xfa/fwl/core/cfwl_checkbox.cpp index 8ae3e970e3..e1ff84f2d6 100644 --- a/xfa/fwl/core/cfwl_checkbox.cpp +++ b/xfa/fwl/core/cfwl_checkbox.cpp @@ -14,18 +14,15 @@ CFWL_CheckBox::CFWL_CheckBox(const IFWL_App* app) : CFWL_Widget(app) {} CFWL_CheckBox::~CFWL_CheckBox() {} -void CFWL_CheckBox::Initialize(const CFWL_WidgetProperties* pProperties) { +void CFWL_CheckBox::Initialize() { ASSERT(!m_pIface); - if (pProperties) - *m_pProperties = *pProperties; - std::unique_ptr pCheckBox(new IFWL_CheckBox( m_pApp, m_pProperties->MakeWidgetImpProperties(&m_checkboxData))); pCheckBox->Initialize(); m_pIface = std::move(pCheckBox); - CFWL_Widget::Initialize(pProperties); + CFWL_Widget::Initialize(); } IFWL_CheckBox* CFWL_CheckBox::GetWidget() { diff --git a/xfa/fwl/core/cfwl_checkbox.h b/xfa/fwl/core/cfwl_checkbox.h index e17e6b5ef7..058c76be04 100644 --- a/xfa/fwl/core/cfwl_checkbox.h +++ b/xfa/fwl/core/cfwl_checkbox.h @@ -18,7 +18,7 @@ class CFWL_CheckBox : public CFWL_Widget { IFWL_CheckBox* GetWidget() override; const IFWL_CheckBox* GetWidget() const override; - void Initialize(const CFWL_WidgetProperties* pProperties); + void Initialize(); FWL_Error SetCaption(const CFX_WideStringC& wsCaption); FWL_Error SetBoxSize(FX_FLOAT fHeight); diff --git a/xfa/fwl/core/cfwl_combobox.cpp b/xfa/fwl/core/cfwl_combobox.cpp index 825df9c538..d873d6b06e 100644 --- a/xfa/fwl/core/cfwl_combobox.cpp +++ b/xfa/fwl/core/cfwl_combobox.cpp @@ -15,18 +15,15 @@ CFWL_ComboBox::CFWL_ComboBox(const IFWL_App* app) : CFWL_Widget(app) {} CFWL_ComboBox::~CFWL_ComboBox() {} -void CFWL_ComboBox::Initialize(const CFWL_WidgetProperties* pProperties) { +void CFWL_ComboBox::Initialize() { ASSERT(!m_pIface); - if (pProperties) - *m_pProperties = *pProperties; - std::unique_ptr pComboBox(new IFWL_ComboBox( m_pApp, m_pProperties->MakeWidgetImpProperties(&m_comboBoxData))); pComboBox->Initialize(); m_pIface = std::move(pComboBox); - CFWL_Widget::Initialize(pProperties); + CFWL_Widget::Initialize(); } IFWL_ComboBox* CFWL_ComboBox::GetWidget() { diff --git a/xfa/fwl/core/cfwl_combobox.h b/xfa/fwl/core/cfwl_combobox.h index bb19e55653..3a4d854442 100644 --- a/xfa/fwl/core/cfwl_combobox.h +++ b/xfa/fwl/core/cfwl_combobox.h @@ -26,7 +26,7 @@ class CFWL_ComboBox : public CFWL_Widget { IFWL_ComboBox* GetWidget() override; const IFWL_ComboBox* GetWidget() const override; - void Initialize(const CFWL_WidgetProperties* pProperties); + void Initialize(); int32_t AddString(const CFX_WideStringC& wsText); int32_t AddString(const CFX_WideStringC& wsText, CFX_DIBitmap* pIcon); diff --git a/xfa/fwl/core/cfwl_datetimepicker.cpp b/xfa/fwl/core/cfwl_datetimepicker.cpp index ebfcee62ba..8a0e8eba35 100644 --- a/xfa/fwl/core/cfwl_datetimepicker.cpp +++ b/xfa/fwl/core/cfwl_datetimepicker.cpp @@ -17,18 +17,15 @@ CFWL_DateTimePicker::CFWL_DateTimePicker(const IFWL_App* app) CFWL_DateTimePicker::~CFWL_DateTimePicker() {} -void CFWL_DateTimePicker::Initialize(const CFWL_WidgetProperties* pProperties) { +void CFWL_DateTimePicker::Initialize() { ASSERT(!m_pIface); - if (pProperties) - *m_pProperties = *pProperties; - std::unique_ptr pDateTimePicker(new IFWL_DateTimePicker( m_pApp, m_pProperties->MakeWidgetImpProperties(&m_DateTimePickerDP))); pDateTimePicker->Initialize(); m_pIface = std::move(pDateTimePicker); - CFWL_Widget::Initialize(pProperties); + CFWL_Widget::Initialize(); } IFWL_DateTimePicker* CFWL_DateTimePicker::GetWidget() { diff --git a/xfa/fwl/core/cfwl_datetimepicker.h b/xfa/fwl/core/cfwl_datetimepicker.h index 2de57add80..5091713dc2 100644 --- a/xfa/fwl/core/cfwl_datetimepicker.h +++ b/xfa/fwl/core/cfwl_datetimepicker.h @@ -18,7 +18,7 @@ class CFWL_DateTimePicker : public CFWL_Widget { IFWL_DateTimePicker* GetWidget() override; const IFWL_DateTimePicker* GetWidget() const override; - void Initialize(const CFWL_WidgetProperties* pProperties); + void Initialize(); FWL_Error SetToday(int32_t iYear, int32_t iMonth, int32_t iDay); FWL_Error GetEditText(CFX_WideString& wsText); diff --git a/xfa/fwl/core/cfwl_edit.cpp b/xfa/fwl/core/cfwl_edit.cpp index d0936a65b7..50f99fe090 100644 --- a/xfa/fwl/core/cfwl_edit.cpp +++ b/xfa/fwl/core/cfwl_edit.cpp @@ -13,18 +13,15 @@ CFWL_Edit::CFWL_Edit(const IFWL_App* app) : CFWL_Widget(app) {} CFWL_Edit::~CFWL_Edit() {} -void CFWL_Edit::Initialize(const CFWL_WidgetProperties* pProperties) { +void CFWL_Edit::Initialize() { ASSERT(!m_pIface); - if (pProperties) - *m_pProperties = *pProperties; - std::unique_ptr pEdit(new IFWL_Edit( m_pApp, m_pProperties->MakeWidgetImpProperties(nullptr), nullptr)); pEdit->Initialize(); m_pIface = std::move(pEdit); - CFWL_Widget::Initialize(pProperties); + CFWL_Widget::Initialize(); } IFWL_Edit* CFWL_Edit::GetWidget() { diff --git a/xfa/fwl/core/cfwl_edit.h b/xfa/fwl/core/cfwl_edit.h index ceeb95f325..016ac8f9da 100644 --- a/xfa/fwl/core/cfwl_edit.h +++ b/xfa/fwl/core/cfwl_edit.h @@ -23,7 +23,7 @@ class CFWL_Edit : public CFWL_Widget { IFWL_Edit* GetWidget() override; const IFWL_Edit* GetWidget() const override; - void Initialize(const CFWL_WidgetProperties* pProperties); + void Initialize(); FWL_Error SetText(const CFX_WideString& wsText); int32_t GetTextLength() const; diff --git a/xfa/fwl/core/cfwl_listbox.cpp b/xfa/fwl/core/cfwl_listbox.cpp index f8a5e199c2..5820a27926 100644 --- a/xfa/fwl/core/cfwl_listbox.cpp +++ b/xfa/fwl/core/cfwl_listbox.cpp @@ -14,18 +14,15 @@ CFWL_ListBox::CFWL_ListBox(const IFWL_App* app) : CFWL_Widget(app) {} CFWL_ListBox::~CFWL_ListBox() {} -void CFWL_ListBox::Initialize(const CFWL_WidgetProperties* pProperties) { +void CFWL_ListBox::Initialize() { ASSERT(!m_pIface); - if (pProperties) - *m_pProperties = *pProperties; - std::unique_ptr pListBox(new IFWL_ListBox( m_pApp, m_pProperties->MakeWidgetImpProperties(&m_ListBoxDP), nullptr)); pListBox->Initialize(); m_pIface = std::move(pListBox); - CFWL_Widget::Initialize(pProperties); + CFWL_Widget::Initialize(); } IFWL_ListBox* CFWL_ListBox::GetWidget() { diff --git a/xfa/fwl/core/cfwl_listbox.h b/xfa/fwl/core/cfwl_listbox.h index 872ac722db..436e8372bc 100644 --- a/xfa/fwl/core/cfwl_listbox.h +++ b/xfa/fwl/core/cfwl_listbox.h @@ -25,7 +25,7 @@ class CFWL_ListBox : public CFWL_Widget { IFWL_ListBox* GetWidget() override; const IFWL_ListBox* GetWidget() const override; - void Initialize(const CFWL_WidgetProperties* pProperties); + void Initialize(); FWL_Error AddDIBitmap(CFX_DIBitmap* pDIB, IFWL_ListItem* pItem); IFWL_ListItem* AddString(const CFX_WideStringC& wsAdd, diff --git a/xfa/fwl/core/cfwl_picturebox.cpp b/xfa/fwl/core/cfwl_picturebox.cpp index 8210db2562..de6bf737b6 100644 --- a/xfa/fwl/core/cfwl_picturebox.cpp +++ b/xfa/fwl/core/cfwl_picturebox.cpp @@ -12,18 +12,15 @@ CFWL_PictureBox::CFWL_PictureBox(const IFWL_App* app) : CFWL_Widget(app) {} CFWL_PictureBox::~CFWL_PictureBox() {} -void CFWL_PictureBox::Initialize(const CFWL_WidgetProperties* pProperties) { +void CFWL_PictureBox::Initialize() { ASSERT(!m_pIface); - if (pProperties) - *m_pProperties = *pProperties; - std::unique_ptr pPictureBox(new IFWL_PictureBox( m_pApp, m_pProperties->MakeWidgetImpProperties(&m_PictureBoxDP))); pPictureBox->Initialize(); m_pIface = std::move(pPictureBox); - CFWL_Widget::Initialize(pProperties); + CFWL_Widget::Initialize(); } IFWL_PictureBox* CFWL_PictureBox::GetWidget() { diff --git a/xfa/fwl/core/cfwl_picturebox.h b/xfa/fwl/core/cfwl_picturebox.h index 2338009cc1..d64be21e06 100644 --- a/xfa/fwl/core/cfwl_picturebox.h +++ b/xfa/fwl/core/cfwl_picturebox.h @@ -19,7 +19,7 @@ class CFWL_PictureBox : public CFWL_Widget { IFWL_PictureBox* GetWidget() override; const IFWL_PictureBox* GetWidget() const override; - void Initialize(const CFWL_WidgetProperties* pProperties); + void Initialize(); CFX_DIBitmap* GetPicture(); FWL_Error SetPicture(CFX_DIBitmap* pBitmap); diff --git a/xfa/fwl/core/cfwl_pushbutton.cpp b/xfa/fwl/core/cfwl_pushbutton.cpp index 0930f93aa0..2d03e86412 100644 --- a/xfa/fwl/core/cfwl_pushbutton.cpp +++ b/xfa/fwl/core/cfwl_pushbutton.cpp @@ -12,18 +12,15 @@ CFWL_PushButton::CFWL_PushButton(const IFWL_App* app) : CFWL_Widget(app) {} CFWL_PushButton::~CFWL_PushButton() {} -void CFWL_PushButton::Initialize(const CFWL_WidgetProperties* pProperties) { +void CFWL_PushButton::Initialize() { ASSERT(!m_pIface); - if (pProperties) - *m_pProperties = *pProperties; - std::unique_ptr pPushButton(new IFWL_PushButton( m_pApp, m_pProperties->MakeWidgetImpProperties(&m_buttonData))); pPushButton->Initialize(); m_pIface = std::move(pPushButton); - CFWL_Widget::Initialize(pProperties); + CFWL_Widget::Initialize(); } IFWL_PushButton* CFWL_PushButton::GetWidget() { diff --git a/xfa/fwl/core/cfwl_pushbutton.h b/xfa/fwl/core/cfwl_pushbutton.h index 44106d3c2c..c20e5539af 100644 --- a/xfa/fwl/core/cfwl_pushbutton.h +++ b/xfa/fwl/core/cfwl_pushbutton.h @@ -18,7 +18,7 @@ class CFWL_PushButton : public CFWL_Widget { IFWL_PushButton* GetWidget() override; const IFWL_PushButton* GetWidget() const override; - void Initialize(const CFWL_WidgetProperties* pProperties); + void Initialize(); FWL_Error GetCaption(CFX_WideString& wsCaption); FWL_Error SetCaption(const CFX_WideStringC& wsCaption); diff --git a/xfa/fwl/core/cfwl_widget.cpp b/xfa/fwl/core/cfwl_widget.cpp index d7903ea8a8..9aeb127e9e 100644 --- a/xfa/fwl/core/cfwl_widget.cpp +++ b/xfa/fwl/core/cfwl_widget.cpp @@ -31,7 +31,7 @@ CFWL_Widget::~CFWL_Widget() { m_pIface->Finalize(); } -void CFWL_Widget::Initialize(const CFWL_WidgetProperties* pProperties) { +void CFWL_Widget::Initialize() { ASSERT(m_pIface); m_pIface->SetAssociateWidget(this); } diff --git a/xfa/fwl/core/cfwl_widget.h b/xfa/fwl/core/cfwl_widget.h index b96c1ffaec..bf8f98e6e7 100644 --- a/xfa/fwl/core/cfwl_widget.h +++ b/xfa/fwl/core/cfwl_widget.h @@ -54,7 +54,7 @@ class CFWL_Widget { IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); protected: - void Initialize(const CFWL_WidgetProperties* pProperties); + void Initialize(); const IFWL_App* m_pApp; std::unique_ptr m_pIface; diff --git a/xfa/fxfa/app/xfa_ffbarcode.cpp b/xfa/fxfa/app/xfa_ffbarcode.cpp index e684d9c8b9..efe9912f02 100644 --- a/xfa/fxfa/app/xfa_ffbarcode.cpp +++ b/xfa/fxfa/app/xfa_ffbarcode.cpp @@ -124,7 +124,7 @@ CXFA_FFBarcode::~CXFA_FFBarcode() {} FX_BOOL CXFA_FFBarcode::LoadWidget() { CFWL_Barcode* pFWLBarcode = new CFWL_Barcode(GetFWLApp()); - pFWLBarcode->Initialize(nullptr); + pFWLBarcode->Initialize(); m_pNormalWidget = pFWLBarcode; m_pNormalWidget->SetLayoutItem(this); diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.cpp b/xfa/fxfa/app/xfa_ffcheckbutton.cpp index 7756506975..829900fa22 100644 --- a/xfa/fxfa/app/xfa_ffcheckbutton.cpp +++ b/xfa/fxfa/app/xfa_ffcheckbutton.cpp @@ -28,7 +28,7 @@ CXFA_FFCheckButton::~CXFA_FFCheckButton() {} FX_BOOL CXFA_FFCheckButton::LoadWidget() { CFWL_CheckBox* pCheckBox = new CFWL_CheckBox(GetFWLApp()); - pCheckBox->Initialize(nullptr); + 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 26efee94b1..0c6c22c815 100644 --- a/xfa/fxfa/app/xfa_ffchoicelist.cpp +++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp @@ -33,7 +33,7 @@ CXFA_FFListBox::~CXFA_FFListBox() { FX_BOOL CXFA_FFListBox::LoadWidget() { CFWL_ListBox* pListBox = new CFWL_ListBox(GetFWLApp()); - pListBox->Initialize(nullptr); + pListBox->Initialize(); pListBox->ModifyStyles(FWL_WGTSTYLE_VScroll | FWL_WGTSTYLE_NoBackground, 0xFFFFFFFF); m_pNormalWidget = (CFWL_Widget*)pListBox; @@ -231,7 +231,7 @@ FX_BOOL CXFA_FFComboBox::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { } FX_BOOL CXFA_FFComboBox::LoadWidget() { CFWL_ComboBox* pComboBox = new CFWL_ComboBox(GetFWLApp()); - pComboBox->Initialize(nullptr); + pComboBox->Initialize(); m_pNormalWidget = (CFWL_Widget*)pComboBox; m_pNormalWidget->SetLayoutItem(this); diff --git a/xfa/fxfa/app/xfa_ffimageedit.cpp b/xfa/fxfa/app/xfa_ffimageedit.cpp index e8dd6fde79..9624ee2fbb 100644 --- a/xfa/fxfa/app/xfa_ffimageedit.cpp +++ b/xfa/fxfa/app/xfa_ffimageedit.cpp @@ -24,7 +24,7 @@ CXFA_FFImageEdit::~CXFA_FFImageEdit() { } FX_BOOL CXFA_FFImageEdit::LoadWidget() { CFWL_PictureBox* pPictureBox = new CFWL_PictureBox(GetFWLApp()); - pPictureBox->Initialize(nullptr); + pPictureBox->Initialize(); m_pNormalWidget = pPictureBox; m_pNormalWidget->SetLayoutItem(this); diff --git a/xfa/fxfa/app/xfa_ffpushbutton.cpp b/xfa/fxfa/app/xfa_ffpushbutton.cpp index 0b00a7b12b..527cfbc239 100644 --- a/xfa/fxfa/app/xfa_ffpushbutton.cpp +++ b/xfa/fxfa/app/xfa_ffpushbutton.cpp @@ -53,7 +53,7 @@ void CXFA_FFPushButton::RenderWidget(CFX_Graphics* pGS, FX_BOOL CXFA_FFPushButton::LoadWidget() { ASSERT(!m_pNormalWidget); CFWL_PushButton* pPushButton = new CFWL_PushButton(GetFWLApp()); - pPushButton->Initialize(nullptr); + pPushButton->Initialize(); m_pOldDelegate = pPushButton->SetDelegate(this); m_pNormalWidget = pPushButton; diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp index 8bb6ea4c03..1546641a7f 100644 --- a/xfa/fxfa/app/xfa_fftextedit.cpp +++ b/xfa/fxfa/app/xfa_fftextedit.cpp @@ -38,7 +38,7 @@ CXFA_FFTextEdit::~CXFA_FFTextEdit() { FX_BOOL CXFA_FFTextEdit::LoadWidget() { CFWL_Edit* pFWLEdit = new CFWL_Edit(GetFWLApp()); - pFWLEdit->Initialize(nullptr); + pFWLEdit->Initialize(); m_pNormalWidget = pFWLEdit; m_pNormalWidget->SetLayoutItem(this); @@ -440,7 +440,7 @@ CXFA_FFNumericEdit::CXFA_FFNumericEdit(CXFA_FFPageView* pPageView, CXFA_FFNumericEdit::~CXFA_FFNumericEdit() {} FX_BOOL CXFA_FFNumericEdit::LoadWidget() { CFWL_Edit* pWidget = new CFWL_Edit(GetFWLApp()); - pWidget->Initialize(nullptr); + pWidget->Initialize(); m_pNormalWidget = pWidget; IFWL_Widget* pIWidget = m_pNormalWidget->GetWidget(); @@ -517,7 +517,7 @@ CXFA_FFPasswordEdit::~CXFA_FFPasswordEdit() {} FX_BOOL CXFA_FFPasswordEdit::LoadWidget() { CFWL_Edit* pWidget = new CFWL_Edit(GetFWLApp()); - pWidget->Initialize(nullptr); + pWidget->Initialize(); m_pNormalWidget = pWidget; m_pNormalWidget->SetLayoutItem(this); @@ -584,7 +584,7 @@ FX_BOOL CXFA_FFDateTimeEdit::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { } FX_BOOL CXFA_FFDateTimeEdit::LoadWidget() { CFWL_DateTimePicker* pWidget = new CFWL_DateTimePicker(GetFWLApp()); - pWidget->Initialize(nullptr); + pWidget->Initialize(); m_pNormalWidget = pWidget; m_pNormalWidget->SetLayoutItem(this); IFWL_Widget* pIWidget = m_pNormalWidget->GetWidget(); -- cgit v1.2.3