OLD | NEW |
---|---|
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 | |
90 XFA_WidgetStatus_Printable); | 90 XFA_WidgetStatus_Printable); |
91 return (dwFilter & dwStatus) == dwFilter; | 91 return (dwFilter & dwStatus) == dwFilter; |
92 } | 92 } |
93 | 93 |
94 FX_BOOL IsLayoutElement(XFA_Element eElement, FX_BOOL bLayoutContainer) { | |
Lei Zhang
2016/07/07 19:36:18
bools?
dsinclair
2016/07/07 19:47:48
Done.
| |
95 switch (eElement) { | |
96 case XFA_Element::Draw: | |
97 case XFA_Element::Field: | |
98 case XFA_Element::InstanceManager: | |
99 return !bLayoutContainer; | |
100 case XFA_Element::Area: | |
101 case XFA_Element::Subform: | |
102 case XFA_Element::ExclGroup: | |
103 case XFA_Element::SubformSet: | |
104 case XFA_Element::PageArea: | |
105 case XFA_Element::Form: | |
106 return TRUE; | |
107 default: | |
108 return FALSE; | |
109 } | |
110 } | |
111 | |
94 } // namespace | 112 } // namespace |
95 | 113 |
96 CXFA_FFPageView::CXFA_FFPageView(CXFA_FFDocView* pDocView, CXFA_Node* pPageArea) | 114 CXFA_FFPageView::CXFA_FFPageView(CXFA_FFDocView* pDocView, CXFA_Node* pPageArea) |
97 : CXFA_ContainerLayoutItem(pPageArea), m_pDocView(pDocView) {} | 115 : CXFA_ContainerLayoutItem(pPageArea), m_pDocView(pDocView) {} |
98 | 116 |
99 CXFA_FFPageView::~CXFA_FFPageView() {} | 117 CXFA_FFPageView::~CXFA_FFPageView() {} |
100 | 118 |
101 CXFA_FFDocView* CXFA_FFPageView::GetDocView() const { | 119 CXFA_FFDocView* CXFA_FFPageView::GetDocView() const { |
102 return m_pDocView; | 120 return m_pDocView; |
103 } | 121 } |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
366 pSearchItem = sIterator->MoveToNext(); | 384 pSearchItem = sIterator->MoveToNext(); |
367 continue; | 385 continue; |
368 } | 386 } |
369 if (pContainerItem && (pSearchItem->GetParent() != pContainerItem)) { | 387 if (pContainerItem && (pSearchItem->GetParent() != pContainerItem)) { |
370 bCurrentItem = TRUE; | 388 bCurrentItem = TRUE; |
371 break; | 389 break; |
372 } | 390 } |
373 CXFA_TabParam* pParam = new CXFA_TabParam; | 391 CXFA_TabParam* pParam = new CXFA_TabParam; |
374 pParam->m_pWidget = hWidget; | 392 pParam->m_pWidget = hWidget; |
375 tabParams.Add(pParam); | 393 tabParams.Add(pParam); |
376 if (XFA_IsLayoutElement(pSearchItem->GetFormNode()->GetElementType(), | 394 if (IsLayoutElement(pSearchItem->GetFormNode()->GetElementType(), TRUE)) { |
377 TRUE)) { | |
378 OrderContainer(sIterator, pSearchItem, pParam, bCurrentItem, | 395 OrderContainer(sIterator, pSearchItem, pParam, bCurrentItem, |
379 bContentArea, bMarsterPage); | 396 bContentArea, bMarsterPage); |
380 } | 397 } |
381 } | 398 } |
382 if (bCurrentItem) { | 399 if (bCurrentItem) { |
383 pSearchItem = sIterator->GetCurrent(); | 400 pSearchItem = sIterator->GetCurrent(); |
384 bCurrentItem = FALSE; | 401 bCurrentItem = FALSE; |
385 } else { | 402 } else { |
386 pSearchItem = sIterator->MoveToNext(); | 403 pSearchItem = sIterator->MoveToNext(); |
387 } | 404 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
430 pWidget->LoadWidget(); | 447 pWidget->LoadWidget(); |
431 } | 448 } |
432 return pWidget; | 449 return pWidget; |
433 } | 450 } |
434 return nullptr; | 451 return nullptr; |
435 } | 452 } |
436 | 453 |
437 CXFA_TabParam::CXFA_TabParam() : m_pWidget(nullptr) {} | 454 CXFA_TabParam::CXFA_TabParam() : m_pWidget(nullptr) {} |
438 | 455 |
439 CXFA_TabParam::~CXFA_TabParam() {} | 456 CXFA_TabParam::~CXFA_TabParam() {} |
OLD | NEW |