From bb51c4fb6bc6095984c303c95e5336f83e66bc67 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 14 Oct 2015 16:34:46 -0700 Subject: 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 . --- fpdfsdk/src/fpdfeditimg.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'fpdfsdk/src/fpdfeditimg.cpp') 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; } -- cgit v1.2.3