diff options
author | tsepez <tsepez@chromium.org> | 2016-05-24 09:46:02 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-24 09:46:02 -0700 |
commit | 1529756d0d62638ea0fc7965416bef717ff47413 (patch) | |
tree | 81f94e0c8cc9e093a97bf59d907d051bb6086039 /xfa/fwl/core/fwl_formimp.cpp | |
parent | ded3634145b214b11212a7c53faa8ba15a1789ca (diff) | |
download | pdfium-1529756d0d62638ea0fc7965416bef717ff47413.tar.xz |
Remove IWFL_WidgetMgr in favor of CFWL_WidgetMgr.
The pure virtual class isn't buying us anything, and is costing
us an otherwise unneeded vtable.
Fix pre-existing presubmit warning in fwl_noteimp.cpp:88:
If statement had no body and no else clause ...
Remove switch on enum() and make separate GetWidget() methods.
Review-Url: https://codereview.chromium.org/2004213002
Diffstat (limited to 'xfa/fwl/core/fwl_formimp.cpp')
-rw-r--r-- | xfa/fwl/core/fwl_formimp.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/xfa/fwl/core/fwl_formimp.cpp b/xfa/fwl/core/fwl_formimp.cpp index bcaba2c153..9cfd70e4c7 100644 --- a/xfa/fwl/core/fwl_formimp.cpp +++ b/xfa/fwl/core/fwl_formimp.cpp @@ -151,7 +151,7 @@ FWL_Error CFWL_FormImp::GetClientRect(CFX_RectF& rect) { } #ifdef FWL_UseMacSystemBorder rect = m_rtRelative; - CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); + CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance(); if (!pWidgetMgr) return FWL_Error::Indefinite; @@ -447,15 +447,15 @@ void CFWL_FormImp::ShowChildWidget(IFWL_Widget* pParent) { IFWL_App* pApp = FWL_GetApp(); if (!pApp) return; - CFWL_WidgetMgr* pWidgetMgr = - static_cast<CFWL_WidgetMgr*>(pApp->GetWidgetMgr()); + + CFWL_WidgetMgr* pWidgetMgr = pApp->GetWidgetMgr(); if (!pWidgetMgr) return; - IFWL_Widget* pChild = - pWidgetMgr->GetWidget(pParent, FWL_WGTRELATION_FirstChild); + + IFWL_Widget* pChild = pWidgetMgr->GetFirstChildWidget(pParent); while (pChild) { ShowChildWidget(pChild); - pChild = pWidgetMgr->GetWidget(pChild, FWL_WGTRELATION_NextSibling); + pChild = pWidgetMgr->GetNextSiblingWidget(pChild); } } @@ -616,7 +616,7 @@ void CFWL_FormImp::GetEdgeRect(CFX_RectF& rtEdge) { } void CFWL_FormImp::SetWorkAreaRect() { m_rtRestore = m_pProperties->m_rtWidget; - CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); + CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance(); if (!pWidgetMgr) return; m_bSetMaximize = TRUE; @@ -765,7 +765,7 @@ FX_BOOL CFWL_FormImp::HasIcon() { return !!pData->GetIcon(m_pInterface, FALSE); } void CFWL_FormImp::UpdateIcon() { - CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); + CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance(); if (!pWidgetMgr) return; IFWL_FormDP* pData = @@ -778,7 +778,7 @@ void CFWL_FormImp::UpdateIcon() { m_pSmallIcon = pSmallIcon; } void CFWL_FormImp::UpdateCaption() { - CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); + CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance(); if (!pWidgetMgr) return; IFWL_FormDP* pData = @@ -935,8 +935,7 @@ void CFWL_FormImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { break; } case CFWL_MessageType::Size: { - CFWL_WidgetMgr* pWidgetMgr = - static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); + CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance(); if (!pWidgetMgr) return; |