summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfsave.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-09-19 10:45:09 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-19 10:45:09 -0700
commite6db16e7e6cdc3dd213c16de0d792b77656ac7a6 (patch)
tree2097b754b075107b8cd149eb99c62cdd2db06ac8 /fpdfsdk/fpdfsave.cpp
parenta5b37f6b916f1a35d3fbb3f0b41e9e4b4d265370 (diff)
downloadpdfium-e6db16e7e6cdc3dd213c16de0d792b77656ac7a6.tar.xz
Clean up CPDF_Stream.
Replace the CPDF_Stream(nullptr, 0, nullptr) pattern with a default ctor. Remove unused parameters from CPDF_Stream::SetData(). Both are always passed as FALSE. CPDF_Stream declared its own m_GenNum, which shadowed the one in CPDF_Object. It was used only to distinguish file/memory streams, so add a bool explicitly for this purpose. Remove the union, it would be sad if we confused user data with a C++ object with virtual function calls. Use unique_ptrs with appropriate deleters to manage memory. Review-Url: https://codereview.chromium.org/2347993002
Diffstat (limited to 'fpdfsdk/fpdfsave.cpp')
-rw-r--r--fpdfsdk/fpdfsave.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/fpdfsdk/fpdfsave.cpp b/fpdfsdk/fpdfsave.cpp
index 243ba2a817..307163d1af 100644
--- a/fpdfsdk/fpdfsave.cpp
+++ b/fpdfsdk/fpdfsave.cpp
@@ -183,7 +183,7 @@ bool SaveXFADocumentData(CPDFXFA_Document* pDocument,
if (pDataSetsStream)
pDataSetsStream->InitStreamFromFile(pDsfileWrite.get(), pDataDict);
} else {
- CPDF_Stream* pData = new CPDF_Stream(nullptr, 0, nullptr);
+ CPDF_Stream* pData = new CPDF_Stream;
pData->InitStreamFromFile(pDsfileWrite.get(), pDataDict);
pPDFDocument->AddIndirectObject(pData);
iLast = pArray->GetCount() - 2;
@@ -204,7 +204,7 @@ bool SaveXFADocumentData(CPDFXFA_Document* pDocument,
if (pFormStream)
pFormStream->InitStreamFromFile(pfileWrite.get(), pDataDict);
} else {
- CPDF_Stream* pData = new CPDF_Stream(nullptr, 0, nullptr);
+ CPDF_Stream* pData = new CPDF_Stream;
pData->InitStreamFromFile(pfileWrite.get(), pDataDict);
pPDFDocument->AddIndirectObject(pData);
iLast = pArray->GetCount() - 2;