diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-04 13:40:07 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-04 18:58:11 +0000 |
commit | 4a1de7211af344f6acc784f4fe346ef8c8da7bd1 (patch) | |
tree | 563ae3e7eda4a4d440e0c2246319e385f96948b9 /xfa/fxfa/cxfa_widgetacc.cpp | |
parent | c1e5756a43020665855d9d309c47b9dfe625b54f (diff) | |
download | pdfium-4a1de7211af344f6acc784f4fe346ef8c8da7bd1.tar.xz |
Change CXFA_WidgetAcc::GetNextWidget to not require the FFDocView
This CL changes GetNextWidget to assume that a valid parameter is passed
to the method. For callers which passed nullptr, we change to get a
vaild initial widget from the doc view directly.
Change-Id: I50c06082831645f62339ade59d5026f546e07840
Reviewed-on: https://pdfium-review.googlesource.com/22254
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_widgetacc.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_widgetacc.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp index f735633abe..8851d269c6 100644 --- a/xfa/fxfa/cxfa_widgetacc.cpp +++ b/xfa/fxfa/cxfa_widgetacc.cpp @@ -864,18 +864,12 @@ std::pair<int32_t, bool> CXFA_WidgetAcc::ExecuteBoolScript( } CXFA_FFWidget* CXFA_WidgetAcc::GetNextWidget(CXFA_FFWidget* pWidget) { - CXFA_LayoutItem* pLayout = nullptr; - if (pWidget) - pLayout = pWidget->GetNext(); - else - pLayout = m_pDocView->GetXFALayout()->GetLayoutItem(m_pNode); - - return static_cast<CXFA_FFWidget*>(pLayout); + return static_cast<CXFA_FFWidget*>(pWidget->GetNext()); } void CXFA_WidgetAcc::UpdateUIDisplay(CXFA_FFWidget* pExcept) { - CXFA_FFWidget* pWidget = nullptr; - while ((pWidget = GetNextWidget(pWidget)) != nullptr) { + CXFA_FFWidget* pWidget = m_pDocView->GetWidgetForNode(m_pNode); + for (; pWidget; pWidget = GetNextWidget(pWidget)) { if (pWidget == pExcept || !pWidget->IsLoaded() || (GetUIType() != XFA_Element::CheckButton && pWidget->IsFocused())) { continue; |