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

Unified Diff: xfa/src/fwl/src/basewidget/fwl_checkboximp.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_checkboximp.cpp
diff --git a/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp
index e63d87c97cd470fa5fabbe45fc9c3a12be761cf2..b18df4e13f9a0ce4ebef7967b9bc3b69f900200c 100644
--- a/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp
@@ -15,53 +15,43 @@ IFWL_CheckBox* IFWL_CheckBox::Create() {
return new IFWL_CheckBox;
}
IFWL_CheckBox::IFWL_CheckBox() {
- m_pImpl = NULL;
-}
-IFWL_CheckBox::~IFWL_CheckBox() {
- if (m_pImpl) {
- delete (CFWL_CheckBoxImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_CheckBox::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_CheckBoxImp(pOuter);
- ((CFWL_CheckBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_CheckBoxImp*)m_pImpl)->Initialize();
+ CFWL_CheckBoxImp* pCheckBoxImpl = new CFWL_CheckBoxImp(pOuter);
+ SetImpl(pCheckBoxImpl);
+ pCheckBoxImpl->SetInterface(this);
+ return pCheckBoxImpl->Initialize();
}
FWL_ERR IFWL_CheckBox::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_CheckBoxImp(properties, pOuter);
- ((CFWL_CheckBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_CheckBoxImp*)m_pImpl)->Initialize();
+ CFWL_CheckBoxImp* pCheckBoxImpl = new CFWL_CheckBoxImp(properties, pOuter);
+ SetImpl(pCheckBoxImpl);
+ pCheckBoxImpl->SetInterface(this);
+ return pCheckBoxImpl->Initialize();
}
int32_t IFWL_CheckBox::GetCheckState() {
- return ((CFWL_CheckBoxImp*)m_pImpl)->GetCheckState();
+ return static_cast<CFWL_CheckBoxImp*>(GetImpl())->GetCheckState();
}
FWL_ERR IFWL_CheckBox::SetCheckState(int32_t iCheck) {
- return ((CFWL_CheckBoxImp*)m_pImpl)->SetCheckState(iCheck);
+ return static_cast<CFWL_CheckBoxImp*>(GetImpl())->SetCheckState(iCheck);
}
IFWL_RadioButton* IFWL_RadioButton::Create() {
return new IFWL_RadioButton;
}
IFWL_RadioButton::IFWL_RadioButton() {
- m_pImpl = NULL;
-}
-IFWL_RadioButton::~IFWL_RadioButton() {
- if (m_pImpl) {
- delete (CFWL_CheckBoxImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_RadioButton::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_CheckBoxImp(pOuter);
- ((CFWL_CheckBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_CheckBoxImp*)m_pImpl)->Initialize();
+ CFWL_CheckBoxImp* pCheckBoxImpl = new CFWL_CheckBoxImp(pOuter);
+ SetImpl(pCheckBoxImpl);
+ pCheckBoxImpl->SetInterface(this);
+ return pCheckBoxImpl->Initialize();
}
FWL_ERR IFWL_RadioButton::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_CheckBoxImp(properties, pOuter);
- ((CFWL_CheckBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_CheckBoxImp*)m_pImpl)->Initialize();
+ CFWL_CheckBoxImp* pCheckBoxImpl = new CFWL_CheckBoxImp(properties, pOuter);
+ SetImpl(pCheckBoxImpl);
+ pCheckBoxImpl->SetInterface(this);
+ return pCheckBoxImpl->Initialize();
}
CFWL_CheckBoxImp::CFWL_CheckBoxImp(IFWL_Widget* pOuter)
: CFWL_WidgetImp(pOuter),

Powered by Google App Engine
This is Rietveld 408576698