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

Unified Diff: xfa/src/fwl/src/lightwidget/datetimepicker.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/combobox.cpp ('k') | xfa/src/fwl/src/lightwidget/edit.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fwl/src/lightwidget/datetimepicker.cpp
diff --git a/xfa/src/fwl/src/lightwidget/datetimepicker.cpp b/xfa/src/fwl/src/lightwidget/datetimepicker.cpp
index 60e0e30b4e0e0345f551d175cfca8f88a6630e4f..3138e385186e3310f2a07a9dcd13c645dda89f74 100644
--- a/xfa/src/fwl/src/lightwidget/datetimepicker.cpp
+++ b/xfa/src/fwl/src/lightwidget/datetimepicker.cpp
@@ -15,17 +15,19 @@ FWL_ERR CFWL_DateTimePicker::Initialize(
if (pProperties) {
*m_pProperties = *pProperties;
}
- m_pIface = new IFWL_DateTimePicker;
- FWL_ERR ret =
- ((IFWL_DateTimePicker*)m_pIface)
- ->Initialize(
- m_pProperties->MakeWidgetImpProperties(&m_DateTimePickerDP),
- nullptr);
- if (ret == FWL_ERR_Succeeded) {
- CFWL_Widget::Initialize();
+ nonstd::unique_ptr<IFWL_DateTimePicker> pDateTimePicker(
+ IFWL_DateTimePicker::Create(
+ m_pProperties->MakeWidgetImpProperties(&m_DateTimePickerDP),
+ nullptr));
+ FWL_ERR ret = pDateTimePicker->Initialize();
+ if (ret != FWL_ERR_Succeeded) {
+ return ret;
}
- return ret;
+ m_pIface = pDateTimePicker.release();
+ CFWL_Widget::Initialize();
+ return FWL_ERR_Succeeded;
}
+
FWL_ERR CFWL_DateTimePicker::SetToday(int32_t iYear,
int32_t iMonth,
int32_t iDay) {
« no previous file with comments | « xfa/src/fwl/src/lightwidget/combobox.cpp ('k') | xfa/src/fwl/src/lightwidget/edit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698