summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_transformpage.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/fpdf_transformpage.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/fpdf_transformpage.cpp')
-rw-r--r--fpdfsdk/fpdf_transformpage.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp
index 7b2bf73871..204e49b695 100644
--- a/fpdfsdk/fpdf_transformpage.cpp
+++ b/fpdfsdk/fpdf_transformpage.cpp
@@ -127,7 +127,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page,
CPDF_Dictionary* pDic = new CPDF_Dictionary;
CPDF_Stream* pStream = new CPDF_Stream(nullptr, 0, pDic);
- pStream->SetData(textBuf.GetBuffer(), textBuf.GetSize(), FALSE, FALSE);
+ pStream->SetData(textBuf.GetBuffer(), textBuf.GetSize());
CPDF_Document* pDoc = pPage->m_pDocument;
if (!pDoc)
return FALSE;
@@ -135,7 +135,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page,
pDic = new CPDF_Dictionary;
CPDF_Stream* pEndStream = new CPDF_Stream(nullptr, 0, pDic);
- pEndStream->SetData((const uint8_t*)" Q", 2, FALSE, FALSE);
+ pEndStream->SetData((const uint8_t*)" Q", 2);
pDoc->AddIndirectObject(pEndStream);
CPDF_Array* pContentArray = nullptr;
@@ -302,7 +302,7 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,
}
CPDF_Dictionary* pDic = new CPDF_Dictionary;
CPDF_Stream* pStream = new CPDF_Stream(nullptr, 0, pDic);
- pStream->SetData(strClip.GetBuffer(), strClip.GetSize(), FALSE, FALSE);
+ pStream->SetData(strClip.GetBuffer(), strClip.GetSize());
CPDF_Document* pDoc = pPage->m_pDocument;
if (!pDoc)
return;