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

Side by Side Diff: fpdfsdk/src/fpdfformfill.cpp

Issue 1395493007: Introduce CPDF_Document::FromFPDFDocument(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 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 | « fpdfsdk/src/fpdfeditpage.cpp ('k') | fpdfsdk/src/fpdfppo.cpp » ('j') | 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 #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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 CPDF_InterForm interform(pPage->m_pDocument, FALSE); 72 CPDF_InterForm interform(pPage->m_pDocument, FALSE);
73 int z_order = -1; 73 int z_order = -1;
74 (void)interform.GetControlAtPoint(pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y, 74 (void)interform.GetControlAtPoint(pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y,
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 (!document || !formInfo || formInfo->version != 1) 82 if (!formInfo || formInfo->version != 1)
83 return nullptr; 83 return nullptr;
84 84
85 CPDF_Document* pDocument = (CPDF_Document*)document; 85 CPDF_Document* pDocument = CPDF_Document::FromFPDFDocument(document);
86 if (!pDocument)
87 return nullptr;
86 CPDFDoc_Environment* pEnv = new CPDFDoc_Environment(pDocument, formInfo); 88 CPDFDoc_Environment* pEnv = new CPDFDoc_Environment(pDocument, formInfo);
87 pEnv->SetSDKDocument(new CPDFSDK_Document(pDocument, pEnv)); 89 pEnv->SetSDKDocument(new CPDFSDK_Document(pDocument, pEnv));
88 return pEnv; 90 return pEnv;
89 } 91 }
90 92
91 DLLEXPORT void STDCALL 93 DLLEXPORT void STDCALL
92 FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle) { 94 FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle) {
93 if (!hHandle) 95 if (!hHandle)
94 return; 96 return;
95 97
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 } 337 }
336 } else { 338 } else {
337 bExistCAAction = aa.ActionExist(CPDF_AAction::ClosePage); 339 bExistCAAction = aa.ActionExist(CPDF_AAction::ClosePage);
338 if (bExistCAAction) { 340 if (bExistCAAction) {
339 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); 341 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
340 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); 342 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
341 } 343 }
342 } 344 }
343 } 345 }
344 } 346 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdfeditpage.cpp ('k') | fpdfsdk/src/fpdfppo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698