OLD | NEW |
---|---|
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../public/fpdf_formfill.h" | 7 #include "../../public/fpdf_formfill.h" |
8 #include "../../public/fpdfview.h" | 8 #include "../../public/fpdfview.h" |
9 #include "../../third_party/base/nonstd_unique_ptr.h" | 9 #include "../../third_party/base/nonstd_unique_ptr.h" |
10 #include "../include/fsdk_define.h" | 10 #include "../include/fsdk_define.h" |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
648 pSDKDoc); | 648 pSDKDoc); |
649 } | 649 } |
650 } | 650 } |
651 | 651 |
652 DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, | 652 DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, |
653 FPDF_FORMHANDLE hHandle, | 653 FPDF_FORMHANDLE hHandle, |
654 int aaType) { | 654 int aaType) { |
655 if (!hHandle || !page) | 655 if (!hHandle || !page) |
656 return; | 656 return; |
657 CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument(); | 657 CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument(); |
658 CPDFXFA_Page* pPage = (CPDFXFA_Page*)page; | 658 CPDFXFA_Page* pPage = (CPDFXFA_Page*)page; |
Lei Zhang
2015/10/30 18:50:08
Just do the pPage->GetPDFPage() check here?
Tom Sepez
2015/10/30 18:58:27
Done.
| |
659 CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE); | 659 CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE); |
660 if (pPageView) { | 660 if (pPageView) { |
661 CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv(); | 661 CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv(); |
662 CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander(); | 662 CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander(); |
663 CPDF_Dictionary* pPageDict = pPage->GetPDFPage()->m_pFormDict; | 663 CPDF_Page* pPDFPage = pPage->GetPDFPage(); |
664 if (!pPDFPage) | |
665 return; | |
666 CPDF_Dictionary* pPageDict = pPDFPage->m_pFormDict; | |
664 CPDF_AAction aa = pPageDict->GetDict(FX_BSTRC("AA")); | 667 CPDF_AAction aa = pPageDict->GetDict(FX_BSTRC("AA")); |
665 | |
666 FX_BOOL bExistOAAction = FALSE; | |
Lei Zhang
2015/10/30 18:50:08
Remember to merge this to master.
Tom Sepez
2015/10/30 18:58:42
Acknowledged.
| |
667 FX_BOOL bExistCAAction = FALSE; | |
668 if (FPDFPAGE_AACTION_OPEN == aaType) { | 668 if (FPDFPAGE_AACTION_OPEN == aaType) { |
669 bExistOAAction = aa.ActionExist(CPDF_AAction::OpenPage); | 669 if (aa.ActionExist(CPDF_AAction::OpenPage)) { |
670 if (bExistOAAction) { | |
671 CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage); | 670 CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage); |
672 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); | 671 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); |
673 } | 672 } |
674 } else { | 673 } else { |
675 bExistCAAction = aa.ActionExist(CPDF_AAction::ClosePage); | 674 if (aa.ActionExist(CPDF_AAction::ClosePage)) { |
676 if (bExistCAAction) { | |
677 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); | 675 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); |
678 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); | 676 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); |
679 } | 677 } |
680 } | 678 } |
681 } | 679 } |
682 } | 680 } |
OLD | NEW |