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

Side by Side Diff: xfa/fxfa/app/xfa_ffpageview.cpp

Issue 2089443002: Convert XFA_ELEMENT to an enum class (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: More unknown checks Created 4 years, 6 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
« no previous file with comments | « xfa/fxfa/app/xfa_ffnotify.cpp ('k') | xfa/fxfa/app/xfa_fftextedit.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/fxfa/include/xfa_ffpageview.h" 7 #include "xfa/fxfa/include/xfa_ffpageview.h"
8 8
9 #include "xfa/fde/fde_render.h" 9 #include "xfa/fde/fde_render.h"
10 #include "xfa/fxfa/app/xfa_ffcheckbutton.h" 10 #include "xfa/fxfa/app/xfa_ffcheckbutton.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 pageMatrix = m; 69 pageMatrix = m;
70 } 70 }
71 71
72 bool PageWidgetFilter(CXFA_FFWidget* pWidget, 72 bool PageWidgetFilter(CXFA_FFWidget* pWidget,
73 uint32_t dwFilter, 73 uint32_t dwFilter,
74 FX_BOOL bTraversal, 74 FX_BOOL bTraversal,
75 FX_BOOL bIgnorerelevant) { 75 FX_BOOL bIgnorerelevant) {
76 CXFA_WidgetAcc* pWidgetAcc = pWidget->GetDataAcc(); 76 CXFA_WidgetAcc* pWidgetAcc = pWidget->GetDataAcc();
77 77
78 if (!!(dwFilter & XFA_WidgetStatus_Focused) && 78 if (!!(dwFilter & XFA_WidgetStatus_Focused) &&
79 pWidgetAcc->GetClassID() != XFA_ELEMENT_Field) { 79 pWidgetAcc->GetClassID() != XFA_Element::Field) {
80 return false; 80 return false;
81 } 81 }
82 82
83 uint32_t dwStatus = pWidget->GetStatus(); 83 uint32_t dwStatus = pWidget->GetStatus();
84 if (bTraversal && (dwStatus & XFA_WidgetStatus_Disabled)) 84 if (bTraversal && (dwStatus & XFA_WidgetStatus_Disabled))
85 return false; 85 return false;
86 if (bIgnorerelevant) 86 if (bIgnorerelevant)
87 return !!(dwStatus & XFA_WidgetStatus_Visible); 87 return !!(dwStatus & XFA_WidgetStatus_Visible);
88 88
89 dwFilter &= (XFA_WidgetStatus_Visible | XFA_WidgetStatus_Viewable | 89 dwFilter &= (XFA_WidgetStatus_Visible | XFA_WidgetStatus_Viewable |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 int32_t iWidgetIndex = m_TabOrderWidgetArray.Find(hWidget); 269 int32_t iWidgetIndex = m_TabOrderWidgetArray.Find(hWidget);
270 if (iWidgetIndex >= 0) { 270 if (iWidgetIndex >= 0) {
271 m_iCurWidget = iWidgetIndex; 271 m_iCurWidget = iWidgetIndex;
272 return TRUE; 272 return TRUE;
273 } 273 }
274 return FALSE; 274 return FALSE;
275 } 275 }
276 CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::GetTraverseWidget( 276 CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::GetTraverseWidget(
277 CXFA_FFWidget* pWidget) { 277 CXFA_FFWidget* pWidget) {
278 CXFA_WidgetAcc* pAcc = pWidget->GetDataAcc(); 278 CXFA_WidgetAcc* pAcc = pWidget->GetDataAcc();
279 CXFA_Node* pTraversal = pAcc->GetNode()->GetChild(0, XFA_ELEMENT_Traversal); 279 CXFA_Node* pTraversal = pAcc->GetNode()->GetChild(0, XFA_Element::Traversal);
280 if (pTraversal) { 280 if (pTraversal) {
281 CXFA_Node* pTraverse = pTraversal->GetChild(0, XFA_ELEMENT_Traverse); 281 CXFA_Node* pTraverse = pTraversal->GetChild(0, XFA_Element::Traverse);
282 if (pTraverse) { 282 if (pTraverse) {
283 CFX_WideString wsTraverseWidgetName; 283 CFX_WideString wsTraverseWidgetName;
284 if (pTraverse->GetAttribute(XFA_ATTRIBUTE_Ref, wsTraverseWidgetName)) { 284 if (pTraverse->GetAttribute(XFA_ATTRIBUTE_Ref, wsTraverseWidgetName)) {
285 return FindWidgetByName(wsTraverseWidgetName, pWidget); 285 return FindWidgetByName(wsTraverseWidgetName, pWidget);
286 } 286 }
287 } 287 }
288 } 288 }
289 return NULL; 289 return NULL;
290 } 290 }
291 CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::FindWidgetByName( 291 CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::FindWidgetByName(
292 const CFX_WideString& wsWidgetName, 292 const CFX_WideString& wsWidgetName,
293 CXFA_FFWidget* pRefWidget) { 293 CXFA_FFWidget* pRefWidget) {
294 return pRefWidget->GetDocView()->GetWidgetByName(wsWidgetName, pRefWidget); 294 return pRefWidget->GetDocView()->GetWidgetByName(wsWidgetName, pRefWidget);
295 } 295 }
296 void CXFA_FFTabOrderPageWidgetIterator::CreateTabOrderWidgetArray() { 296 void CXFA_FFTabOrderPageWidgetIterator::CreateTabOrderWidgetArray() {
297 m_TabOrderWidgetArray.RemoveAll(); 297 m_TabOrderWidgetArray.RemoveAll();
298 CXFA_WidgetArray SpaceOrderWidgetArray; 298 CXFA_WidgetArray SpaceOrderWidgetArray;
299 CreateSpaceOrderWidgetArray(SpaceOrderWidgetArray); 299 CreateSpaceOrderWidgetArray(SpaceOrderWidgetArray);
300 int32_t nWidgetCount = SpaceOrderWidgetArray.GetSize(); 300 int32_t nWidgetCount = SpaceOrderWidgetArray.GetSize();
301 if (nWidgetCount < 1) { 301 if (nWidgetCount < 1) {
302 return; 302 return;
303 } 303 }
304 CXFA_FFWidget* hWidget = SpaceOrderWidgetArray[0]; 304 CXFA_FFWidget* hWidget = SpaceOrderWidgetArray[0];
305 for (; m_TabOrderWidgetArray.GetSize() < nWidgetCount;) { 305 for (; m_TabOrderWidgetArray.GetSize() < nWidgetCount;) {
306 if (m_TabOrderWidgetArray.Find(hWidget) < 0) { 306 if (m_TabOrderWidgetArray.Find(hWidget) < 0) {
307 m_TabOrderWidgetArray.Add(hWidget); 307 m_TabOrderWidgetArray.Add(hWidget);
308 CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc(); 308 CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc();
309 if (pWidgetAcc->GetUIType() == XFA_ELEMENT_ExclGroup) { 309 if (pWidgetAcc->GetUIType() == XFA_Element::ExclGroup) {
310 int32_t iWidgetIndex = SpaceOrderWidgetArray.Find(hWidget) + 1; 310 int32_t iWidgetIndex = SpaceOrderWidgetArray.Find(hWidget) + 1;
311 while (TRUE) { 311 while (TRUE) {
312 CXFA_FFWidget* pRadio = 312 CXFA_FFWidget* pRadio =
313 SpaceOrderWidgetArray[(iWidgetIndex) % nWidgetCount]; 313 SpaceOrderWidgetArray[(iWidgetIndex) % nWidgetCount];
314 if (pRadio->GetDataAcc()->GetExclGroup() != pWidgetAcc) { 314 if (pRadio->GetDataAcc()->GetExclGroup() != pWidgetAcc) {
315 break; 315 break;
316 } 316 }
317 if (m_TabOrderWidgetArray.Find(hWidget) < 0) { 317 if (m_TabOrderWidgetArray.Find(hWidget) < 0) {
318 m_TabOrderWidgetArray.Add(pRadio); 318 m_TabOrderWidgetArray.Add(pRadio);
319 } 319 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 pWidget->LoadWidget(); 429 pWidget->LoadWidget();
430 } 430 }
431 return pWidget; 431 return pWidget;
432 } 432 }
433 return NULL; 433 return NULL;
434 } 434 }
435 435
436 CXFA_TabParam::CXFA_TabParam() : m_pWidget(NULL) {} 436 CXFA_TabParam::CXFA_TabParam() : m_pWidget(NULL) {}
437 437
438 CXFA_TabParam::~CXFA_TabParam() {} 438 CXFA_TabParam::~CXFA_TabParam() {}
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_ffnotify.cpp ('k') | xfa/fxfa/app/xfa_fftextedit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698