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

Unified Diff: xfa/fwl/core/fwl_formimp.cpp

Issue 1937453002: Replace CFX_PtryArray with typesafe CFX_ArrayTemplate, Part 7 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months 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/fwl/core/fwl_formimp.cpp
diff --git a/xfa/fwl/core/fwl_formimp.cpp b/xfa/fwl/core/fwl_formimp.cpp
index 2fd85a8d0eb7d74fcc11dd9af1edea935df5dea2..bbec673ed606a2e1c4a4eabed2aeafa265cdd84a 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<CFWL_SysBtn*> 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<CFWL_SysBtn*>(arrBtn[nIndex]);
+
+ return arrBtn[nIndex];
}
int32_t CFWL_FormImp::GetSysBtnIndex(CFWL_SysBtn* pBtn) {
- CFX_PtrArray arrBtn;
- if (m_pMinBox) {
+ CFX_ArrayTemplate<CFWL_SysBtn*> 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() {

Powered by Google App Engine
This is Rietveld 408576698