From d15ba4e29607665db35bc6fb610cc566981b324a Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 29 Apr 2016 09:45:46 -0700 Subject: Replace CFX_PtryArray with typesafe CFX_ArrayTemplate, Part 7 Remaining uses are all in fxbarcode/. Review-Url: https://codereview.chromium.org/1937453002 --- xfa/fwl/core/fwl_formimp.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'xfa/fwl/core/fwl_formimp.cpp') diff --git a/xfa/fwl/core/fwl_formimp.cpp b/xfa/fwl/core/fwl_formimp.cpp index 2fd85a8d0e..bbec673ed6 100644 --- a/xfa/fwl/core/fwl_formimp.cpp +++ b/xfa/fwl/core/fwl_formimp.cpp @@ -526,32 +526,32 @@ CFWL_SysBtn* CFWL_FormImp::GetSysBtnByState(uint32_t dwState) { return NULL; } CFWL_SysBtn* CFWL_FormImp::GetSysBtnByIndex(int32_t nIndex) { - if (nIndex < 0) { - return NULL; - } - CFX_PtrArray arrBtn; - if (m_pMinBox) { + if (nIndex < 0) + return nullptr; + + CFX_ArrayTemplate arrBtn; + if (m_pMinBox) arrBtn.Add(m_pMinBox); - } - if (m_pMaxBox) { + + if (m_pMaxBox) arrBtn.Add(m_pMaxBox); - } - if (m_pCloseBox) { + + if (m_pCloseBox) arrBtn.Add(m_pCloseBox); - } - return static_cast(arrBtn[nIndex]); + + return arrBtn[nIndex]; } int32_t CFWL_FormImp::GetSysBtnIndex(CFWL_SysBtn* pBtn) { - CFX_PtrArray arrBtn; - if (m_pMinBox) { + CFX_ArrayTemplate arrBtn; + if (m_pMinBox) arrBtn.Add(m_pMinBox); - } - if (m_pMaxBox) { + + if (m_pMaxBox) arrBtn.Add(m_pMaxBox); - } - if (m_pCloseBox) { + + if (m_pCloseBox) arrBtn.Add(m_pCloseBox); - } + return arrBtn.Find(pBtn); } FX_FLOAT CFWL_FormImp::GetCaptionHeight() { -- cgit v1.2.3