Chromium Code Reviews| Index: xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp |
| diff --git a/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp |
| index c68dd7512baf47568a7b372b2a1027a51d4f0d45..7bcf6809b76553cdad3657085857aa996ef14174 100644 |
| --- a/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp |
| +++ b/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp |
| @@ -11,40 +11,36 @@ |
| #include "../core/include/fwl_widgetmgrimp.h" |
| #include "include/fwl_checkboximp.h" |
| #define FWL_CKB_CaptionMargin 5 |
| -IFWL_CheckBox::IFWL_CheckBox() { |
| -} |
| -FWL_ERR IFWL_CheckBox::Initialize(const CFWL_WidgetImpProperties& properties, |
| - IFWL_Widget* pOuter) { |
| + |
| +// static |
| +IFWL_CheckBox* IFWL_CheckBox::Create(const CFWL_WidgetImpProperties& properties, |
| + IFWL_Widget* pOuter) { |
| + IFWL_CheckBox* pCheckBox = new IFWL_CheckBox; |
| CFWL_CheckBoxImp* pCheckBoxImpl = new CFWL_CheckBoxImp(properties, pOuter); |
| - SetImpl(pCheckBoxImpl); |
| - pCheckBoxImpl->SetInterface(this); |
| - return pCheckBoxImpl->Initialize(); |
| + pCheckBox->SetImpl(pCheckBoxImpl); |
| + pCheckBoxImpl->SetInterface(pCheckBox); |
| + return pCheckBox; |
| } |
| +IFWL_CheckBox::IFWL_CheckBox() {} |
| int32_t IFWL_CheckBox::GetCheckState() { |
| return static_cast<CFWL_CheckBoxImp*>(GetImpl())->GetCheckState(); |
| } |
| FWL_ERR IFWL_CheckBox::SetCheckState(int32_t iCheck) { |
| return static_cast<CFWL_CheckBoxImp*>(GetImpl())->SetCheckState(iCheck); |
| } |
| -IFWL_RadioButton::IFWL_RadioButton() { |
| -} |
| -FWL_ERR IFWL_RadioButton::Initialize(const CFWL_WidgetImpProperties& properties, |
| - IFWL_Widget* pOuter) { |
| + |
| +// static |
| +IFWL_RadioButton* IFWL_RadioButton::Create( |
| + const CFWL_WidgetImpProperties& properties, |
| + IFWL_Widget* pOuter) { |
| + IFWL_RadioButton* pRadioButton = new IFWL_RadioButton; |
| CFWL_CheckBoxImp* pCheckBoxImpl = new CFWL_CheckBoxImp(properties, pOuter); |
| - SetImpl(pCheckBoxImpl); |
| - pCheckBoxImpl->SetInterface(this); |
| - return pCheckBoxImpl->Initialize(); |
| -} |
| -CFWL_CheckBoxImp::CFWL_CheckBoxImp(IFWL_Widget* pOuter) |
| - : CFWL_WidgetImp(pOuter), |
| - m_dwTTOStyles(FDE_TTOSTYLE_SingleLine), |
| - m_iTTOAlign(FDE_TTOALIGNMENT_Center), |
| - m_bBtnDown(FALSE) { |
| - m_rtClient.Reset(); |
| - m_rtBox.Reset(); |
| - m_rtCaption.Reset(); |
| - m_rtFocus.Reset(); |
| + pRadioButton->SetImpl(pCheckBoxImpl); |
|
jun_fang
2015/12/09 10:38:27
Nit: when I saw that pRadioButton used pCheckBoxIm
Tom Sepez
2015/12/09 20:32:06
This code has been completely removed.
jun_fang
2015/12/10 00:06:18
Acknowledged.
|
| + pCheckBoxImpl->SetInterface(pRadioButton); |
| + return pRadioButton; |
| } |
| +IFWL_RadioButton::IFWL_RadioButton() {} |
| + |
| CFWL_CheckBoxImp::CFWL_CheckBoxImp(const CFWL_WidgetImpProperties& properties, |
| IFWL_Widget* pOuter) |
| : CFWL_WidgetImp(properties, pOuter), |