summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_interform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfdoc/cpdf_interform.cpp')
-rw-r--r--core/fpdfdoc/cpdf_interform.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index 2a02e890c3..64d15a0d88 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -59,9 +59,10 @@ void InitDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument) {
return;
if (!pFormDict) {
- pFormDict = new CPDF_Dictionary(pDocument->GetByteStringPool());
- pDocument->GetRoot()->SetReferenceFor(
- "AcroForm", pDocument, pDocument->AddIndirectObject(pFormDict));
+ pFormDict =
+ pDocument->NewIndirect<CPDF_Dictionary>(pDocument->GetByteStringPool());
+ pDocument->GetRoot()->SetReferenceFor("AcroForm", pDocument,
+ pFormDict->GetObjNum());
}
CFX_ByteString csDA;