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

Unified Diff: core/src/fpdfdoc/doc_form.cpp

Issue 1540693002: Get rid of a few CPDF_Object Create() methods and just use new instead. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 5 years 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/src/fpdfdoc/doc_basic.cpp ('k') | core/src/fpdfdoc/doc_formfield.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfdoc/doc_form.cpp
diff --git a/core/src/fpdfdoc/doc_form.cpp b/core/src/fpdfdoc/doc_form.cpp
index 20b59cd498086a7628ac0995bc7bbd90571afad3..9f949cc96589b70dc1c3503e96608eb6c8bd0942 100644
--- a/core/src/fpdfdoc/doc_form.cpp
+++ b/core/src/fpdfdoc/doc_form.cpp
@@ -1048,10 +1048,7 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(
pMainDict->SetAt("F", static_cast<CPDF_Object*>(filespec));
}
}
- CPDF_Array* pFields = CPDF_Array::Create();
- if (!pFields) {
- return NULL;
- }
+ CPDF_Array* pFields = new CPDF_Array;
pMainDict->SetAt("Fields", pFields);
int nCount = m_pFieldTree->m_Root.CountFields();
for (int i = 0; i < nCount; i++) {
@@ -1069,16 +1066,8 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(
continue;
CFX_WideString fullname = GetFullName(pField->GetFieldDict());
- CPDF_Dictionary* pFieldDict = CPDF_Dictionary::Create();
- if (!pFieldDict)
- return nullptr;
-
- CPDF_String* pString = CPDF_String::Create(fullname);
- if (!pString) {
- pFieldDict->Release();
- return nullptr;
- }
- pFieldDict->SetAt("T", pString);
+ CPDF_Dictionary* pFieldDict = new CPDF_Dictionary;
+ pFieldDict->SetAt("T", new CPDF_String(fullname));
if (pField->GetType() == CPDF_FormField::CheckBox ||
pField->GetType() == CPDF_FormField::RadioButton) {
CFX_WideString csExport = pField->GetCheckValue(FALSE);
« no previous file with comments | « core/src/fpdfdoc/doc_basic.cpp ('k') | core/src/fpdfdoc/doc_formfield.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698