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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 &z_order); | 75 &z_order); |
76 return z_order; | 76 return z_order; |
77 } | 77 } |
78 | 78 |
79 DLLEXPORT FPDF_FORMHANDLE STDCALL | 79 DLLEXPORT FPDF_FORMHANDLE STDCALL |
80 FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, | 80 FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, |
81 FPDF_FORMFILLINFO* formInfo) { | 81 FPDF_FORMFILLINFO* formInfo) { |
82 if (!formInfo || formInfo->version != 1) | 82 if (!formInfo || formInfo->version != 1) |
83 return nullptr; | 83 return nullptr; |
84 | 84 |
85 CPDF_Document* pDocument = CPDF_Document::FromFPDFDocument(document); | 85 CPDF_Document* pDocument = CPDFDocumentFromFPDFDocument(document); |
86 if (!pDocument) | 86 if (!pDocument) |
87 return nullptr; | 87 return nullptr; |
88 CPDFDoc_Environment* pEnv = new CPDFDoc_Environment(pDocument, formInfo); | 88 CPDFDoc_Environment* pEnv = new CPDFDoc_Environment(pDocument, formInfo); |
89 pEnv->SetSDKDocument(new CPDFSDK_Document(pDocument, pEnv)); | 89 pEnv->SetSDKDocument(new CPDFSDK_Document(pDocument, pEnv)); |
90 return pEnv; | 90 return pEnv; |
91 } | 91 } |
92 | 92 |
93 DLLEXPORT void STDCALL | 93 DLLEXPORT void STDCALL |
94 FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle) { | 94 FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle) { |
95 if (!hHandle) | 95 if (!hHandle) |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 } | 337 } |
338 } else { | 338 } else { |
339 bExistCAAction = aa.ActionExist(CPDF_AAction::ClosePage); | 339 bExistCAAction = aa.ActionExist(CPDF_AAction::ClosePage); |
340 if (bExistCAAction) { | 340 if (bExistCAAction) { |
341 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); | 341 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); |
342 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); | 342 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); |
343 } | 343 } |
344 } | 344 } |
345 } | 345 } |
346 } | 346 } |
OLD | NEW |