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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/fpdfeditpage.cpp ('k') | fpdfsdk/src/fpdfppo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfformfill.cpp
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp
index 37af1fbf958876b04f06e4053a9c9942a8f691fd..fed9a7e97e5429fd8c8c67ff9be800e850cfb155 100644
--- a/fpdfsdk/src/fpdfformfill.cpp
+++ b/fpdfsdk/src/fpdfformfill.cpp
@@ -79,10 +79,12 @@ DLLEXPORT int STDCALL FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle,
DLLEXPORT FPDF_FORMHANDLE STDCALL
FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document,
FPDF_FORMFILLINFO* formInfo) {
- if (!document || !formInfo || formInfo->version != 1)
+ if (!formInfo || formInfo->version != 1)
return nullptr;
- CPDF_Document* pDocument = (CPDF_Document*)document;
+ CPDF_Document* pDocument = CPDF_Document::FromFPDFDocument(document);
+ if (!pDocument)
+ return nullptr;
CPDFDoc_Environment* pEnv = new CPDFDoc_Environment(pDocument, formInfo);
pEnv->SetSDKDocument(new CPDFSDK_Document(pDocument, pEnv));
return pEnv;
« 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