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

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

Issue 1986503002: XFA_WIDGETSTATUS, LAYOUTSTATUS and WIDGETFILTER cleanup. (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/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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 uint32_t dwFilter, 114 uint32_t dwFilter,
115 FX_BOOL bTraversal, 115 FX_BOOL bTraversal,
116 FX_BOOL bIgnorerelevant) { 116 FX_BOOL bIgnorerelevant) {
117 CXFA_WidgetAcc* pWidgetAcc = pWidget->GetDataAcc(); 117 CXFA_WidgetAcc* pWidgetAcc = pWidget->GetDataAcc();
118 uint32_t dwType = dwFilter & XFA_WIDGETFILTER_AllType; 118 uint32_t dwType = dwFilter & XFA_WIDGETFILTER_AllType;
119 if ((dwType == XFA_WIDGETFILTER_Field) && 119 if ((dwType == XFA_WIDGETFILTER_Field) &&
120 (pWidgetAcc->GetClassID() != XFA_ELEMENT_Field)) { 120 (pWidgetAcc->GetClassID() != XFA_ELEMENT_Field)) {
121 return FALSE; 121 return FALSE;
122 } 122 }
123 uint32_t dwStatus = pWidget->GetStatus(); 123 uint32_t dwStatus = pWidget->GetStatus();
124 if (bTraversal && (dwStatus & XFA_WIDGETSTATUS_Disabled)) { 124 if (bTraversal && (dwStatus & XFA_WidgetStatus_Disabled)) {
125 return FALSE; 125 return FALSE;
126 } 126 }
127 if (bIgnorerelevant) { 127 if (bIgnorerelevant) {
128 return (dwStatus & XFA_WIDGETFILTER_Visible) != 0; 128 return (dwStatus & XFA_WIDGETFILTER_Visible) != 0;
129 } 129 }
130 dwFilter &= (XFA_WIDGETFILTER_Visible | XFA_WIDGETFILTER_Viewable | 130 dwFilter &= (XFA_WIDGETFILTER_Visible | XFA_WIDGETFILTER_Viewable |
131 XFA_WIDGETFILTER_Printable); 131 XFA_WIDGETFILTER_Printable);
132 return (dwFilter & dwStatus) == dwFilter; 132 return (dwFilter & dwStatus) == dwFilter;
133 } 133 }
134 CXFA_FFPageWidgetIterator::CXFA_FFPageWidgetIterator(CXFA_FFPageView* pPageView, 134 CXFA_FFPageWidgetIterator::CXFA_FFPageWidgetIterator(CXFA_FFPageView* pPageView,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 FX_BOOL CXFA_FFPageWidgetIterator::SetCurrentWidget(CXFA_FFWidget* hWidget) { 183 FX_BOOL CXFA_FFPageWidgetIterator::SetCurrentWidget(CXFA_FFWidget* hWidget) {
184 return hWidget && m_sIterator.SetCurrent(hWidget); 184 return hWidget && m_sIterator.SetCurrent(hWidget);
185 } 185 }
186 CXFA_FFWidget* CXFA_FFPageWidgetIterator::GetWidget( 186 CXFA_FFWidget* CXFA_FFPageWidgetIterator::GetWidget(
187 CXFA_LayoutItem* pLayoutItem) { 187 CXFA_LayoutItem* pLayoutItem) {
188 if (CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pLayoutItem)) { 188 if (CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pLayoutItem)) {
189 if (!XFA_PageWidgetFilter(pWidget, m_dwFilter, FALSE, m_bIgnorerelevant)) { 189 if (!XFA_PageWidgetFilter(pWidget, m_dwFilter, FALSE, m_bIgnorerelevant)) {
190 return NULL; 190 return NULL;
191 } 191 }
192 if (!pWidget->IsLoaded() && 192 if (!pWidget->IsLoaded() &&
193 (pWidget->GetStatus() & XFA_WIDGETSTATUS_Visible) != 0) { 193 (pWidget->GetStatus() & XFA_WidgetStatus_Visible) != 0) {
194 pWidget->LoadWidget(); 194 pWidget->LoadWidget();
195 } 195 }
196 return pWidget; 196 return pWidget;
197 } 197 }
198 return NULL; 198 return NULL;
199 } 199 }
200 CXFA_FFTabOrderPageWidgetIterator::CXFA_FFTabOrderPageWidgetIterator( 200 CXFA_FFTabOrderPageWidgetIterator::CXFA_FFTabOrderPageWidgetIterator(
201 CXFA_FFPageView* pPageView, 201 CXFA_FFPageView* pPageView,
202 uint32_t dwFilter) 202 uint32_t dwFilter)
203 : m_pPageView(pPageView), m_dwFilter(dwFilter), m_iCurWidget(-1) { 203 : m_pPageView(pPageView), m_dwFilter(dwFilter), m_iCurWidget(-1) {
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 OrderContainer(&sIterator, NULL, pParam, bCurrentItem, bContentArea, TRUE); 420 OrderContainer(&sIterator, NULL, pParam, bCurrentItem, bContentArea, TRUE);
421 if (pParam->m_Children.GetSize() > 0) { 421 if (pParam->m_Children.GetSize() > 0) {
422 WidgetArray.Append(pParam->m_Children); 422 WidgetArray.Append(pParam->m_Children);
423 } 423 }
424 delete pParam; 424 delete pParam;
425 } 425 }
426 CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::GetWidget( 426 CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::GetWidget(
427 CXFA_LayoutItem* pLayoutItem) { 427 CXFA_LayoutItem* pLayoutItem) {
428 if (CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pLayoutItem)) { 428 if (CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pLayoutItem)) {
429 if (!pWidget->IsLoaded() && 429 if (!pWidget->IsLoaded() &&
430 (pWidget->GetStatus() & XFA_WIDGETSTATUS_Visible)) { 430 (pWidget->GetStatus() & XFA_WidgetStatus_Visible)) {
431 pWidget->LoadWidget(); 431 pWidget->LoadWidget();
432 } 432 }
433 return pWidget; 433 return pWidget;
434 } 434 }
435 return NULL; 435 return NULL;
436 } 436 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698