From 62110c9ce5e0d74319e25f0f41fd241f4aeeac42 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 12 Apr 2018 13:40:49 +0000 Subject: Cleanup CXFA_FFDoc This CL changes CXFA_FFDoc to no longer use the CXFA_FFApp to create the document, it does it directly. The stream data is not stored in the FFDoc anymore as it is only used once. Change-Id: I8247d2fb0324e554250ff0a03c67f067ef46e437 Reviewed-on: https://pdfium-review.googlesource.com/30270 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- fpdfsdk/fpdfxfa/cpdfxfa_context.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'fpdfsdk/fpdfxfa') diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp index e28561dca1..e1721a3f86 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp @@ -90,14 +90,8 @@ bool CPDFXFA_Context::LoadXFADoc() { if (!pApp) return false; - m_pXFADoc = pApp->CreateDoc(&m_DocEnv, m_pPDFDoc.get()); - if (!m_pXFADoc) { - SetLastError(FPDF_ERR_XFALOAD); - return false; - } - - if (!m_pXFADoc->Load()) { - CloseXFADoc(); + m_pXFADoc = pdfium::MakeUnique(pApp, &m_DocEnv); + if (!m_pXFADoc->OpenDoc(m_pPDFDoc.get())) { SetLastError(FPDF_ERR_XFALOAD); return false; } -- cgit v1.2.3