summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_flatten.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-21 13:19:10 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-21 13:19:10 -0800
commit9e05ee1e7bfb74d56d69620ad1e72b03e29b9237 (patch)
tree12b47b617d99edc7bd2715292402b74e864e1fa4 /fpdfsdk/fpdf_flatten.cpp
parentaa3922dd713d480229408f3a0813b7dab9e8fd78 (diff)
downloadpdfium-9e05ee1e7bfb74d56d69620ad1e72b03e29b9237.tar.xz
Make CPDF_Stream() take unique_ptr's to its dictionary.
Review-Url: https://codereview.chromium.org/2520493002
Diffstat (limited to 'fpdfsdk/fpdf_flatten.cpp')
-rw-r--r--fpdfsdk/fpdf_flatten.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index ccbb7b8765..e649bacf49 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -178,7 +178,8 @@ CFX_FloatRect CalculateRect(std::vector<CFX_FloatRect>* pRectArray) {
uint32_t NewIndirectContentsStream(const CFX_ByteString& key,
CPDF_Document* pDocument) {
CPDF_Stream* pNewContents = pDocument->NewIndirect<CPDF_Stream>(
- nullptr, 0, new CPDF_Dictionary(pDocument->GetByteStringPool()));
+ nullptr, 0,
+ pdfium::MakeUnique<CPDF_Dictionary>(pDocument->GetByteStringPool()));
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());
@@ -296,7 +297,8 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
pRes = pPageDict->SetNewFor<CPDF_Dictionary>("Resources");
CPDF_Stream* pNewXObject = pDocument->NewIndirect<CPDF_Stream>(
- nullptr, 0, new CPDF_Dictionary(pDocument->GetByteStringPool()));
+ nullptr, 0,
+ pdfium::MakeUnique<CPDF_Dictionary>(pDocument->GetByteStringPool()));
uint32_t dwObjNum = pNewXObject->GetObjNum();
CPDF_Dictionary* pPageXObject = pRes->GetDictFor("XObject");