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

Unified Diff: xfa/fwl/core/ifwl_datetimecalendar.cpp

Issue 2464703006: Fold IFWL*::{Initialize|Finalize} into constructor/destructor (Closed)
Patch Set: Rebase to master Created 4 years, 1 month 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/fwl/core/ifwl_datetimecalendar.h ('k') | xfa/fwl/core/ifwl_datetimeedit.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/ifwl_datetimecalendar.cpp
diff --git a/xfa/fwl/core/ifwl_datetimecalendar.cpp b/xfa/fwl/core/ifwl_datetimecalendar.cpp
index ee04bf4978752eecb496ba7c0237bf14f57d4b8a..a44b55819076e708910b18a2acfd6e48d289aad6 100644
--- a/xfa/fwl/core/ifwl_datetimecalendar.cpp
+++ b/xfa/fwl/core/ifwl_datetimecalendar.cpp
@@ -6,6 +6,7 @@
#include "xfa/fwl/core/ifwl_datetimecalendar.h"
+#include "third_party/base/ptr_util.h"
#include "xfa/fwl/core/cfwl_widgetmgr.h"
#include "xfa/fwl/core/ifwl_datetimepicker.h"
#include "xfa/fwl/core/ifwl_formproxy.h"
@@ -14,20 +15,8 @@ IFWL_DateTimeCalendar::IFWL_DateTimeCalendar(
const IFWL_App* app,
const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter)
- : IFWL_MonthCalendar(app, properties, pOuter) {}
-
-void IFWL_DateTimeCalendar::Initialize() {
- IFWL_MonthCalendar::Initialize();
-
- // Delete delegated set by IFWL_MonthCalendar::Initialize.
- delete m_pDelegate;
- m_pDelegate = new CFWL_DateTimeCalendarImpDelegate(this);
-}
-
-void IFWL_DateTimeCalendar::Finalize() {
- delete m_pDelegate;
- m_pDelegate = nullptr;
- IFWL_MonthCalendar::Finalize();
+ : IFWL_MonthCalendar(app, properties, pOuter) {
+ SetDelegate(pdfium::MakeUnique<CFWL_DateTimeCalendarImpDelegate>(this));
}
CFWL_DateTimeCalendarImpDelegate::CFWL_DateTimeCalendarImpDelegate(
« no previous file with comments | « xfa/fwl/core/ifwl_datetimecalendar.h ('k') | xfa/fwl/core/ifwl_datetimeedit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698