From 71c5a4c83ba4a3bdb322a19a24dba1ac57655199 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 30 Oct 2015 13:13:18 -0700 Subject: Merge to master: Restore early return in FORM_DoPageAAction() The early return is present in master, but take the other code cleanup changes from XFA. (cherry picked from commit de4791d291b4252045d7922fb838c64d9b711fdf) Original Review URL: https://codereview.chromium.org/1425223002 . BUG=pdfium:259 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1415743008 . --- fpdfsdk/src/fpdfformfill.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp index 7c2c350501..aa45855967 100644 --- a/fpdfsdk/src/fpdfformfill.cpp +++ b/fpdfsdk/src/fpdfformfill.cpp @@ -328,24 +328,18 @@ DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return; - CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE); - if (pPageView) { + if (pSDKDoc->GetPageView(pPage, FALSE)) { CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv(); CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander(); CPDF_Dictionary* pPageDict = pPage->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); } -- cgit v1.2.3