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 | 10 |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 int aaType) { | 696 int aaType) { |
697 CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle); | 697 CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle); |
698 if (!pSDKDoc) | 698 if (!pSDKDoc) |
699 return; | 699 return; |
700 | 700 |
701 CPDF_Document* pDoc = pSDKDoc->GetPDFDocument(); | 701 CPDF_Document* pDoc = pSDKDoc->GetPDFDocument(); |
702 CPDF_Dictionary* pDic = pDoc->GetRoot(); | 702 CPDF_Dictionary* pDic = pDoc->GetRoot(); |
703 if (!pDic) | 703 if (!pDic) |
704 return; | 704 return; |
705 | 705 |
706 CPDF_AAction aa = pDic->GetDict("AA"); | 706 CPDF_AAction aa = pDic->GetDictBy("AA"); |
707 if (aa.ActionExist((CPDF_AAction::AActionType)aaType)) { | 707 if (aa.ActionExist((CPDF_AAction::AActionType)aaType)) { |
708 CPDF_Action action = aa.GetAction((CPDF_AAction::AActionType)aaType); | 708 CPDF_Action action = aa.GetAction((CPDF_AAction::AActionType)aaType); |
709 CPDFSDK_ActionHandler* pActionHandler = | 709 CPDFSDK_ActionHandler* pActionHandler = |
710 ((CPDFDoc_Environment*)hHandle)->GetActionHander(); | 710 ((CPDFDoc_Environment*)hHandle)->GetActionHander(); |
711 pActionHandler->DoAction_Document(action, (CPDF_AAction::AActionType)aaType, | 711 pActionHandler->DoAction_Document(action, (CPDF_AAction::AActionType)aaType, |
712 pSDKDoc); | 712 pSDKDoc); |
713 } | 713 } |
714 } | 714 } |
715 | 715 |
716 DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, | 716 DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, |
717 FPDF_FORMHANDLE hHandle, | 717 FPDF_FORMHANDLE hHandle, |
718 int aaType) { | 718 int aaType) { |
719 if (!hHandle) | 719 if (!hHandle) |
720 return; | 720 return; |
721 CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument(); | 721 CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument(); |
722 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); | 722 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); |
723 CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page); | 723 CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page); |
724 if (!pPDFPage) | 724 if (!pPDFPage) |
725 return; | 725 return; |
726 if (pSDKDoc->GetPageView(pPage, FALSE)) { | 726 if (pSDKDoc->GetPageView(pPage, FALSE)) { |
727 CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv(); | 727 CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv(); |
728 CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander(); | 728 CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander(); |
729 CPDF_Dictionary* pPageDict = pPDFPage->m_pFormDict; | 729 CPDF_Dictionary* pPageDict = pPDFPage->m_pFormDict; |
730 CPDF_AAction aa = pPageDict->GetDict("AA"); | 730 CPDF_AAction aa = pPageDict->GetDictBy("AA"); |
731 if (FPDFPAGE_AACTION_OPEN == aaType) { | 731 if (FPDFPAGE_AACTION_OPEN == aaType) { |
732 if (aa.ActionExist(CPDF_AAction::OpenPage)) { | 732 if (aa.ActionExist(CPDF_AAction::OpenPage)) { |
733 CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage); | 733 CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage); |
734 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); | 734 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); |
735 } | 735 } |
736 } else { | 736 } else { |
737 if (aa.ActionExist(CPDF_AAction::ClosePage)) { | 737 if (aa.ActionExist(CPDF_AAction::ClosePage)) { |
738 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); | 738 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); |
739 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); | 739 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); |
740 } | 740 } |
741 } | 741 } |
742 } | 742 } |
743 } | 743 } |
OLD | NEW |