| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fxfa/xfa_ffdoc.h" | 7 #include "xfa/fxfa/xfa_ffdoc.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 for (size_t i = 0; i < pXFAArray->GetCount() / 2; i++) { | 319 for (size_t i = 0; i < pXFAArray->GetCount() / 2; i++) { |
| 320 if (CPDF_Stream* pStream = pXFAArray->GetStreamAt(i * 2 + 1)) | 320 if (CPDF_Stream* pStream = pXFAArray->GetStreamAt(i * 2 + 1)) |
| 321 xfaStreams.push_back(pStream); | 321 xfaStreams.push_back(pStream); |
| 322 } | 322 } |
| 323 } else if (pElementXFA->IsStream()) { | 323 } else if (pElementXFA->IsStream()) { |
| 324 xfaStreams.push_back((CPDF_Stream*)pElementXFA); | 324 xfaStreams.push_back((CPDF_Stream*)pElementXFA); |
| 325 } | 325 } |
| 326 if (xfaStreams.empty()) | 326 if (xfaStreams.empty()) |
| 327 return false; | 327 return false; |
| 328 | 328 |
| 329 IFX_SeekableReadStream* pFileRead = new CXFA_FileRead(xfaStreams); | 329 IFX_SeekableReadStream* pFileRead = MakeSeekableReadStream(xfaStreams); |
| 330 m_pPDFDoc = pPDFDoc; | 330 m_pPDFDoc = pPDFDoc; |
| 331 if (m_pStream) { | 331 if (m_pStream) { |
| 332 m_pStream->Release(); | 332 m_pStream->Release(); |
| 333 m_pStream = nullptr; | 333 m_pStream = nullptr; |
| 334 } | 334 } |
| 335 m_pStream = pFileRead; | 335 m_pStream = pFileRead; |
| 336 m_bOwnStream = true; | 336 m_bOwnStream = true; |
| 337 return true; | 337 return true; |
| 338 } | 338 } |
| 339 | 339 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 | 444 |
| 445 return !!pExport->Export( | 445 return !!pExport->Export( |
| 446 pFile, pNode, 0, bsChecksum.GetLength() ? bsChecksum.c_str() : nullptr); | 446 pFile, pNode, 0, bsChecksum.GetLength() ? bsChecksum.c_str() : nullptr); |
| 447 } | 447 } |
| 448 | 448 |
| 449 bool CXFA_FFDoc::ImportData(IFX_SeekableReadStream* pStream, bool bXDP) { | 449 bool CXFA_FFDoc::ImportData(IFX_SeekableReadStream* pStream, bool bXDP) { |
| 450 std::unique_ptr<CXFA_DataImporter> importer( | 450 std::unique_ptr<CXFA_DataImporter> importer( |
| 451 new CXFA_DataImporter(m_pDocumentParser->GetDocument())); | 451 new CXFA_DataImporter(m_pDocumentParser->GetDocument())); |
| 452 return importer->ImportData(pStream); | 452 return importer->ImportData(pStream); |
| 453 } | 453 } |
| OLD | NEW |