From 4e62b5c7c5a35c7020d581fb65de4b3fc5ad3c1a Mon Sep 17 00:00:00 2001 From: weili Date: Wed, 10 Aug 2016 11:29:57 -0700 Subject: Use smart pointers for class owned pointers in xfa/fwl/theme Use smart pointers instead of raw pointer to make memory management easier for classes under xfa/fwl/theme. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2230813002 --- xfa/fwl/theme/cfwl_monthcalendartp.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'xfa/fwl/theme/cfwl_monthcalendartp.h') diff --git a/xfa/fwl/theme/cfwl_monthcalendartp.h b/xfa/fwl/theme/cfwl_monthcalendartp.h index 7ecbb90cf2..b10258a7f9 100644 --- a/xfa/fwl/theme/cfwl_monthcalendartp.h +++ b/xfa/fwl/theme/cfwl_monthcalendartp.h @@ -7,6 +7,8 @@ #ifndef XFA_FWL_THEME_CFWL_MONTHCALENDARTP_H_ #define XFA_FWL_THEME_CFWL_MONTHCALENDARTP_H_ +#include + #include "xfa/fwl/theme/cfwl_widgettp.h" class CFWL_MonthCalendarTP : public CFWL_WidgetTP { @@ -27,6 +29,16 @@ class CFWL_MonthCalendarTP : public CFWL_WidgetTP { FWL_Error Finalize() override; protected: + struct MCThemeData { + FX_ARGB clrCaption; + FX_ARGB clrSeperator; + FX_ARGB clrDatesHoverBK; + FX_ARGB clrDatesSelectedBK; + FX_ARGB clrDatesCircle; + FX_ARGB clrToday; + FX_ARGB clrBK; + }; + FX_BOOL DrawTotalBK(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); FX_BOOL DrawHeadBk(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); FX_BOOL DrawLButton(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); @@ -39,16 +51,7 @@ class CFWL_MonthCalendarTP : public CFWL_WidgetTP { FWLTHEME_STATE GetState(uint32_t dwFWLStates); void SetThemeData(uint32_t dwThemeID); - class MCThemeData { - public: - FX_ARGB clrCaption; - FX_ARGB clrSeperator; - FX_ARGB clrDatesHoverBK; - FX_ARGB clrDatesSelectedBK; - FX_ARGB clrDatesCircle; - FX_ARGB clrToday; - FX_ARGB clrBK; - } * m_pThemeData; + std::unique_ptr m_pThemeData; CFX_WideString wsResource; }; -- cgit v1.2.3