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/fpdfeditimg.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/fpdfeditimg.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfeditimg.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fpdfsdk/src/fpdfeditimg.cpp b/fpdfsdk/src/fpdfeditimg.cpp index bb710789cc..ef0576b602 100644 --- a/fpdfsdk/src/fpdfeditimg.cpp +++ b/fpdfsdk/src/fpdfeditimg.cpp @@ -9,10 +9,11 @@ DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document) { - if (!document) - return NULL; + CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(document); + if (!pDoc) + return nullptr; CPDF_ImageObject* pImageObj = new CPDF_ImageObject; - CPDF_Image* pImg = new CPDF_Image((CPDF_Document*)document); + CPDF_Image* pImg = new CPDF_Image(pDoc); pImageObj->m_pImage = pImg; return pImageObj; } |