Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2394)

Unified Diff: core/fpdfdoc/cpdf_interform.cpp

Issue 2498223005: Make CPDF_Array take unique_ptrs (Closed)
Patch Set: nits Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfdoc/cpdf_formfield.cpp ('k') | fpdfsdk/cpdfsdk_baannot.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_interform.cpp
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index 64d15a0d8896f2ae6270f49b38bbd7ac229dc6e9..c991598a2228faaf800081cfcb2835153b2bf9a5 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -1237,8 +1237,8 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(
continue;
CFX_WideString fullname = FPDF_GetFullName(pField->GetFieldDict());
- CPDF_Dictionary* pFieldDict =
- new CPDF_Dictionary(pDoc->GetByteStringPool());
+ auto pFieldDict =
+ pdfium::MakeUnique<CPDF_Dictionary>(pDoc->GetByteStringPool());
pFieldDict->SetFor("T", new CPDF_String(fullname));
if (pField->GetType() == CPDF_FormField::CheckBox ||
pField->GetType() == CPDF_FormField::RadioButton) {
@@ -1254,7 +1254,7 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(
if (pV)
pFieldDict->SetFor("V", pV->CloneDirectObject().release());
}
- pFields->Add(pFieldDict);
+ pFields->Add(std::move(pFieldDict));
}
}
return pDoc;
« no previous file with comments | « core/fpdfdoc/cpdf_formfield.cpp ('k') | fpdfsdk/cpdfsdk_baannot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698