diff options
author | tsepez <tsepez@chromium.org> | 2016-09-19 10:45:09 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-19 10:45:09 -0700 |
commit | e6db16e7e6cdc3dd213c16de0d792b77656ac7a6 (patch) | |
tree | 2097b754b075107b8cd149eb99c62cdd2db06ac8 /fpdfsdk/fpdf_flatten.cpp | |
parent | a5b37f6b916f1a35d3fbb3f0b41e9e4b4d265370 (diff) | |
download | pdfium-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_flatten.cpp')
-rw-r--r-- | fpdfsdk/fpdf_flatten.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp index de6baf1f01..aa21b280ed 100644 --- a/fpdfsdk/fpdf_flatten.cpp +++ b/fpdfsdk/fpdf_flatten.cpp @@ -200,8 +200,7 @@ void SetPageContents(CFX_ByteString key, CFX_ByteString sStream; sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", key.c_str()); - pNewContents->SetData(sStream.raw_str(), sStream.GetLength(), FALSE, - FALSE); + pNewContents->SetData(sStream.raw_str(), sStream.GetLength()); } return; } @@ -219,7 +218,7 @@ void SetPageContents(CFX_ByteString key, CFX_ByteString sBody = CFX_ByteString((const FX_CHAR*)acc.GetData(), acc.GetSize()); sStream = sStream + sBody + "\nQ"; - pContents->SetData(sStream.raw_str(), sStream.GetLength(), FALSE, FALSE); + pContents->SetData(sStream.raw_str(), sStream.GetLength()); pContentsArray->AddReference(pDocument, dwObjNum); break; } @@ -246,7 +245,7 @@ void SetPageContents(CFX_ByteString key, CFX_ByteString sStream; sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", key.c_str()); - pNewContents->SetData(sStream.raw_str(), sStream.GetLength(), FALSE, FALSE); + pNewContents->SetData(sStream.raw_str(), sStream.GetLength()); } } @@ -506,7 +505,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) { sTemp.Format("q %f 0 0 %f %f %f cm /%s Do Q\n", m.a, m.d, m.e, m.f, sFormName.c_str()); sStream += sTemp; - pNewXObject->SetData(sStream.raw_str(), sStream.GetLength(), FALSE, FALSE); + pNewXObject->SetData(sStream.raw_str(), sStream.GetLength()); } pPageDict->RemoveFor("Annots"); |