Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: xfa/src/fwl/src/lightwidget/checkbox.cpp

Issue 1453473002: FWL refcounts never incremented (part 2). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Rebased Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/src/fwl/src/lightwidget/caret.cpp ('k') | xfa/src/fwl/src/lightwidget/combobox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a9ae80f5333b1a1e0d2e99deb4ed9d9ee3f6216e 100644
--- a/xfa/src/fwl/src/lightwidget/checkbox.cpp
+++ b/xfa/src/fwl/src/lightwidget/checkbox.cpp
@@ -14,25 +14,19 @@ 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();
+ CFWL_WidgetImpProperties prop =
+ m_pProperties->MakeWidgetImpProperties(&m_checkboxData);
+ prop.m_pParent = m_pProperties->m_pParent->GetWidget();
+ prop.m_pOwner = m_pProperties->m_pOwner->GetWidget();
+ nonstd::unique_ptr<IFWL_CheckBox> pCheckBox(
+ IFWL_CheckBox::Create(prop, nullptr));
+ 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;
« no previous file with comments | « xfa/src/fwl/src/lightwidget/caret.cpp ('k') | xfa/src/fwl/src/lightwidget/combobox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698