summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc/doc_basic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdfdoc/doc_basic.cpp')
-rw-r--r--core/src/fpdfdoc/doc_basic.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/core/src/fpdfdoc/doc_basic.cpp b/core/src/fpdfdoc/doc_basic.cpp
index e3b630862c..bbf51139ad 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",