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

Unified Diff: fpdfsdk/fpdfsave.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 | « fpdfsdk/fpdfppo.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfsave.cpp
diff --git a/fpdfsdk/fpdfsave.cpp b/fpdfsdk/fpdfsave.cpp
index e5938b25425b42c69dcb77ee98c90f1122a31fb7..8293c371dc0bf66b046e4d0da04cff14ea8bceca 100644
--- a/fpdfsdk/fpdfsave.cpp
+++ b/fpdfsdk/fpdfsave.cpp
@@ -185,10 +185,12 @@ bool SaveXFADocumentData(CPDFXFA_Document* pDocument,
} else {
CPDF_Stream* pData = new CPDF_Stream;
pData->InitStreamFromFile(pDsfileWrite.get(), pDataDict);
- uint32_t objnum = pPDFDocument->AddIndirectObject(pData);
iLast = pArray->GetCount() - 2;
pArray->InsertAt(iLast, new CPDF_String("datasets", FALSE));
- pArray->InsertAt(iLast + 1, new CPDF_Reference(pPDFDocument, objnum));
+ pArray->InsertAt(
+ iLast + 1,
+ new CPDF_Reference(pPDFDocument,
+ pPDFDocument->AddIndirectObject(pData)));
}
fileList->push_back(std::move(pDsfileWrite));
}
@@ -206,10 +208,12 @@ bool SaveXFADocumentData(CPDFXFA_Document* pDocument,
} else {
CPDF_Stream* pData = new CPDF_Stream;
pData->InitStreamFromFile(pfileWrite.get(), pDataDict);
- uint32_t objnum = pPDFDocument->AddIndirectObject(pData);
iLast = pArray->GetCount() - 2;
pArray->InsertAt(iLast, new CPDF_String("form", FALSE));
- pArray->InsertAt(iLast + 1, new CPDF_Reference(pPDFDocument, objnum));
+ pArray->InsertAt(
+ iLast + 1,
+ new CPDF_Reference(pPDFDocument,
+ pPDFDocument->AddIndirectObject(pData)));
}
fileList->push_back(std::move(pfileWrite));
}
« no previous file with comments | « fpdfsdk/fpdfppo.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698