Index: xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp |
diff --git a/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp b/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp |
index 6928349106c1b83c125866aec2ffeadeeadff362..730c244fe122e8f58719b3fd0332653296bf5451 100644 |
--- a/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp |
+++ b/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp |
@@ -21,40 +21,37 @@ IFWL_MonthCalendar* IFWL_MonthCalendar::Create() { |
return new IFWL_MonthCalendar; |
} |
IFWL_MonthCalendar::IFWL_MonthCalendar() { |
- m_pImpl = NULL; |
-} |
-IFWL_MonthCalendar::~IFWL_MonthCalendar() { |
- if (m_pImpl) { |
- delete (CFWL_MonthCalendarImp*)m_pImpl; |
- m_pImpl = NULL; |
- } |
} |
FWL_ERR IFWL_MonthCalendar::Initialize(IFWL_Widget* pOuter) { |
- m_pImpl = new CFWL_MonthCalendarImp(pOuter); |
- ((CFWL_MonthCalendarImp*)m_pImpl)->SetInterface(this); |
- return ((CFWL_MonthCalendarImp*)m_pImpl)->Initialize(); |
+ CFWL_MonthCalendarImp* pMonthCalendarImpl = new CFWL_MonthCalendarImp(pOuter); |
+ SetImpl(pMonthCalendarImpl); |
+ pMonthCalendarImpl->SetInterface(this); |
+ return pMonthCalendarImpl->Initialize(); |
} |
FWL_ERR IFWL_MonthCalendar::Initialize( |
const CFWL_WidgetImpProperties& properties, |
IFWL_Widget* pOuter) { |
- m_pImpl = new CFWL_MonthCalendarImp(properties, pOuter); |
- ((CFWL_MonthCalendarImp*)m_pImpl)->SetInterface(this); |
- return ((CFWL_MonthCalendarImp*)m_pImpl)->Initialize(); |
+ CFWL_MonthCalendarImp* pMonthCalendarImpl = |
+ new CFWL_MonthCalendarImp(properties, pOuter); |
+ SetImpl(pMonthCalendarImpl); |
+ pMonthCalendarImpl->SetInterface(this); |
+ return pMonthCalendarImpl->Initialize(); |
} |
int32_t IFWL_MonthCalendar::CountSelect() { |
- return ((CFWL_MonthCalendarImp*)m_pImpl)->CountSelect(); |
+ return static_cast<CFWL_MonthCalendarImp*>(GetImpl())->CountSelect(); |
} |
FX_BOOL IFWL_MonthCalendar::GetSelect(int32_t& iYear, |
int32_t& iMonth, |
int32_t& iDay, |
int32_t nIndex) { |
- return ((CFWL_MonthCalendarImp*)m_pImpl) |
+ return static_cast<CFWL_MonthCalendarImp*>(GetImpl()) |
->GetSelect(iYear, iMonth, iDay, nIndex); |
} |
FX_BOOL IFWL_MonthCalendar::SetSelect(int32_t iYear, |
int32_t iMonth, |
int32_t iDay) { |
- return ((CFWL_MonthCalendarImp*)m_pImpl)->SetSelect(iYear, iMonth, iDay); |
+ return static_cast<CFWL_MonthCalendarImp*>(GetImpl()) |
+ ->SetSelect(iYear, iMonth, iDay); |
} |
CFWL_MonthCalendarImp::CFWL_MonthCalendarImp(IFWL_Widget* pOuter) |
: CFWL_WidgetImp(pOuter), |