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/fpdfdoc/fpdf_doc.h" | 7 #include "core/include/fpdfdoc/fpdf_doc.h" |
8 | 8 |
9 const int nMaxRecursion = 32; | 9 const int nMaxRecursion = 32; |
10 int CPDF_Dest::GetPageIndex(CPDF_Document* pDoc) { | 10 int CPDF_Dest::GetPageIndex(CPDF_Document* pDoc) { |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 return FALSE; | 322 return FALSE; |
323 } | 323 } |
324 } | 324 } |
325 } else { | 325 } else { |
326 csFileName = CFX_WideString::FromLocal(m_pObj->GetString()); | 326 csFileName = CFX_WideString::FromLocal(m_pObj->GetString()); |
327 } | 327 } |
328 csFileName = FILESPEC_DecodeFileName(csFileName); | 328 csFileName = FILESPEC_DecodeFileName(csFileName); |
329 return TRUE; | 329 return TRUE; |
330 } | 330 } |
331 CPDF_FileSpec::CPDF_FileSpec() { | 331 CPDF_FileSpec::CPDF_FileSpec() { |
332 m_pObj = CPDF_Dictionary::Create(); | 332 m_pObj = new CPDF_Dictionary; |
333 if (CPDF_Dictionary* pDict = ToDictionary(m_pObj)) { | 333 if (CPDF_Dictionary* pDict = ToDictionary(m_pObj)) { |
334 pDict->SetAtName("Type", "Filespec"); | 334 pDict->SetAtName("Type", "Filespec"); |
335 } | 335 } |
336 } | 336 } |
337 FX_BOOL CPDF_FileSpec::IsURL() const { | 337 FX_BOOL CPDF_FileSpec::IsURL() const { |
338 if (CPDF_Dictionary* pDict = ToDictionary(m_pObj)) { | 338 if (CPDF_Dictionary* pDict = ToDictionary(m_pObj)) { |
339 return pDict->GetString("FS") == "URL"; | 339 return pDict->GetString("FS") == "URL"; |
340 } | 340 } |
341 return FALSE; | 341 return FALSE; |
342 } | 342 } |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 int nPage = FXSYS_atoi(bsLbl); | 524 int nPage = FXSYS_atoi(bsLbl); |
525 if (nPage > 0 && nPage <= nPages) { | 525 if (nPage > 0 && nPage <= nPages) { |
526 return nPage; | 526 return nPage; |
527 } | 527 } |
528 return -1; | 528 return -1; |
529 } | 529 } |
530 int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const { | 530 int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const { |
531 CFX_ByteString bsLabel = PDF_EncodeText(wsLabel.GetPtr()); | 531 CFX_ByteString bsLabel = PDF_EncodeText(wsLabel.GetPtr()); |
532 return GetPageByLabel(bsLabel); | 532 return GetPageByLabel(bsLabel); |
533 } | 533 } |
OLD | NEW |