From 935d8d5dcbf1da2b3198675428cbf7ca0406788f Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 17 May 2016 10:32:18 -0700 Subject: XFA_WIDGETSTATUS cleanup. This CL moves all of the XFA_WIDGETSTATUS values into a single enum instead of multiple defines. The values are also normalized. The name was updated to be XFA_WidgetStatus. The XFA_WIDGETFILTER and XFA_LAYOUTSTATUS defines had to match up to XFA_WIDGETSTATUS. This Cl replaces those so we just have a single enum to work with. Review-Url: https://codereview.chromium.org/1986503002 --- fpdfsdk/fpdfformfill.cpp | 5 ++--- fpdfsdk/fsdk_annothandler.cpp | 10 +++++----- fpdfsdk/fsdk_mgr.cpp | 7 +++---- 3 files changed, 10 insertions(+), 12 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp index 94a8bf12a5..f949da1019 100644 --- a/fpdfsdk/fpdfformfill.cpp +++ b/fpdfsdk/fpdfformfill.cpp @@ -92,9 +92,8 @@ DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, return -1; std::unique_ptr pWidgetIterator( - pPageView->CreateWidgetIterator( - XFA_TRAVERSEWAY_Form, - XFA_WIDGETFILTER_Viewable | XFA_WIDGETFILTER_AllType)); + pPageView->CreateWidgetIterator(XFA_TRAVERSEWAY_Form, + XFA_WidgetStatus_Viewable)); if (!pWidgetIterator) return -1; diff --git a/fpdfsdk/fsdk_annothandler.cpp b/fpdfsdk/fsdk_annothandler.cpp index db2d20b2bf..cbcb53e169 100644 --- a/fpdfsdk/fsdk_annothandler.cpp +++ b/fpdfsdk/fsdk_annothandler.cpp @@ -378,9 +378,9 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot, // for xfa annots std::unique_ptr pWidgetIterator( pPage->GetXFAPageView()->CreateWidgetIterator( - XFA_TRAVERSEWAY_Tranvalse, XFA_WIDGETFILTER_Visible | - XFA_WIDGETFILTER_Viewable | - XFA_WIDGETFILTER_Field)); + XFA_TRAVERSEWAY_Tranvalse, XFA_WidgetStatus_Visible | + XFA_WidgetStatus_Viewable | + XFA_WidgetStatus_Focused)); if (!pWidgetIterator) return nullptr; if (pWidgetIterator->GetCurrentWidget() != pSDKAnnot->GetXFAWidget()) @@ -780,9 +780,9 @@ CFX_FloatRect CPDFSDK_XFAAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, CFX_RectF rcBBox; XFA_ELEMENT eType = pAnnot->GetXFAWidget()->GetDataAcc()->GetUIType(); if (eType == XFA_ELEMENT_Signature) - pAnnot->GetXFAWidget()->GetBBox(rcBBox, XFA_WIDGETSTATUS_Visible, TRUE); + pAnnot->GetXFAWidget()->GetBBox(rcBBox, XFA_WidgetStatus_Visible, TRUE); else - pAnnot->GetXFAWidget()->GetBBox(rcBBox, 0); + pAnnot->GetXFAWidget()->GetBBox(rcBBox, XFA_WidgetStatus_None); CFX_FloatRect rcWidget(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width, rcBBox.top + rcBBox.height); diff --git a/fpdfsdk/fsdk_mgr.cpp b/fpdfsdk/fsdk_mgr.cpp index 95a08a740c..40a891ca1e 100644 --- a/fpdfsdk/fsdk_mgr.cpp +++ b/fpdfsdk/fsdk_mgr.cpp @@ -907,10 +907,9 @@ void CPDFSDK_PageView::LoadFXAnnots() { if (m_pSDKDoc->GetXFADocument()->GetDocType() == DOCTYPE_DYNAMIC_XFA) { CXFA_FFPageView* pageView = m_page->GetXFAPageView(); std::unique_ptr pWidgetHander( - pageView->CreateWidgetIterator(XFA_TRAVERSEWAY_Form, - XFA_WIDGETFILTER_Visible | - XFA_WIDGETFILTER_Viewable | - XFA_WIDGETFILTER_AllType)); + pageView->CreateWidgetIterator( + XFA_TRAVERSEWAY_Form, + XFA_WidgetStatus_Visible | XFA_WidgetStatus_Viewable)); if (!pWidgetHander) { SetLock(FALSE); return; -- cgit v1.2.3