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

Unified Diff: xfa/src/fwl/src/basewidget/fwl_scrollbarimp.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_scrollbarimp.cpp
diff --git a/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp b/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp
index 02eae32fc011a590a2da5a9e21b1f15b6615f33b..a3fc2b17e0c2c7f2585c65f83bf69acff80d1122 100644
--- a/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp
@@ -15,60 +15,55 @@ IFWL_ScrollBar* IFWL_ScrollBar::Create() {
return new IFWL_ScrollBar;
}
IFWL_ScrollBar::IFWL_ScrollBar() {
- m_pImpl = NULL;
-}
-IFWL_ScrollBar::~IFWL_ScrollBar() {
- if (m_pImpl) {
- delete (CFWL_ScrollBarImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_ScrollBar::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_ScrollBarImp(pOuter);
- ((CFWL_ScrollBarImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_ScrollBarImp*)m_pImpl)->Initialize();
+ CFWL_ScrollBarImp* pScrollBarImpl = new CFWL_ScrollBarImp(pOuter);
+ SetImpl(pScrollBarImpl);
+ pScrollBarImpl->SetInterface(this);
+ return pScrollBarImpl->Initialize();
}
FWL_ERR IFWL_ScrollBar::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_ScrollBarImp(properties, pOuter);
- ((CFWL_ScrollBarImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_ScrollBarImp*)m_pImpl)->Initialize();
+ CFWL_ScrollBarImp* pScrollBarImpl = new CFWL_ScrollBarImp(properties, pOuter);
+ SetImpl(pScrollBarImpl);
+ pScrollBarImpl->SetInterface(this);
+ return pScrollBarImpl->Initialize();
}
FX_BOOL IFWL_ScrollBar::IsVertical() {
- return ((CFWL_ScrollBarImp*)m_pImpl)->IsVertical();
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->IsVertical();
}
FWL_ERR IFWL_ScrollBar::GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax) {
- return ((CFWL_ScrollBarImp*)m_pImpl)->GetRange(fMin, fMax);
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->GetRange(fMin, fMax);
}
FWL_ERR IFWL_ScrollBar::SetRange(FX_FLOAT fMin, FX_FLOAT fMax) {
- return ((CFWL_ScrollBarImp*)m_pImpl)->SetRange(fMin, fMax);
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->SetRange(fMin, fMax);
}
FX_FLOAT IFWL_ScrollBar::GetPageSize() {
- return ((CFWL_ScrollBarImp*)m_pImpl)->GetPageSize();
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->GetPageSize();
}
FWL_ERR IFWL_ScrollBar::SetPageSize(FX_FLOAT fPageSize) {
- return ((CFWL_ScrollBarImp*)m_pImpl)->SetPageSize(fPageSize);
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->SetPageSize(fPageSize);
}
FX_FLOAT IFWL_ScrollBar::GetStepSize() {
- return ((CFWL_ScrollBarImp*)m_pImpl)->GetStepSize();
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->GetStepSize();
}
FWL_ERR IFWL_ScrollBar::SetStepSize(FX_FLOAT fStepSize) {
- return ((CFWL_ScrollBarImp*)m_pImpl)->SetStepSize(fStepSize);
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->SetStepSize(fStepSize);
}
FX_FLOAT IFWL_ScrollBar::GetPos() {
- return ((CFWL_ScrollBarImp*)m_pImpl)->GetPos();
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->GetPos();
}
FWL_ERR IFWL_ScrollBar::SetPos(FX_FLOAT fPos) {
- return ((CFWL_ScrollBarImp*)m_pImpl)->SetPos(fPos);
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->SetPos(fPos);
}
FX_FLOAT IFWL_ScrollBar::GetTrackPos() {
- return ((CFWL_ScrollBarImp*)m_pImpl)->GetTrackPos();
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->GetTrackPos();
}
FWL_ERR IFWL_ScrollBar::SetTrackPos(FX_FLOAT fTrackPos) {
- return ((CFWL_ScrollBarImp*)m_pImpl)->SetTrackPos(fTrackPos);
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->SetTrackPos(fTrackPos);
}
FX_BOOL IFWL_ScrollBar::DoScroll(FX_DWORD dwCode, FX_FLOAT fPos) {
- return ((CFWL_ScrollBarImp*)m_pImpl)->DoScroll(dwCode, fPos);
+ return static_cast<CFWL_ScrollBarImp*>(GetImpl())->DoScroll(dwCode, fPos);
}
CFWL_ScrollBarImp::CFWL_ScrollBarImp(IFWL_Widget* pOuter)
: CFWL_WidgetImp(pOuter),

Powered by Google App Engine
This is Rietveld 408576698