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

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

Issue 2474283005: Revert of Unify some code (Closed)
Patch Set: Created 4 years, 1 month 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/parser/cpdf_document.h ('k') | core/fpdfapi/parser/cpdf_document_unittest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/parser/cpdf_document.cpp
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp
index d9ffc0b28a46ee3c51dd641a52922d6056ba1d55..8e181de97cf54a94010c3ff88c9e0b360cf80fa7 100644
--- a/core/fpdfapi/parser/cpdf_document.cpp
+++ b/core/fpdfapi/parser/cpdf_document.cpp
@@ -17,7 +17,6 @@
#include "core/fpdfapi/page/pageint.h"
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
-#include "core/fpdfapi/parser/cpdf_linearized.h"
#include "core/fpdfapi/parser/cpdf_number.h"
#include "core/fpdfapi/parser/cpdf_parser.h"
#include "core/fpdfapi/parser/cpdf_reference.h"
@@ -379,13 +378,23 @@
m_PageList.SetSize(RetrievePageCount());
}
-void CPDF_Document::LoadLinearizedDoc(
- const CPDF_Linearized* pLinearizationParams) {
+void CPDF_Document::LoadLinearizedDoc(CPDF_Dictionary* pLinearizationParams) {
m_bLinearized = true;
LoadDocInternal();
- m_PageList.SetSize(pLinearizationParams->GetPageCount());
- m_iFirstPageNo = pLinearizationParams->GetFirstPageNo();
- m_dwFirstPageObjNum = pLinearizationParams->GetFirstPageObjNum();
+
+ uint32_t dwPageCount = 0;
+ CPDF_Object* pCount = pLinearizationParams->GetObjectFor("N");
+ if (ToNumber(pCount))
+ dwPageCount = pCount->GetInteger();
+ m_PageList.SetSize(dwPageCount);
+
+ CPDF_Object* pNo = pLinearizationParams->GetObjectFor("P");
+ if (ToNumber(pNo))
+ m_iFirstPageNo = pNo->GetInteger();
+
+ CPDF_Object* pObjNum = pLinearizationParams->GetObjectFor("O");
+ if (ToNumber(pObjNum))
+ m_dwFirstPageObjNum = pObjNum->GetInteger();
}
void CPDF_Document::LoadPages() {
« no previous file with comments | « core/fpdfapi/parser/cpdf_document.h ('k') | core/fpdfapi/parser/cpdf_document_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698