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

Unified Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp

Issue 1410673005: Add type cast definitions for CPDF_Number. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 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/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
index 29c1a007cfa23b531e9c57ab7768733a9845e228..3d9900deaca1860cc747d7fac3a57238b5c80397 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
@@ -71,18 +71,17 @@ void CPDF_Document::LoadAsynDoc(CPDF_Dictionary* pLinearized) {
}
FX_DWORD dwPageCount = 0;
CPDF_Object* pCount = pLinearized->GetElement(FX_BSTRC("N"));
- if (pCount && pCount->GetType() == PDFOBJ_NUMBER) {
+ if (ToNumber(pCount))
dwPageCount = pCount->GetInteger();
- }
+
m_PageList.SetSize(dwPageCount);
CPDF_Object* pNo = pLinearized->GetElement(FX_BSTRC("P"));
- if (pNo && pNo->GetType() == PDFOBJ_NUMBER) {
+ if (ToNumber(pNo))
m_dwFirstPageNo = pNo->GetInteger();
- }
+
CPDF_Object* pObjNum = pLinearized->GetElement(FX_BSTRC("O"));
- if (pObjNum && pObjNum->GetType() == PDFOBJ_NUMBER) {
+ if (ToNumber(pObjNum))
m_dwFirstPageObjNum = pObjNum->GetInteger();
- }
}
void CPDF_Document::LoadPages() {
m_PageList.SetSize(_GetPageCount());

Powered by Google App Engine
This is Rietveld 408576698