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 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 int aaType) { | 678 int aaType) { |
679 CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle); | 679 CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle); |
680 if (!pSDKDoc) | 680 if (!pSDKDoc) |
681 return; | 681 return; |
682 | 682 |
683 CPDF_Document* pDoc = pSDKDoc->GetPDFDocument(); | 683 CPDF_Document* pDoc = pSDKDoc->GetPDFDocument(); |
684 CPDF_Dictionary* pDic = pDoc->GetRoot(); | 684 CPDF_Dictionary* pDic = pDoc->GetRoot(); |
685 if (!pDic) | 685 if (!pDic) |
686 return; | 686 return; |
687 | 687 |
688 CPDF_AAction aa(pDic->GetDictBy("AA")); | 688 CPDF_AAction aa(pDic->GetDictFor("AA")); |
689 if (aa.ActionExist((CPDF_AAction::AActionType)aaType)) { | 689 if (aa.ActionExist((CPDF_AAction::AActionType)aaType)) { |
690 CPDF_Action action = aa.GetAction((CPDF_AAction::AActionType)aaType); | 690 CPDF_Action action = aa.GetAction((CPDF_AAction::AActionType)aaType); |
691 CPDFSDK_ActionHandler* pActionHandler = | 691 CPDFSDK_ActionHandler* pActionHandler = |
692 HandleToCPDFSDKEnvironment(hHandle)->GetActionHander(); | 692 HandleToCPDFSDKEnvironment(hHandle)->GetActionHander(); |
693 pActionHandler->DoAction_Document(action, (CPDF_AAction::AActionType)aaType, | 693 pActionHandler->DoAction_Document(action, (CPDF_AAction::AActionType)aaType, |
694 pSDKDoc); | 694 pSDKDoc); |
695 } | 695 } |
696 } | 696 } |
697 | 697 |
698 DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, | 698 DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, |
(...skipping 10 matching lines...) Expand all Loading... |
709 CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page); | 709 CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page); |
710 if (!pPDFPage) | 710 if (!pPDFPage) |
711 return; | 711 return; |
712 | 712 |
713 if (!pSDKDoc->GetPageView(pPage, false)) | 713 if (!pSDKDoc->GetPageView(pPage, false)) |
714 return; | 714 return; |
715 | 715 |
716 CPDFSDK_Environment* pEnv = pSDKDoc->GetEnv(); | 716 CPDFSDK_Environment* pEnv = pSDKDoc->GetEnv(); |
717 CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander(); | 717 CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander(); |
718 CPDF_Dictionary* pPageDict = pPDFPage->m_pFormDict; | 718 CPDF_Dictionary* pPageDict = pPDFPage->m_pFormDict; |
719 CPDF_AAction aa(pPageDict->GetDictBy("AA")); | 719 CPDF_AAction aa(pPageDict->GetDictFor("AA")); |
720 if (FPDFPAGE_AACTION_OPEN == aaType) { | 720 if (FPDFPAGE_AACTION_OPEN == aaType) { |
721 if (aa.ActionExist(CPDF_AAction::OpenPage)) { | 721 if (aa.ActionExist(CPDF_AAction::OpenPage)) { |
722 CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage); | 722 CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage); |
723 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); | 723 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); |
724 } | 724 } |
725 } else { | 725 } else { |
726 if (aa.ActionExist(CPDF_AAction::ClosePage)) { | 726 if (aa.ActionExist(CPDF_AAction::ClosePage)) { |
727 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); | 727 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); |
728 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); | 728 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); |
729 } | 729 } |
730 } | 730 } |
731 } | 731 } |
OLD | NEW |