From 6e72b2ecdb95f000dede3c80e0c32496c0b27a18 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 26 Apr 2017 15:14:35 -0700 Subject: Remove more |new|s, part 2 Change-Id: I13b43ceafc6a35bcc1e366546a4a408ea01fe4ab Reviewed-on: https://pdfium-review.googlesource.com/4534 Reviewed-by: dsinclair Commit-Queue: Tom Sepez --- core/fpdfdoc/cpdf_interform.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'core/fpdfdoc/cpdf_interform.cpp') diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp index dad25aa037..f498617b27 100644 --- a/core/fpdfdoc/cpdf_interform.cpp +++ b/core/fpdfdoc/cpdf_interform.cpp @@ -23,6 +23,7 @@ #include "core/fxcrt/fx_codepage.h" #include "core/fxge/cfx_substfont.h" #include "core/fxge/fx_font.h" +#include "third_party/base/ptr_util.h" #include "third_party/base/stl_util.h" namespace { @@ -633,7 +634,7 @@ uint8_t CPDF_InterForm::GetNativeCharSet() { CPDF_InterForm::CPDF_InterForm(CPDF_Document* pDocument) : m_pDocument(pDocument), m_pFormDict(nullptr), - m_pFieldTree(new CFieldTree), + m_pFieldTree(pdfium::MakeUnique()), m_pFormNotify(nullptr) { CPDF_Dictionary* pRoot = m_pDocument->GetRoot(); if (!pRoot) @@ -1198,9 +1199,12 @@ std::unique_ptr CPDF_InterForm::ExportToFDF( pMainDict->SetNewFor("UF", PDF_EncodeText(wsFilePath), false); } else { - CPDF_FileSpec filespec(pDoc->GetByteStringPool()); + auto pNewDict = + pdfium::MakeUnique(pDoc->GetByteStringPool()); + pNewDict->SetNewFor("Type", "Filespec"); + CPDF_FileSpec filespec(pNewDict.get()); filespec.SetFileName(pdf_path); - pMainDict->SetFor("F", pdfium::WrapUnique(filespec.GetObj())); + pMainDict->SetFor("F", std::move(pNewDict)); } } -- cgit v1.2.3