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

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

Issue 2250163002: Rename async to linearized when parsing (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: review cleanups 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 | « no previous file | core/fpdfapi/fpdf_parser/cpdf_parser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7f692956756607ce63c3858bc5778b58d9358de2..bf1f93f887c6bf999efcba4926ee667ad659e60f 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_document.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_document.cpp
@@ -496,54 +496,46 @@ CPDF_Document::~CPDF_Document() {
CPDF_ModuleMgr::Get()->GetPageModule()->ClearStockFont(this);
}
-void CPDF_Document::LoadDoc() {
+void CPDF_Document::LoadDocInternal() {
m_LastObjNum = m_pParser->GetLastObjNum();
+
CPDF_Object* pRootObj = GetIndirectObject(m_pParser->GetRootObjNum());
- if (!pRootObj) {
+ if (!pRootObj)
return;
- }
+
m_pRootDict = pRootObj->GetDict();
- if (!m_pRootDict) {
+ if (!m_pRootDict)
return;
- }
+
CPDF_Object* pInfoObj = GetIndirectObject(m_pParser->GetInfoObjNum());
- if (pInfoObj) {
+ if (pInfoObj)
m_pInfoDict = pInfoObj->GetDict();
- }
- CPDF_Array* pIDArray = m_pParser->GetIDArray();
- if (pIDArray) {
+ if (CPDF_Array* pIDArray = m_pParser->GetIDArray()) {
m_ID1 = pIDArray->GetStringAt(0);
m_ID2 = pIDArray->GetStringAt(1);
}
+}
+
+void CPDF_Document::LoadDoc() {
+ LoadDocInternal();
m_PageList.SetSize(RetrievePageCount());
}
-void CPDF_Document::LoadAsynDoc(CPDF_Dictionary* pLinearized) {
+void CPDF_Document::LoadLinearizedDoc(CPDF_Dictionary* pLinearizationParams) {
m_bLinearized = true;
- m_LastObjNum = m_pParser->GetLastObjNum();
- CPDF_Object* pIndirectObj = GetIndirectObject(m_pParser->GetRootObjNum());
- m_pRootDict = pIndirectObj ? pIndirectObj->GetDict() : nullptr;
- if (!m_pRootDict) {
- return;
- }
- pIndirectObj = GetIndirectObject(m_pParser->GetInfoObjNum());
- m_pInfoDict = pIndirectObj ? pIndirectObj->GetDict() : nullptr;
- CPDF_Array* pIDArray = m_pParser->GetIDArray();
- if (pIDArray) {
- m_ID1 = pIDArray->GetStringAt(0);
- m_ID2 = pIDArray->GetStringAt(1);
- }
+ LoadDocInternal();
+
uint32_t dwPageCount = 0;
- CPDF_Object* pCount = pLinearized->GetObjectBy("N");
+ CPDF_Object* pCount = pLinearizationParams->GetObjectBy("N");
if (ToNumber(pCount))
dwPageCount = pCount->GetInteger();
-
m_PageList.SetSize(dwPageCount);
- CPDF_Object* pNo = pLinearized->GetObjectBy("P");
+
+ CPDF_Object* pNo = pLinearizationParams->GetObjectBy("P");
if (ToNumber(pNo))
m_iFirstPageNo = pNo->GetInteger();
- CPDF_Object* pObjNum = pLinearized->GetObjectBy("O");
+ CPDF_Object* pObjNum = pLinearizationParams->GetObjectBy("O");
if (ToNumber(pObjNum))
m_dwFirstPageObjNum = pObjNum->GetInteger();
}
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_parser/cpdf_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698