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_ffnotify.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_ffnotify.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_ffnotify.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/xfa/fxfa/cxfa_ffnotify.cpp b/xfa/fxfa/cxfa_ffnotify.cpp index 616edf7507..c7872f662b 100644 --- a/xfa/fxfa/cxfa_ffnotify.cpp +++ b/xfa/fxfa/cxfa_ffnotify.cpp @@ -70,8 +70,9 @@ void CXFA_FFNotify::OnWidgetListItemAdded(CXFA_WidgetAcc* pSender, if (pSender->GetUIType() != XFA_Element::ChoiceList) return; - CXFA_FFWidget* pWidget = nullptr; - while ((pWidget = pSender->GetNextWidget(pWidget)) != nullptr) { + CXFA_FFWidget* pWidget = + m_pDoc->GetDocView()->GetWidgetForNode(pSender->GetNode()); + for (; pWidget; pWidget = pSender->GetNextWidget(pWidget)) { if (pWidget->IsLoaded()) { if (pSender->IsListBox()) ToListBox(pWidget)->InsertItem(pLabel, iIndex); @@ -86,8 +87,9 @@ void CXFA_FFNotify::OnWidgetListItemRemoved(CXFA_WidgetAcc* pSender, if (pSender->GetUIType() != XFA_Element::ChoiceList) return; - CXFA_FFWidget* pWidget = nullptr; - while ((pWidget = pSender->GetNextWidget(pWidget)) != nullptr) { + CXFA_FFWidget* pWidget = + m_pDoc->GetDocView()->GetWidgetForNode(pSender->GetNode()); + for (; pWidget; pWidget = pSender->GetNextWidget(pWidget)) { if (pWidget->IsLoaded()) { if (pSender->IsListBox()) ToListBox(pWidget)->DeleteItem(iIndex); @@ -369,8 +371,9 @@ void CXFA_FFNotify::OnValueChanging(CXFA_Node* pSender, XFA_Attribute eAttr) { if (!pWidgetAcc) return; - CXFA_FFWidget* pWidget = nullptr; - while ((pWidget = pWidgetAcc->GetNextWidget(pWidget)) != nullptr) { + CXFA_FFWidget* pWidget = + m_pDoc->GetDocView()->GetWidgetForNode(pWidgetAcc->GetNode()); + for (; pWidget; pWidget = pWidgetAcc->GetNextWidget(pWidget)) { if (pWidget->IsLoaded()) pWidget->AddInvalidateRect(); } @@ -432,8 +435,9 @@ void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender, } } - CXFA_FFWidget* pWidget = nullptr; - while ((pWidget = pWidgetAcc->GetNextWidget(pWidget)) != nullptr) { + CXFA_FFWidget* pWidget = + m_pDoc->GetDocView()->GetWidgetForNode(pWidgetAcc->GetNode()); + for (; pWidget; pWidget = pWidgetAcc->GetNextWidget(pWidget)) { if (!pWidget->IsLoaded()) continue; |