diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-05-08 20:32:08 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-08 20:32:08 +0000 |
commit | 7b094f81483240f50dfc12e51cf545a8f0d5933d (patch) | |
tree | ca0cb1640471aa895ff381def2638f1baf8f309c /fpdfsdk/fpdf_formfill.cpp | |
parent | 55bbb0a2e7a95bf2c08cbd1d7f1563aec7e5b97d (diff) | |
download | pdfium-7b094f81483240f50dfc12e51cf545a8f0d5933d.tar.xz |
Revert "Ensure that XFA Pages always have a corresponding PDF page"
This reverts commit e7207f33f8024b59fc85abb1b4594b0fbab5361b.
Reason for revert: Causes crash in some XFA forms - crbug.com/840922
This is a merge, not a clean revert.
Original change's description:
> Ensure that XFA Pages always have a corresponding PDF page
>
> The PDF page may be blank, un-numbered, or untracked by CPDF, but
> this provides a place for all XFA pages to "extend" from down the
> road.
>
> Change-Id: If1003be0f261154e61e9793ccba7e1f43cd73104
> Reviewed-on: https://pdfium-review.googlesource.com/31771
> Commit-Queue: Tom Sepez <tsepez@chromium.org>
> Reviewed-by: dsinclair <dsinclair@chromium.org>
Change-Id: Ia7f286321552b225a95f461aa8a6aef979f5c991
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:840922
Reviewed-on: https://pdfium-review.googlesource.com/32210
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_formfill.cpp')
-rw-r--r-- | fpdfsdk/fpdf_formfill.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/fpdfsdk/fpdf_formfill.cpp b/fpdfsdk/fpdf_formfill.cpp index a3a471c1f8..8a43fa6e77 100644 --- a/fpdfsdk/fpdf_formfill.cpp +++ b/fpdfsdk/fpdf_formfill.cpp @@ -621,11 +621,7 @@ FPDF_EXPORT void FPDF_CALLCONV FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, if (!pDict) return; - CPDF_Dictionary* pActionDict = pDict->GetDictFor("AA"); - if (!pActionDict) - return; - - CPDF_AAction aa(pActionDict); + CPDF_AAction aa(pDict->GetDictFor("AA")); auto type = static_cast<CPDF_AAction::AActionType>(aaType); if (aa.ActionExist(type)) { CPDF_Action action = aa.GetAction(type); @@ -645,22 +641,20 @@ FPDF_EXPORT void FPDF_CALLCONV FORM_DoPageAAction(FPDF_PAGE page, UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page); - if (!pPDFPage || !pFormFillEnv->GetPageView(pPage, false)) - return; - - CPDFSDK_ActionHandler* pActionHandler = pFormFillEnv->GetActionHandler(); - CPDF_Dictionary* pPageDict = pPDFPage->GetFormDict(); - if (!pPageDict) + if (!pPDFPage) return; - CPDF_Dictionary* pActionDict = pPageDict->GetDictFor("AA"); - if (!pActionDict) + if (!pFormFillEnv->GetPageView(pPage, false)) return; - CPDF_AAction aa(pActionDict); + CPDFSDK_ActionHandler* pActionHandler = pFormFillEnv->GetActionHandler(); + CPDF_Dictionary* pPageDict = pPDFPage->GetFormDict(); + CPDF_AAction aa(pPageDict->GetDictFor("AA")); CPDF_AAction::AActionType type = aaType == FPDFPAGE_AACTION_OPEN ? CPDF_AAction::OpenPage : CPDF_AAction::ClosePage; - if (aa.ActionExist(type)) - pActionHandler->DoAction_Page(aa.GetAction(type), type, pFormFillEnv); + if (aa.ActionExist(type)) { + CPDF_Action action = aa.GetAction(type); + pActionHandler->DoAction_Page(action, type, pFormFillEnv); + } } |