summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-10-30 12:13:10 -0700
committerTom Sepez <tsepez@chromium.org>2015-10-30 12:13:10 -0700
commitde4791d291b4252045d7922fb838c64d9b711fdf (patch)
tree2f4926ebac052e428e666952aaaa316c7db6d163 /fpdfsdk
parent83fa467a867c879f75447d99bc99f5f8831026f2 (diff)
downloadpdfium-de4791d291b4252045d7922fb838c64d9b711fdf.tar.xz
XFA: Restore early return if no FPDF_Page in FORM_DoPageAAction()
Present in original XFA code drop. BUG=pdfium:259 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1425223002 .
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/src/fpdfformfill.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp
index a493c7fe21..dc740edfc5 100644
--- a/fpdfsdk/src/fpdfformfill.cpp
+++ b/fpdfsdk/src/fpdfformfill.cpp
@@ -656,24 +656,21 @@ DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page,
return;
CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument();
CPDFXFA_Page* pPage = (CPDFXFA_Page*)page;
- CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE);
- if (pPageView) {
+ CPDF_Page* pPDFPage = pPage->GetPDFPage();
+ if (!pPDFPage)
+ return;
+ if (pSDKDoc->GetPageView(pPage, FALSE)) {
CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv();
CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();
- CPDF_Dictionary* pPageDict = pPage->GetPDFPage()->m_pFormDict;
+ CPDF_Dictionary* pPageDict = pPDFPage->m_pFormDict;
CPDF_AAction aa = pPageDict->GetDict(FX_BSTRC("AA"));
-
- FX_BOOL bExistOAAction = FALSE;
- FX_BOOL bExistCAAction = FALSE;
if (FPDFPAGE_AACTION_OPEN == aaType) {
- bExistOAAction = aa.ActionExist(CPDF_AAction::OpenPage);
- if (bExistOAAction) {
+ if (aa.ActionExist(CPDF_AAction::OpenPage)) {
CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage);
pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
}
} else {
- bExistCAAction = aa.ActionExist(CPDF_AAction::ClosePage);
- if (bExistCAAction) {
+ if (aa.ActionExist(CPDF_AAction::ClosePage)) {
CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
}