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