From 61aad4fbb6fb1081a40b2e144106f57cf443846c Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 10 Nov 2015 10:28:56 -0800 Subject: Merge to XFA: Cleanup CPDF_Stream: - Remove CPDF_Stream::Create() and checks that it might fail. - Remove m_pCryptoHandler that's always a nullptr. - Remove m_FileOffset that's always 0. - Rename file version of InitStream() to InitStreamFromFile(). - Use IsMemoryBased() in more places. TBR=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1415163009 . (cherry picked from commit e6e16954f0cdc324849fca9da883be8f131b3834) Review URL: https://codereview.chromium.org/1418493006 . --- fpdfsdk/src/fpdfsave.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp index a9e285ad84..ee8d02b026 100644 --- a/fpdfsdk/src/fpdfsave.cpp +++ b/fpdfsdk/src/fpdfsave.cpp @@ -181,10 +181,10 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, CPDF_Dictionary* pDataDict = new CPDF_Dictionary; if (iDataSetsIndex != -1) { if (pDataSetsStream) - pDataSetsStream->InitStream(pDsfileWrite, pDataDict); + pDataSetsStream->InitStreamFromFile(pDsfileWrite, pDataDict); } else { CPDF_Stream* pData = new CPDF_Stream(NULL, 0, NULL); - pData->InitStream(pDsfileWrite, pDataDict); + pData->InitStreamFromFile(pDsfileWrite, pDataDict); pPDFDocument->AddIndirectObject(pData); iLast = pArray->GetCount() - 2; pArray->InsertAt(iLast, CPDF_String::Create("datasets")); @@ -208,10 +208,10 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, CPDF_Dictionary* pDataDict = new CPDF_Dictionary; if (iFormIndex != -1) { if (pFormStream) - pFormStream->InitStream(pfileWrite, pDataDict); + pFormStream->InitStreamFromFile(pfileWrite, pDataDict); } else { CPDF_Stream* pData = new CPDF_Stream(NULL, 0, NULL); - pData->InitStream(pfileWrite, pDataDict); + pData->InitStreamFromFile(pfileWrite, pDataDict); pPDFDocument->AddIndirectObject(pData); iLast = pArray->GetCount() - 2; pArray->InsertAt(iLast, CPDF_String::Create("form")); -- cgit v1.2.3