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

Side by Side 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, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fwl/core/fwl_formimp.h" 7 #include "xfa/fwl/core/fwl_formimp.h"
8 8
9 #include "xfa/fde/tto/fde_textout.h" 9 #include "xfa/fde/tto/fde_textout.h"
10 #include "xfa/fwl/basewidget/fwl_formproxyimp.h" 10 #include "xfa/fwl/basewidget/fwl_formproxyimp.h"
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 } 519 }
520 if (m_pMinBox && (m_pMinBox->m_dwState & dwState)) { 520 if (m_pMinBox && (m_pMinBox->m_dwState & dwState)) {
521 return m_pMinBox; 521 return m_pMinBox;
522 } 522 }
523 if (m_pCaptionBox && (m_pCaptionBox->m_dwState & dwState)) { 523 if (m_pCaptionBox && (m_pCaptionBox->m_dwState & dwState)) {
524 return m_pCaptionBox; 524 return m_pCaptionBox;
525 } 525 }
526 return NULL; 526 return NULL;
527 } 527 }
528 CFWL_SysBtn* CFWL_FormImp::GetSysBtnByIndex(int32_t nIndex) { 528 CFWL_SysBtn* CFWL_FormImp::GetSysBtnByIndex(int32_t nIndex) {
529 if (nIndex < 0) { 529 if (nIndex < 0)
530 return NULL; 530 return nullptr;
531 } 531
532 CFX_PtrArray arrBtn; 532 CFX_ArrayTemplate<CFWL_SysBtn*> arrBtn;
533 if (m_pMinBox) { 533 if (m_pMinBox)
534 arrBtn.Add(m_pMinBox); 534 arrBtn.Add(m_pMinBox);
535 } 535
536 if (m_pMaxBox) { 536 if (m_pMaxBox)
537 arrBtn.Add(m_pMaxBox); 537 arrBtn.Add(m_pMaxBox);
538 } 538
539 if (m_pCloseBox) { 539 if (m_pCloseBox)
540 arrBtn.Add(m_pCloseBox); 540 arrBtn.Add(m_pCloseBox);
541 } 541
542 return static_cast<CFWL_SysBtn*>(arrBtn[nIndex]); 542 return arrBtn[nIndex];
543 } 543 }
544 int32_t CFWL_FormImp::GetSysBtnIndex(CFWL_SysBtn* pBtn) { 544 int32_t CFWL_FormImp::GetSysBtnIndex(CFWL_SysBtn* pBtn) {
545 CFX_PtrArray arrBtn; 545 CFX_ArrayTemplate<CFWL_SysBtn*> arrBtn;
546 if (m_pMinBox) { 546 if (m_pMinBox)
547 arrBtn.Add(m_pMinBox); 547 arrBtn.Add(m_pMinBox);
548 } 548
549 if (m_pMaxBox) { 549 if (m_pMaxBox)
550 arrBtn.Add(m_pMaxBox); 550 arrBtn.Add(m_pMaxBox);
551 } 551
552 if (m_pCloseBox) { 552 if (m_pCloseBox)
553 arrBtn.Add(m_pCloseBox); 553 arrBtn.Add(m_pCloseBox);
554 } 554
555 return arrBtn.Find(pBtn); 555 return arrBtn.Find(pBtn);
556 } 556 }
557 FX_FLOAT CFWL_FormImp::GetCaptionHeight() { 557 FX_FLOAT CFWL_FormImp::GetCaptionHeight() {
558 CFWL_WidgetCapacity dwCapacity = CFWL_WidgetCapacity::None; 558 CFWL_WidgetCapacity dwCapacity = CFWL_WidgetCapacity::None;
559 559
560 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Caption) { 560 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Caption) {
561 dwCapacity = CFWL_WidgetCapacity::CYCaption; 561 dwCapacity = CFWL_WidgetCapacity::CYCaption;
562 } else if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_NarrowCaption) { 562 } else if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_NarrowCaption) {
563 dwCapacity = CFWL_WidgetCapacity::CYNarrowCaption; 563 dwCapacity = CFWL_WidgetCapacity::CYNarrowCaption;
564 } 564 }
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 } 1152 }
1153 void CFWL_FormImpDelegate::OnWindowMove(CFWL_MsgWindowMove* pMsg) { 1153 void CFWL_FormImpDelegate::OnWindowMove(CFWL_MsgWindowMove* pMsg) {
1154 m_pOwner->m_pProperties->m_rtWidget.left = pMsg->m_fx; 1154 m_pOwner->m_pProperties->m_rtWidget.left = pMsg->m_fx;
1155 m_pOwner->m_pProperties->m_rtWidget.top = pMsg->m_fy; 1155 m_pOwner->m_pProperties->m_rtWidget.top = pMsg->m_fy;
1156 } 1156 }
1157 void CFWL_FormImpDelegate::OnClose(CFWL_MsgClose* pMsg) { 1157 void CFWL_FormImpDelegate::OnClose(CFWL_MsgClose* pMsg) {
1158 CFWL_EvtClose eClose; 1158 CFWL_EvtClose eClose;
1159 eClose.m_pSrcTarget = m_pOwner->m_pInterface; 1159 eClose.m_pSrcTarget = m_pOwner->m_pInterface;
1160 m_pOwner->DispatchEvent(&eClose); 1160 m_pOwner->DispatchEvent(&eClose);
1161 } 1161 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698