diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-04-26 15:14:35 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-27 19:53:13 +0000 |
commit | 6e72b2ecdb95f000dede3c80e0c32496c0b27a18 (patch) | |
tree | 36350bea8b8ee81449693f8667c62fff1cedbcea /core/fpdfdoc/cpdf_interform.cpp | |
parent | 827db14d7f3d0085253b686587717361ffbcad1b (diff) | |
download | pdfium-6e72b2ecdb95f000dede3c80e0c32496c0b27a18.tar.xz |
Remove more |new|s, part 2
Change-Id: I13b43ceafc6a35bcc1e366546a4a408ea01fe4ab
Reviewed-on: https://pdfium-review.googlesource.com/4534
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_interform.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_interform.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
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<CFieldTree>()), m_pFormNotify(nullptr) { CPDF_Dictionary* pRoot = m_pDocument->GetRoot(); if (!pRoot) @@ -1198,9 +1199,12 @@ std::unique_ptr<CFDF_Document> CPDF_InterForm::ExportToFDF( pMainDict->SetNewFor<CPDF_String>("UF", PDF_EncodeText(wsFilePath), false); } else { - CPDF_FileSpec filespec(pDoc->GetByteStringPool()); + auto pNewDict = + pdfium::MakeUnique<CPDF_Dictionary>(pDoc->GetByteStringPool()); + pNewDict->SetNewFor<CPDF_Name>("Type", "Filespec"); + CPDF_FileSpec filespec(pNewDict.get()); filespec.SetFileName(pdf_path); - pMainDict->SetFor("F", pdfium::WrapUnique(filespec.GetObj())); + pMainDict->SetFor("F", std::move(pNewDict)); } } |