Index: core/fpdfapi/fpdf_parser/cpdf_document.cpp |
diff --git a/core/fpdfapi/fpdf_parser/cpdf_document.cpp b/core/fpdfapi/fpdf_parser/cpdf_document.cpp |
index 31d44b01fe72c18c4f058787d60177b1f6596314..b11d0c1b791fbc98cb873e613e652d0be0c42e37 100644 |
--- a/core/fpdfapi/fpdf_parser/cpdf_document.cpp |
+++ b/core/fpdfapi/fpdf_parser/cpdf_document.cpp |
@@ -484,20 +484,28 @@ int CountPages(CPDF_Dictionary* pPages, |
} // namespace |
CPDF_Document::CPDF_Document(CPDF_Parser* pParser) |
- : CPDF_IndirectObjectHolder(pParser), |
+ : CPDF_IndirectObjectHolder(), |
+ m_pParser(pParser), |
m_pRootDict(nullptr), |
m_pInfoDict(nullptr), |
m_bLinearized(false), |
m_iFirstPageNo(0), |
m_dwFirstPageObjNum(0), |
m_pDocPage(new CPDF_DocPageData(this)), |
- m_pDocRender(new CPDF_DocRenderData(this)) {} |
+ m_pDocRender(new CPDF_DocRenderData(this)) { |
+ if (pParser) |
+ SetLastObjNum(m_pParser->GetLastObjNum()); |
+} |
CPDF_Document::~CPDF_Document() { |
delete m_pDocPage; |
CPDF_ModuleMgr::Get()->GetPageModule()->ClearStockFont(this); |
} |
+CPDF_Object* CPDF_Document::ParseIndirectObject(uint32_t objnum) { |
+ return m_pParser ? m_pParser->ParseIndirectObject(this, objnum) : nullptr; |
+} |
+ |
void CPDF_Document::LoadDocInternal() { |
SetLastObjNum(m_pParser->GetLastObjNum()); |