Index: xfa/src/fwl/src/basewidget/fwl_caretimp.cpp |
diff --git a/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp b/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp |
index c0cc74b1bcf6dc4a04be8ca0cd13cefdfe352d5f..856ca026213014284fe2dd3f68c6aa332d1a8f2e 100644 |
--- a/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp |
+++ b/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp |
@@ -13,36 +13,31 @@ IFWL_Caret* IFWL_Caret::Create() { |
return new IFWL_Caret; |
} |
IFWL_Caret::IFWL_Caret() { |
- m_pImpl = NULL; |
-} |
-IFWL_Caret::~IFWL_Caret() { |
- if (m_pImpl) { |
- delete (CFWL_CaretImp*)m_pImpl; |
- m_pImpl = NULL; |
- } |
} |
FWL_ERR IFWL_Caret::Initialize(IFWL_Widget* pOuter) { |
- m_pImpl = new CFWL_CaretImp(pOuter); |
- ((CFWL_CaretImp*)m_pImpl)->SetInterface(this); |
- return ((CFWL_CaretImp*)m_pImpl)->Initialize(); |
+ CFWL_CaretImp* pCaretImpl = new CFWL_CaretImp(pOuter); |
+ SetImpl(pCaretImpl); |
+ pCaretImpl->SetInterface(this); |
+ return pCaretImpl->Initialize(); |
} |
FWL_ERR IFWL_Caret::Initialize(const CFWL_WidgetImpProperties& properties, |
IFWL_Widget* pOuter) { |
- m_pImpl = new CFWL_CaretImp(properties, pOuter); |
- ((CFWL_CaretImp*)m_pImpl)->SetInterface(this); |
- return ((CFWL_CaretImp*)m_pImpl)->Initialize(); |
+ CFWL_CaretImp* pCaretImpl = new CFWL_CaretImp(properties, pOuter); |
+ SetImpl(pCaretImpl); |
+ pCaretImpl->SetInterface(this); |
+ return pCaretImpl->Initialize(); |
} |
FWL_ERR IFWL_Caret::ShowCaret(FX_BOOL bFlag) { |
- return ((CFWL_CaretImp*)m_pImpl)->ShowCaret(bFlag); |
+ return static_cast<CFWL_CaretImp*>(GetImpl())->ShowCaret(bFlag); |
} |
FWL_ERR IFWL_Caret::GetFrequency(FX_DWORD& elapse) { |
- return ((CFWL_CaretImp*)m_pImpl)->GetFrequency(elapse); |
+ return static_cast<CFWL_CaretImp*>(GetImpl())->GetFrequency(elapse); |
} |
FWL_ERR IFWL_Caret::SetFrequency(FX_DWORD elapse) { |
- return ((CFWL_CaretImp*)m_pImpl)->SetFrequency(elapse); |
+ return static_cast<CFWL_CaretImp*>(GetImpl())->SetFrequency(elapse); |
} |
FWL_ERR IFWL_Caret::SetColor(CFX_Color crFill) { |
- return ((CFWL_CaretImp*)m_pImpl)->SetColor(crFill); |
+ return static_cast<CFWL_CaretImp*>(GetImpl())->SetColor(crFill); |
} |
CFWL_CaretImp::CFWL_CaretImp(IFWL_Widget* pOuter) : m_hTimer(NULL) { |
m_dwElapse = 400; |