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

Unified Diff: core/fpdfdoc/cpdf_interform.cpp

Issue 2538533003: Make FDF document creation return unique_ptrs (Closed)
Patch Set: 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
Index: core/fpdfdoc/cpdf_interform.cpp
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index 00365c7224012fb6e1edab28a6d3921f5310beb5..c32398660389af63e526850eacc0c7fc0f798ec2 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -1185,8 +1185,9 @@ CPDF_FormField* CPDF_InterForm::CheckRequiredFields(
return nullptr;
}
-CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path,
- bool bSimpleFileSpec) const {
+std::unique_ptr<CFDF_Document> CPDF_InterForm::ExportToFDF(
+ const CFX_WideStringC& pdf_path,
+ bool bSimpleFileSpec) const {
std::vector<CPDF_FormField*> fields;
size_t nCount = m_pFieldTree->m_Root.CountFields();
for (size_t i = 0; i < nCount; ++i)
@@ -1194,12 +1195,12 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path,
return ExportToFDF(pdf_path, fields, true, bSimpleFileSpec);
}
-CFDF_Document* CPDF_InterForm::ExportToFDF(
+std::unique_ptr<CFDF_Document> CPDF_InterForm::ExportToFDF(
const CFX_WideStringC& pdf_path,
const std::vector<CPDF_FormField*>& fields,
bool bIncludeOrExclude,
bool bSimpleFileSpec) const {
- CFDF_Document* pDoc = CFDF_Document::CreateNewDoc();
+ std::unique_ptr<CFDF_Document> pDoc = CFDF_Document::CreateNewDoc();
if (!pDoc)
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698