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

Unified Diff: xfa/src/fwl/src/basewidget/fwl_listboximp.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_listboximp.cpp
diff --git a/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp
index 09ef4cd0aeb9129ae47ab6188a8ecaa7a95f4088..0b96555b03af96abe4a06480134e266b906f2efe 100644
--- a/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp
@@ -15,45 +15,40 @@ IFWL_ListBox* IFWL_ListBox::Create() {
return new IFWL_ListBox;
}
IFWL_ListBox::IFWL_ListBox() {
- m_pImpl = NULL;
-}
-IFWL_ListBox::~IFWL_ListBox() {
- if (m_pImpl) {
- delete (CFWL_ListBoxImp*)m_pImpl;
- m_pImpl = NULL;
- }
}
FWL_ERR IFWL_ListBox::Initialize(IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_ListBoxImp(pOuter);
- ((CFWL_ListBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_ListBoxImp*)m_pImpl)->Initialize();
+ CFWL_ListBoxImp* pListBoxImpl = new CFWL_ListBoxImp(pOuter);
+ SetImpl(pListBoxImpl);
+ pListBoxImpl->SetInterface(this);
+ return pListBoxImpl->Initialize();
}
FWL_ERR IFWL_ListBox::Initialize(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter) {
- m_pImpl = new CFWL_ListBoxImp(properties, pOuter);
- ((CFWL_ListBoxImp*)m_pImpl)->SetInterface(this);
- return ((CFWL_ListBoxImp*)m_pImpl)->Initialize();
+ CFWL_ListBoxImp* pListBoxImpl = new CFWL_ListBoxImp(properties, pOuter);
+ SetImpl(pListBoxImpl);
+ pListBoxImpl->SetInterface(this);
+ return pListBoxImpl->Initialize();
}
int32_t IFWL_ListBox::CountSelItems() {
- return ((CFWL_ListBoxImp*)m_pImpl)->CountSelItems();
+ return static_cast<CFWL_ListBoxImp*>(GetImpl())->CountSelItems();
}
FWL_HLISTITEM IFWL_ListBox::GetSelItem(int32_t nIndexSel) {
- return ((CFWL_ListBoxImp*)m_pImpl)->GetSelItem(nIndexSel);
+ return static_cast<CFWL_ListBoxImp*>(GetImpl())->GetSelItem(nIndexSel);
}
int32_t IFWL_ListBox::GetSelIndex(int32_t nIndex) {
- return ((CFWL_ListBoxImp*)m_pImpl)->GetSelIndex(nIndex);
+ return static_cast<CFWL_ListBoxImp*>(GetImpl())->GetSelIndex(nIndex);
}
FWL_ERR IFWL_ListBox::SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect) {
- return ((CFWL_ListBoxImp*)m_pImpl)->SetSelItem(hItem, bSelect);
+ return static_cast<CFWL_ListBoxImp*>(GetImpl())->SetSelItem(hItem, bSelect);
}
FWL_ERR IFWL_ListBox::GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText) {
- return ((CFWL_ListBoxImp*)m_pImpl)->GetItemText(hItem, wsText);
+ return static_cast<CFWL_ListBoxImp*>(GetImpl())->GetItemText(hItem, wsText);
}
FWL_ERR IFWL_ListBox::GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert) {
- return ((CFWL_ListBoxImp*)m_pImpl)->GetScrollPos(fPos, bVert);
+ return static_cast<CFWL_ListBoxImp*>(GetImpl())->GetScrollPos(fPos, bVert);
}
FWL_ERR* IFWL_ListBox::Sort(IFWL_ListBoxCompare* pCom) {
- return ((CFWL_ListBoxImp*)m_pImpl)->Sort(pCom);
+ return static_cast<CFWL_ListBoxImp*>(GetImpl())->Sort(pCom);
}
CFWL_ListBoxImp::CFWL_ListBoxImp(IFWL_Widget* pOuter)
: CFWL_WidgetImp(pOuter),

Powered by Google App Engine
This is Rietveld 408576698