Merge to master: Restore early return in FORM_DoPageAAction()
authorTom Sepez <tsepez@chromium.org>
Fri, 30 Oct 2015 20:13:18 +0000 (13:13 -0700)
committerTom Sepez <tsepez@chromium.org>
Fri, 30 Oct 2015 20:13:18 +0000 (13:13 -0700)
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

index 7c2c350..aa45855 100644 (file)
@@ -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);
       }