| 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 "core/include/fpdfapi/cpdf_document.h" | 7 #include "core/include/fpdfapi/cpdf_document.h" |
| 8 #include "core/include/fpdfdoc/fpdf_doc.h" | 8 #include "core/include/fpdfdoc/fpdf_doc.h" |
| 9 #include "core/src/fpdfdoc/doc_utils.h" |
| 9 | 10 |
| 10 const int nMaxRecursion = 32; | 11 const int nMaxRecursion = 32; |
| 11 int CPDF_Dest::GetPageIndex(CPDF_Document* pDoc) { | 12 int CPDF_Dest::GetPageIndex(CPDF_Document* pDoc) { |
| 12 CPDF_Array* pArray = ToArray(m_pObj); | 13 CPDF_Array* pArray = ToArray(m_pObj); |
| 13 if (!pArray) | 14 if (!pArray) |
| 14 return 0; | 15 return 0; |
| 15 | 16 |
| 16 CPDF_Object* pPage = pArray->GetElementValue(0); | 17 CPDF_Object* pPage = pArray->GetElementValue(0); |
| 17 if (!pPage) | 18 if (!pPage) |
| 18 return 0; | 19 return 0; |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 int nPage = FXSYS_atoi(bsLbl); | 500 int nPage = FXSYS_atoi(bsLbl); |
| 500 if (nPage > 0 && nPage <= nPages) { | 501 if (nPage > 0 && nPage <= nPages) { |
| 501 return nPage; | 502 return nPage; |
| 502 } | 503 } |
| 503 return -1; | 504 return -1; |
| 504 } | 505 } |
| 505 int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const { | 506 int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const { |
| 506 CFX_ByteString bsLabel = PDF_EncodeText(wsLabel.GetPtr()); | 507 CFX_ByteString bsLabel = PDF_EncodeText(wsLabel.GetPtr()); |
| 507 return GetPageByLabel(bsLabel); | 508 return GetPageByLabel(bsLabel); |
| 508 } | 509 } |
| OLD | NEW |