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

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

Issue 2277433003: Move parser out of IndirectObjectHolder (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@private_objs
Patch Set: Fix merge 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
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());

Powered by Google App Engine
This is Rietveld 408576698