| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "../../include/fpdfdoc/fpdf_doc.h" | 7 #include "core/include/fpdfdoc/fpdf_doc.h" |
| 8 |
| 8 const int nMaxRecursion = 32; | 9 const int nMaxRecursion = 32; |
| 9 int CPDF_Dest::GetPageIndex(CPDF_Document* pDoc) { | 10 int CPDF_Dest::GetPageIndex(CPDF_Document* pDoc) { |
| 10 CPDF_Array* pArray = ToArray(m_pObj); | 11 CPDF_Array* pArray = ToArray(m_pObj); |
| 11 if (!pArray) | 12 if (!pArray) |
| 12 return 0; | 13 return 0; |
| 13 | 14 |
| 14 CPDF_Object* pPage = pArray->GetElementValue(0); | 15 CPDF_Object* pPage = pArray->GetElementValue(0); |
| 15 if (!pPage) | 16 if (!pPage) |
| 16 return 0; | 17 return 0; |
| 17 if (pPage->IsNumber()) | 18 if (pPage->IsNumber()) |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 int nPage = FXSYS_atoi(bsLbl); | 529 int nPage = FXSYS_atoi(bsLbl); |
| 529 if (nPage > 0 && nPage <= nPages) { | 530 if (nPage > 0 && nPage <= nPages) { |
| 530 return nPage; | 531 return nPage; |
| 531 } | 532 } |
| 532 return -1; | 533 return -1; |
| 533 } | 534 } |
| 534 int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const { | 535 int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const { |
| 535 CFX_ByteString bsLabel = PDF_EncodeText(wsLabel.GetPtr()); | 536 CFX_ByteString bsLabel = PDF_EncodeText(wsLabel.GetPtr()); |
| 536 return GetPageByLabel(bsLabel); | 537 return GetPageByLabel(bsLabel); |
| 537 } | 538 } |
| OLD | NEW |