diff options
author | dsinclair <dsinclair@chromium.org> | 2016-10-19 07:59:25 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-19 07:59:25 -0700 |
commit | 0ca71ec811e33818d2ccba3221fdb660811b813c (patch) | |
tree | d94dce266dd67bbe94f5c73960734e7b5b691dd1 | |
parent | c273e8f5006aa7d91d37a5da021dbbabb8721e5b (diff) | |
download | pdfium-0ca71ec811e33818d2ccba3221fdb660811b813c.tar.xz |
Remove FWL Create methods, use new instead
Review-Url: https://chromiumcodereview.appspot.com/2422303003
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_barcode.cpp | 4 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_barcode.h | 6 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_checkbox.cpp | 4 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_checkbox.h | 2 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_combobox.cpp | 4 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_combobox.h | 1 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_datetimepicker.cpp | 4 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_datetimepicker.h | 6 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_edit.cpp | 4 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_edit.h | 1 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_listbox.cpp | 4 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_listbox.h | 1 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_picturebox.cpp | 4 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_picturebox.h | 2 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_pushbutton.cpp | 4 | ||||
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_pushbutton.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_ffbarcode.cpp | 7 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_ffcheckbutton.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_ffchoicelist.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_ffpushbutton.cpp | 7 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_fftextedit.cpp | 8 |
21 files changed, 17 insertions, 64 deletions
diff --git a/xfa/fwl/lightwidget/cfwl_barcode.cpp b/xfa/fwl/lightwidget/cfwl_barcode.cpp index 24dce17fee..dd8d9f073a 100644 --- a/xfa/fwl/lightwidget/cfwl_barcode.cpp +++ b/xfa/fwl/lightwidget/cfwl_barcode.cpp @@ -16,10 +16,6 @@ const IFWL_Barcode* CFWL_Barcode::GetWidget() const { return static_cast<IFWL_Barcode*>(m_pIface.get()); } -CFWL_Barcode* CFWL_Barcode::Create() { - return new CFWL_Barcode; -} - FWL_Error CFWL_Barcode::Initialize(const CFWL_WidgetProperties* pProperties) { if (m_pIface) return FWL_Error::Indefinite; diff --git a/xfa/fwl/lightwidget/cfwl_barcode.h b/xfa/fwl/lightwidget/cfwl_barcode.h index cf394f6167..83a58c10bd 100644 --- a/xfa/fwl/lightwidget/cfwl_barcode.h +++ b/xfa/fwl/lightwidget/cfwl_barcode.h @@ -16,7 +16,8 @@ class CFWL_WidgetProperties; class CFWL_Barcode : public CFWL_Edit { public: - static CFWL_Barcode* Create(); + CFWL_Barcode(); + ~CFWL_Barcode() override; IFWL_Barcode* GetWidget() override; const IFWL_Barcode* GetWidget() const override; @@ -83,9 +84,6 @@ class CFWL_Barcode : public CFWL_Edit { } protected: - CFWL_Barcode(); - ~CFWL_Barcode() override; - class CFWL_BarcodeDP : public IFWL_BarcodeDP { public: CFWL_BarcodeDP(); diff --git a/xfa/fwl/lightwidget/cfwl_checkbox.cpp b/xfa/fwl/lightwidget/cfwl_checkbox.cpp index 1f59ee148a..d14ed51b3b 100644 --- a/xfa/fwl/lightwidget/cfwl_checkbox.cpp +++ b/xfa/fwl/lightwidget/cfwl_checkbox.cpp @@ -18,10 +18,6 @@ const IFWL_CheckBox* CFWL_CheckBox::GetWidget() const { return static_cast<IFWL_CheckBox*>(m_pIface.get()); } -CFWL_CheckBox* CFWL_CheckBox::Create() { - return new CFWL_CheckBox; -} - FWL_Error CFWL_CheckBox::Initialize(const CFWL_WidgetProperties* pProperties) { if (m_pIface) return FWL_Error::Indefinite; diff --git a/xfa/fwl/lightwidget/cfwl_checkbox.h b/xfa/fwl/lightwidget/cfwl_checkbox.h index 51e62943dc..ef66280b85 100644 --- a/xfa/fwl/lightwidget/cfwl_checkbox.h +++ b/xfa/fwl/lightwidget/cfwl_checkbox.h @@ -18,8 +18,6 @@ class CFWL_CheckBox : public CFWL_Widget { IFWL_CheckBox* GetWidget() override; const IFWL_CheckBox* GetWidget() const override; - static CFWL_CheckBox* Create(); - FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr); FWL_Error SetCaption(const CFX_WideStringC& wsCaption); FWL_Error SetBoxSize(FX_FLOAT fHeight); diff --git a/xfa/fwl/lightwidget/cfwl_combobox.cpp b/xfa/fwl/lightwidget/cfwl_combobox.cpp index 678edc40c8..4ec323ae7d 100644 --- a/xfa/fwl/lightwidget/cfwl_combobox.cpp +++ b/xfa/fwl/lightwidget/cfwl_combobox.cpp @@ -19,10 +19,6 @@ const IFWL_ComboBox* CFWL_ComboBox::GetWidget() const { return static_cast<IFWL_ComboBox*>(m_pIface.get()); } -CFWL_ComboBox* CFWL_ComboBox::Create() { - return new CFWL_ComboBox; -} - FWL_Error CFWL_ComboBox::Initialize(const CFWL_WidgetProperties* pProperties) { if (m_pIface) return FWL_Error::Indefinite; diff --git a/xfa/fwl/lightwidget/cfwl_combobox.h b/xfa/fwl/lightwidget/cfwl_combobox.h index 186d4b7874..bbcec3bb8b 100644 --- a/xfa/fwl/lightwidget/cfwl_combobox.h +++ b/xfa/fwl/lightwidget/cfwl_combobox.h @@ -26,7 +26,6 @@ class CFWL_ComboBox : public CFWL_Widget { IFWL_ComboBox* GetWidget() override; const IFWL_ComboBox* GetWidget() const override; - static CFWL_ComboBox* Create(); FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr); int32_t AddString(const CFX_WideStringC& wsText); int32_t AddString(const CFX_WideStringC& wsText, CFX_DIBitmap* pIcon); diff --git a/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp b/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp index 1256e1a35d..828f9cfdf8 100644 --- a/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp +++ b/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp @@ -20,10 +20,6 @@ const IFWL_DateTimePicker* CFWL_DateTimePicker::GetWidget() const { return static_cast<IFWL_DateTimePicker*>(m_pIface.get()); } -CFWL_DateTimePicker* CFWL_DateTimePicker::Create() { - return new CFWL_DateTimePicker; -} - FWL_Error CFWL_DateTimePicker::Initialize( const CFWL_WidgetProperties* pProperties) { if (m_pIface) diff --git a/xfa/fwl/lightwidget/cfwl_datetimepicker.h b/xfa/fwl/lightwidget/cfwl_datetimepicker.h index d727729e9d..e73919cff4 100644 --- a/xfa/fwl/lightwidget/cfwl_datetimepicker.h +++ b/xfa/fwl/lightwidget/cfwl_datetimepicker.h @@ -12,7 +12,8 @@ class CFWL_DateTimePicker : public CFWL_Widget { public: - static CFWL_DateTimePicker* Create(); + CFWL_DateTimePicker(); + ~CFWL_DateTimePicker() override; IFWL_DateTimePicker* GetWidget() override; const IFWL_DateTimePicker* GetWidget() const override; @@ -63,9 +64,6 @@ class CFWL_DateTimePicker : public CFWL_Widget { CFX_WideString m_wsData; }; - CFWL_DateTimePicker(); - ~CFWL_DateTimePicker() override; - CFWL_DateTimePickerDP m_DateTimePickerDP; }; diff --git a/xfa/fwl/lightwidget/cfwl_edit.cpp b/xfa/fwl/lightwidget/cfwl_edit.cpp index b74cd050a4..5637040e4d 100644 --- a/xfa/fwl/lightwidget/cfwl_edit.cpp +++ b/xfa/fwl/lightwidget/cfwl_edit.cpp @@ -17,10 +17,6 @@ const IFWL_Edit* CFWL_Edit::GetWidget() const { return static_cast<IFWL_Edit*>(m_pIface.get()); } -CFWL_Edit* CFWL_Edit::Create() { - return new CFWL_Edit; -} - FWL_Error CFWL_Edit::Initialize(const CFWL_WidgetProperties* pProperties) { if (m_pIface) return FWL_Error::Indefinite; diff --git a/xfa/fwl/lightwidget/cfwl_edit.h b/xfa/fwl/lightwidget/cfwl_edit.h index a9a466a49a..6c70c437f1 100644 --- a/xfa/fwl/lightwidget/cfwl_edit.h +++ b/xfa/fwl/lightwidget/cfwl_edit.h @@ -23,7 +23,6 @@ class CFWL_Edit : public CFWL_Widget { IFWL_Edit* GetWidget() override; const IFWL_Edit* GetWidget() const override; - static CFWL_Edit* Create(); FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr); FWL_Error SetText(const CFX_WideString& wsText); int32_t GetTextLength() const; diff --git a/xfa/fwl/lightwidget/cfwl_listbox.cpp b/xfa/fwl/lightwidget/cfwl_listbox.cpp index d5ea8797ba..eb984d670e 100644 --- a/xfa/fwl/lightwidget/cfwl_listbox.cpp +++ b/xfa/fwl/lightwidget/cfwl_listbox.cpp @@ -18,10 +18,6 @@ const IFWL_ListBox* CFWL_ListBox::GetWidget() const { return static_cast<IFWL_ListBox*>(m_pIface.get()); } -CFWL_ListBox* CFWL_ListBox::Create() { - return new CFWL_ListBox; -} - FWL_Error CFWL_ListBox::Initialize(const CFWL_WidgetProperties* pProperties) { if (m_pIface) return FWL_Error::Indefinite; diff --git a/xfa/fwl/lightwidget/cfwl_listbox.h b/xfa/fwl/lightwidget/cfwl_listbox.h index f647ae8d56..a3bba8bfea 100644 --- a/xfa/fwl/lightwidget/cfwl_listbox.h +++ b/xfa/fwl/lightwidget/cfwl_listbox.h @@ -25,7 +25,6 @@ class CFWL_ListBox : public CFWL_Widget { IFWL_ListBox* GetWidget() override; const IFWL_ListBox* GetWidget() const override; - static CFWL_ListBox* Create(); FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr); FWL_Error AddDIBitmap(CFX_DIBitmap* pDIB, IFWL_ListItem* pItem); IFWL_ListItem* AddString(const CFX_WideStringC& wsAdd, diff --git a/xfa/fwl/lightwidget/cfwl_picturebox.cpp b/xfa/fwl/lightwidget/cfwl_picturebox.cpp index 8e0cc60b09..e6328e72ff 100644 --- a/xfa/fwl/lightwidget/cfwl_picturebox.cpp +++ b/xfa/fwl/lightwidget/cfwl_picturebox.cpp @@ -16,10 +16,6 @@ const IFWL_PictureBox* CFWL_PictureBox::GetWidget() const { return static_cast<IFWL_PictureBox*>(m_pIface.get()); } -CFWL_PictureBox* CFWL_PictureBox::Create() { - return new CFWL_PictureBox; -} - FWL_Error CFWL_PictureBox::Initialize( const CFWL_WidgetProperties* pProperties) { if (m_pIface) diff --git a/xfa/fwl/lightwidget/cfwl_picturebox.h b/xfa/fwl/lightwidget/cfwl_picturebox.h index 612ff1d84d..c039892b66 100644 --- a/xfa/fwl/lightwidget/cfwl_picturebox.h +++ b/xfa/fwl/lightwidget/cfwl_picturebox.h @@ -19,8 +19,6 @@ class CFWL_PictureBox : public CFWL_Widget { IFWL_PictureBox* GetWidget() override; const IFWL_PictureBox* GetWidget() const override; - static CFWL_PictureBox* Create(); - FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr); CFX_DIBitmap* GetPicture(); FWL_Error SetPicture(CFX_DIBitmap* pBitmap); diff --git a/xfa/fwl/lightwidget/cfwl_pushbutton.cpp b/xfa/fwl/lightwidget/cfwl_pushbutton.cpp index b1031692dd..79afe805cd 100644 --- a/xfa/fwl/lightwidget/cfwl_pushbutton.cpp +++ b/xfa/fwl/lightwidget/cfwl_pushbutton.cpp @@ -16,10 +16,6 @@ const IFWL_PushButton* CFWL_PushButton::GetWidget() const { return static_cast<IFWL_PushButton*>(m_pIface.get()); } -CFWL_PushButton* CFWL_PushButton::Create() { - return new CFWL_PushButton; -} - FWL_Error CFWL_PushButton::Initialize( const CFWL_WidgetProperties* pProperties) { if (m_pIface) diff --git a/xfa/fwl/lightwidget/cfwl_pushbutton.h b/xfa/fwl/lightwidget/cfwl_pushbutton.h index ce26a54655..13629fa923 100644 --- a/xfa/fwl/lightwidget/cfwl_pushbutton.h +++ b/xfa/fwl/lightwidget/cfwl_pushbutton.h @@ -18,8 +18,6 @@ class CFWL_PushButton : public CFWL_Widget { IFWL_PushButton* GetWidget() override; const IFWL_PushButton* GetWidget() const override; - static CFWL_PushButton* Create(); - FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr); FWL_Error GetCaption(CFX_WideString& wsCaption); FWL_Error SetCaption(const CFX_WideStringC& wsCaption); 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); |