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

Unified Diff: xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp

Issue 1460883002: Make IFWL_Target::m_pImpl a private member. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 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
Index: xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp
diff --git a/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp b/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp
index 60614e79f9532130fcf63dfc5854754ac7a42415..382118fd43396e3cdf0ad732747b7f76bd6d5f6c 100644
--- a/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp
@@ -16,30 +16,26 @@ IFWL_SpinButton* IFWL_SpinButton::Create() {
return new IFWL_SpinButton;
}
IFWL_SpinButton::IFWL_SpinButton() {
- m_pImpl = NULL;
-}
-IFWL_SpinButton::~IFWL_SpinButton() {
- if (m_pImpl) {
- delete (CFWL_SpinButtonImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_SpinButton::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_SpinButtonImp;
- ((CFWL_SpinButtonImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_SpinButtonImp*)m_pImpl)->Initialize();
+ CFWL_SpinButtonImp* pSpinButtonImpl = new CFWL_SpinButtonImp;
+ SetImpl(pSpinButtonImpl);
+ pSpinButtonImpl->SetInterface(this);
+ return pSpinButtonImpl->Initialize();
}
FWL_ERR IFWL_SpinButton::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_SpinButtonImp(properties);
- ((CFWL_SpinButtonImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_SpinButtonImp*)m_pImpl)->Initialize();
+ CFWL_SpinButtonImp* pSpinButtonImpl = new CFWL_SpinButtonImp(properties);
+ SetImpl(pSpinButtonImpl);
+ pSpinButtonImpl->SetInterface(this);
+ return pSpinButtonImpl->Initialize();
}
FWL_ERR IFWL_SpinButton::EnableButton(FX_BOOL bEnable, FX_BOOL bUp) {
- return ((CFWL_SpinButtonImp*)m_pImpl)->EnableButton(bEnable, bUp);
+ return static_cast<CFWL_SpinButtonImp*>(GetImpl())
+ ->EnableButton(bEnable, bUp);
}
FX_BOOL IFWL_SpinButton::IsButtonEnable(FX_BOOL bUp) {
- return ((CFWL_SpinButtonImp*)m_pImpl)->IsButtonEnable(bUp);
+ return static_cast<CFWL_SpinButtonImp*>(GetImpl())->IsButtonEnable(bUp);
}
CFWL_SpinButtonImp::CFWL_SpinButtonImp(IFWL_Widget* pOuter)
: CFWL_WidgetImp(pOuter),

Powered by Google App Engine
This is Rietveld 408576698