summaryrefslogtreecommitdiff
path: root/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-08-04 16:37:48 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-04 16:37:48 -0700
commit1b4f6b36b3ed8d1f6cea96bc32c1b376f4a499bc (patch)
treeaa3ba6730495096411f2a3555c74e83f5d1fca11 /xfa/fwl/basewidget/fwl_monthcalendarimp.cpp
parent52a5005c453a9e08384e375ae51c5f1ad628fe86 (diff)
downloadpdfium-1b4f6b36b3ed8d1f6cea96bc32c1b376f4a499bc.tar.xz
Use smart pointers for class owned pointers
For classes under xfa/fgas, xfa/fwl/basewidget, and xfa/fwl/core, use smart pointers instead of raw pointer to make memory management easier. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2207093005
Diffstat (limited to 'xfa/fwl/basewidget/fwl_monthcalendarimp.cpp')
-rw-r--r--xfa/fwl/basewidget/fwl_monthcalendarimp.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp b/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp
index ca141a2d7a..7477f04bdc 100644
--- a/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp
+++ b/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp
@@ -151,6 +151,8 @@ CFWL_MonthCalendarImp::CFWL_MonthCalendarImp(
const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter)
: CFWL_WidgetImp(properties, pOuter),
+ m_bInit(FALSE),
+ m_pDateTime(new CFX_DateTime),
m_iCurYear(2011),
m_iCurMonth(1),
m_iYear(2011),
@@ -158,7 +160,8 @@ CFWL_MonthCalendarImp::CFWL_MonthCalendarImp(
m_iDay(1),
m_iHovered(-1),
m_iLBtnPartStates(CFWL_PartState_Normal),
- m_iRBtnPartStates(CFWL_PartState_Normal) {
+ m_iRBtnPartStates(CFWL_PartState_Normal),
+ m_iMaxSel(1) {
m_rtHead.Reset();
m_rtWeek.Reset();
m_rtLBtn.Reset();
@@ -171,14 +174,10 @@ CFWL_MonthCalendarImp::CFWL_MonthCalendarImp(
m_rtClient.Reset();
m_rtWeekNum.Reset();
m_rtWeekNumSep.Reset();
- m_pDateTime = new CFX_DateTime;
- m_bInit = FALSE;
- m_iMaxSel = 1;
}
CFWL_MonthCalendarImp::~CFWL_MonthCalendarImp() {
ClearDateItem();
- delete m_pDateTime;
m_arrSelDays.RemoveAll();
}