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

Unified Diff: core/fpdfdoc/cpdf_interform.cpp

Issue 2361713002: Remove some objnum locals with AddIndirectObject (Closed)
Patch Set: Same treatment for arrays Created 4 years, 3 months 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_unittest.cpp ('k') | core/fpdfdoc/cpvt_fontmap.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 e06af867bb2efbcb23faeab5d650256605c3775f..924084d4e2b3b5c01ce7f6fb481211291022e0a0 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -59,9 +59,8 @@ void InitDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument) {
if (!pFormDict) {
pFormDict = new CPDF_Dictionary;
- uint32_t dwObjNum = pDocument->AddIndirectObject(pFormDict);
- CPDF_Dictionary* pRoot = pDocument->GetRoot();
- pRoot->SetReferenceFor("AcroForm", pDocument, dwObjNum);
+ pDocument->GetRoot()->SetReferenceFor(
+ "AcroForm", pDocument, pDocument->AddIndirectObject(pFormDict));
}
CFX_ByteString csDA;
@@ -406,7 +405,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,
« no previous file with comments | « core/fpdfdoc/cpdf_formfield_unittest.cpp ('k') | core/fpdfdoc/cpvt_fontmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698