diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-10-14 16:34:46 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-10-14 16:34:46 -0700 |
commit | bb51c4fb6bc6095984c303c95e5336f83e66bc67 (patch) | |
tree | aa95c7948b60a9935c0d83e449d2aef5658e1ff2 /fpdfsdk/src/fpdfformfill.cpp | |
parent | eca866c64ec0319d4723798290a3155957fa733e (diff) | |
download | pdfium-bb51c4fb6bc6095984c303c95e5336f83e66bc67.tar.xz |
Introduce CPDF_Document::FromFPDFDocument().
This will be used to abstract one major difference between master
and XFA, namely that the CPDF_Document is not a direct cast in XFA.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1395493007 .
Diffstat (limited to 'fpdfsdk/src/fpdfformfill.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfformfill.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp index 37af1fbf95..fed9a7e97e 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; |