Chromium Code Reviews| Index: xfa/src/fwl/src/lightwidget/checkbox.cpp |
| diff --git a/xfa/src/fwl/src/lightwidget/checkbox.cpp b/xfa/src/fwl/src/lightwidget/checkbox.cpp |
| index 296a2635ea162361f556d47f4c32471a94079141..91dc63af7554a8cc019cedaed17b5407fcd87a55 100644 |
| --- a/xfa/src/fwl/src/lightwidget/checkbox.cpp |
| +++ b/xfa/src/fwl/src/lightwidget/checkbox.cpp |
| @@ -14,25 +14,15 @@ FWL_ERR CFWL_CheckBox::Initialize(const CFWL_WidgetProperties* pProperties) { |
| if (pProperties) { |
| *m_pProperties = *pProperties; |
| } |
| - CFWL_WidgetImpProperties prop; |
| - prop.m_ctmOnParent = m_pProperties->m_ctmOnParent; |
| - prop.m_rtWidget = m_pProperties->m_rtWidget; |
| - prop.m_dwStyles = m_pProperties->m_dwStyles; |
| - prop.m_dwStyleExes = m_pProperties->m_dwStyleExes; |
| - prop.m_dwStates = m_pProperties->m_dwStates; |
| - prop.m_pDataProvider = &m_checkboxData; |
| - if (m_pProperties->m_pParent) { |
| - prop.m_pParent = m_pProperties->m_pParent->GetWidget(); |
| + nonstd::unique_ptr<IFWL_CheckBox> pCheckBox(IFWL_CheckBox::Create( |
| + m_pProperties->MakeWidgetImpProperties(&m_checkboxData), nullptr)); |
|
jun_fang
2015/12/09 10:38:27
On the left side,
prop.m_pParent = m_pProperties-
Tom Sepez
2015/12/09 20:32:06
Good spotting.
|
| + FWL_ERR ret = pCheckBox->Initialize(); |
| + if (ret != FWL_ERR_Succeeded) { |
| + return ret; |
| } |
| - if (m_pProperties->m_pOwner) { |
| - prop.m_pOwner = m_pProperties->m_pOwner->GetWidget(); |
| - } |
| - m_pIface = new IFWL_CheckBox; |
| - FWL_ERR ret = ((IFWL_CheckBox*)m_pIface)->Initialize(prop, nullptr); |
| - if (ret == FWL_ERR_Succeeded) { |
| - CFWL_Widget::Initialize(); |
| - } |
| - return ret; |
| + m_pIface = pCheckBox.release(); |
| + CFWL_Widget::Initialize(); |
| + return FWL_ERR_Succeeded; |
| } |
| FWL_ERR CFWL_CheckBox::SetCaption(const CFX_WideStringC& wsCaption) { |
| m_checkboxData.m_wsCaption = wsCaption; |