Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(932)

Side by Side Diff: fpdfsdk/fpdfformfill.cpp

Issue 2230983003: Use CPDFSDK_Document::FromFPDFFormHandle in ::FORM_DoPageAAction (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Use CPDFSDK_Document::FromFPDFFormHandle in ::FORM_DoPageAAction Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 pActionHandler->DoAction_Document(action, (CPDF_AAction::AActionType)aaType, 697 pActionHandler->DoAction_Document(action, (CPDF_AAction::AActionType)aaType,
698 pSDKDoc); 698 pSDKDoc);
699 } 699 }
700 } 700 }
701 701
702 DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, 702 DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page,
703 FPDF_FORMHANDLE hHandle, 703 FPDF_FORMHANDLE hHandle,
704 int aaType) { 704 int aaType) {
705 if (!hHandle) 705 if (!hHandle)
706 return; 706 return;
707 CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument(); 707
708 CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle);
709 if (!pSDKDoc)
710 return;
711
708 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); 712 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page);
709 CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page); 713 CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page);
710 if (!pPDFPage) 714 if (!pPDFPage)
711 return; 715 return;
712 if (pSDKDoc->GetPageView(pPage, false)) { 716
713 CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv(); 717 if (!pSDKDoc->GetPageView(pPage, false))
714 CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander(); 718 return;
715 CPDF_Dictionary* pPageDict = pPDFPage->m_pFormDict; 719
716 CPDF_AAction aa(pPageDict->GetDictBy("AA")); 720 CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv();
717 if (FPDFPAGE_AACTION_OPEN == aaType) { 721 CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();
718 if (aa.ActionExist(CPDF_AAction::OpenPage)) { 722 CPDF_Dictionary* pPageDict = pPDFPage->m_pFormDict;
719 CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage); 723 CPDF_AAction aa(pPageDict->GetDictBy("AA"));
720 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); 724 if (FPDFPAGE_AACTION_OPEN == aaType) {
721 } 725 if (aa.ActionExist(CPDF_AAction::OpenPage)) {
722 } else { 726 CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage);
723 if (aa.ActionExist(CPDF_AAction::ClosePage)) { 727 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
724 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); 728 }
725 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); 729 } else {
726 } 730 if (aa.ActionExist(CPDF_AAction::ClosePage)) {
731 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
732 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
727 } 733 }
728 } 734 }
729 } 735 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698