diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-10-14 17:45:56 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-10-14 17:45:56 -0700 |
commit | c25a4219431c90a95233a08f25eecc921abbf3ed (patch) | |
tree | bd2ad923d527440785c19623fe2d19cc1a70a92d /core/fpdfdoc/cpdf_interform.cpp | |
parent | 62f367348ff8ff1e64c6f52c1ee5f77c3a89edc1 (diff) | |
download | pdfium-c25a4219431c90a95233a08f25eecc921abbf3ed.tar.xz |
Revert "Update CPDF_IndirectObjectHolder APIs for unique objects."
This reverts commit 3ba098595ae56b64eacc0c25ab76b89a4d78d920.
TBR=thestig@chromium.org,weili@chromium.org
Review URL: https://codereview.chromium.org/2424533003 .
Diffstat (limited to 'core/fpdfdoc/cpdf_interform.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_interform.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp index cafc912569..3bef85ef9c 100644 --- a/core/fpdfdoc/cpdf_interform.cpp +++ b/core/fpdfdoc/cpdf_interform.cpp @@ -59,9 +59,9 @@ void InitDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument) { return; if (!pFormDict) { - pFormDict = - pDocument->AddIndirectDictionary(pDocument->GetByteStringPool()); - pDocument->GetRoot()->SetReferenceFor("AcroForm", pDocument, pFormDict); + pFormDict = new CPDF_Dictionary(pDocument->GetByteStringPool()); + pDocument->GetRoot()->SetReferenceFor( + "AcroForm", pDocument, pDocument->AddIndirectObject(pFormDict)); } CFX_ByteString csDA; @@ -274,7 +274,8 @@ void AddFont(CPDF_Dictionary*& pFormDict, csNameTag.Remove(' '); csNameTag = CPDF_InterForm::GenerateNewResourceName(pDR, "Font", 4, csNameTag.c_str()); - pFonts->SetReferenceFor(csNameTag, pDocument, pFont->GetFontDict()); + pFonts->SetReferenceFor(csNameTag, pDocument, + pFont->GetFontDict()->GetObjNum()); } CPDF_Font* AddNativeFont(CPDF_Dictionary*& pFormDict, |