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

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_parser.cpp

Issue 2275593002: IndirectObjectHolder API updates (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Missed one Created 4 years, 4 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/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_reference.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/cpdf_parser.cpp
diff --git a/core/fpdfapi/fpdf_parser/cpdf_parser.cpp b/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
index b2f1a4be3f7c3323d1409d320f69850b20a59063..26adf7bb137eaf350de286d832569f856bd56235 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
@@ -267,7 +267,7 @@ CPDF_Parser::Error CPDF_Parser::SetEncryptHandler() {
if (CPDF_Dictionary* pEncryptDict = pEncryptObj->AsDictionary()) {
SetEncryptDictionary(pEncryptDict);
} else if (CPDF_Reference* pRef = pEncryptObj->AsReference()) {
- pEncryptObj = m_pDocument->GetIndirectObject(pRef->GetRefObjNum());
+ pEncryptObj = m_pDocument->GetOrParseIndirectObject(pRef->GetRefObjNum());
if (pEncryptObj)
SetEncryptDictionary(pEncryptObj->GetDict());
}
@@ -986,8 +986,10 @@ FX_BOOL CPDF_Parser::LoadCrossRefV5(FX_FILESIZE* pos, FX_BOOL bMainXRef) {
pObject->Release();
return FALSE;
}
- if (!m_pDocument->InsertIndirectObject(pObject->m_ObjNum, pObject))
+ if (!m_pDocument->ReplaceIndirectObjectIfHigherGeneration(pObject->m_ObjNum,
+ pObject)) {
return FALSE;
+ }
}
CPDF_Stream* pStream = pObject->AsStream();
@@ -1230,7 +1232,8 @@ CPDF_StreamAcc* CPDF_Parser::GetObjectStream(uint32_t objnum) {
if (!m_pDocument)
return nullptr;
- const CPDF_Stream* pStream = ToStream(m_pDocument->GetIndirectObject(objnum));
+ const CPDF_Stream* pStream =
+ ToStream(m_pDocument->GetOrParseIndirectObject(objnum));
if (!pStream)
return nullptr;
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_reference.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698