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

Unified Diff: core/src/fpdfdoc/doc_basic.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
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp ('k') | core/src/fpdfdoc/doc_formfield.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfdoc/doc_basic.cpp
diff --git a/core/src/fpdfdoc/doc_basic.cpp b/core/src/fpdfdoc/doc_basic.cpp
index e3b630862c4e140e7c71530b9ff8837348715dea..bbf51139adfdb115b9c47d6b4b7c350d673ec6e1 100644
--- a/core/src/fpdfdoc/doc_basic.cpp
+++ b/core/src/fpdfdoc/doc_basic.cpp
@@ -11,15 +11,12 @@ int CPDF_Dest::GetPageIndex(CPDF_Document* pDoc) {
return 0;
}
CPDF_Object* pPage = ((CPDF_Array*)m_pObj)->GetElementValue(0);
- if (pPage == NULL) {
+ if (!pPage)
return 0;
- }
- if (pPage->GetType() == PDFOBJ_NUMBER) {
+ if (pPage->IsNumber())
return pPage->GetInteger();
- }
- if (!pPage->IsDictionary()) {
+ if (!pPage->IsDictionary())
return 0;
- }
return pDoc->GetPageIndex(pPage->GetObjNum());
}
FX_DWORD CPDF_Dest::GetPageObjNum() {
@@ -27,15 +24,12 @@ FX_DWORD CPDF_Dest::GetPageObjNum() {
return 0;
}
CPDF_Object* pPage = ((CPDF_Array*)m_pObj)->GetElementValue(0);
- if (pPage == NULL) {
+ if (!pPage)
return 0;
- }
- if (pPage->GetType() == PDFOBJ_NUMBER) {
+ if (pPage->IsNumber())
return pPage->GetInteger();
- }
- if (pPage->IsDictionary()) {
+ if (pPage->IsDictionary())
return pPage->GetObjNum();
- }
return 0;
}
const FX_CHAR* g_sZoomModes[] = {"XYZ", "Fit", "FitH", "FitV", "FitR",
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp ('k') | core/src/fpdfdoc/doc_formfield.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698