diff options
author | dsinclair <dsinclair@chromium.org> | 2016-10-11 09:13:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-11 09:13:01 -0700 |
commit | 690c033e86b34f7a9c3d4be15759c63ef9360217 (patch) | |
tree | fdbde142926cd9f77882e0d5984770267561ad32 /fpdfsdk/javascript | |
parent | 232ce9365df0768846972be34a3a84f915bf7e82 (diff) | |
download | pdfium-690c033e86b34f7a9c3d4be15759c63ef9360217.tar.xz |
Convert CPDFSDK_InterForm to take a CPDFSDK_FormFillEnvironment
This CL removes CPDFSDK_Document from CPDFSDK_InterForm and has it work with
a CPDFSDK_FormFillEnvironment.
Review-Url: https://codereview.chromium.org/2397723005
Diffstat (limited to 'fpdfsdk/javascript')
-rw-r--r-- | fpdfsdk/javascript/Field.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp index fa2ac70aa5..14e0692b60 100644 --- a/fpdfsdk/javascript/Field.cpp +++ b/fpdfsdk/javascript/Field.cpp @@ -295,9 +295,14 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument, std::vector<CPDFSDK_Widget*> widgets; pInterForm->GetWidgets(pFormField, &widgets); + // TODO(dsinclair): Determine if all widgets share the same + // CPDFSDK_InterForm. If that's the case, we can move the code to + // |GetSDKDocument| out of the loop. for (CPDFSDK_Widget* pWidget : widgets) { - CPDFSDK_Document* pDoc = pWidget->GetInterForm()->GetDocument(); - pDoc->UpdateAllViews(nullptr, pWidget); + pWidget->GetInterForm() + ->GetFormFillEnv() + ->GetSDKDocument() + ->UpdateAllViews(nullptr, pWidget); } } @@ -330,8 +335,8 @@ void Field::UpdateFormControl(CPDFSDK_Document* pDocument, if (bRefresh) { CPDFSDK_InterForm* pInterForm = pWidget->GetInterForm(); - CPDFSDK_Document* pDoc = pInterForm->GetDocument(); - pDoc->UpdateAllViews(nullptr, pWidget); + pInterForm->GetFormFillEnv()->GetSDKDocument()->UpdateAllViews(nullptr, + pWidget); } } |