| 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/fpdfapi/fpdf_parser/include/cpdf_array.h" | 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
| 8 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 8 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
| 9 #include "core/fpdfdoc/doc_utils.h" | 9 #include "core/fpdfdoc/doc_utils.h" |
| 10 #include "core/include/fpdfdoc/fpdf_doc.h" | 10 #include "core/include/fpdfdoc/fpdf_doc.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 *csFileName = CFX_WideString::FromLocal(pDict->GetStringBy("Unix")); | 328 *csFileName = CFX_WideString::FromLocal(pDict->GetStringBy("Unix")); |
| 329 } else { | 329 } else { |
| 330 return false; | 330 return false; |
| 331 } | 331 } |
| 332 } | 332 } |
| 333 } else if (m_pObj->IsString()) { | 333 } else if (m_pObj->IsString()) { |
| 334 *csFileName = CFX_WideString::FromLocal(m_pObj->GetString()); | 334 *csFileName = CFX_WideString::FromLocal(m_pObj->GetString()); |
| 335 } else { | 335 } else { |
| 336 return false; | 336 return false; |
| 337 } | 337 } |
| 338 *csFileName = DecodeFileName(*csFileName); | 338 *csFileName = DecodeFileName(csFileName->AsWideStringC()); |
| 339 return true; | 339 return true; |
| 340 } | 340 } |
| 341 | 341 |
| 342 CPDF_FileSpec::CPDF_FileSpec() { | 342 CPDF_FileSpec::CPDF_FileSpec() { |
| 343 m_pObj = new CPDF_Dictionary; | 343 m_pObj = new CPDF_Dictionary; |
| 344 m_pObj->AsDictionary()->SetAtName("Type", "Filespec"); | 344 m_pObj->AsDictionary()->SetAtName("Type", "Filespec"); |
| 345 } | 345 } |
| 346 | 346 |
| 347 CFX_WideString CPDF_FileSpec::EncodeFileName(const CFX_WideStringC& filepath) { | 347 CFX_WideString CPDF_FileSpec::EncodeFileName(const CFX_WideStringC& filepath) { |
| 348 if (filepath.GetLength() <= 1) { | 348 if (filepath.GetLength() <= 1) { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 bsLbl = bsOrig; | 508 bsLbl = bsOrig; |
| 509 int nPage = FXSYS_atoi(bsLbl); | 509 int nPage = FXSYS_atoi(bsLbl); |
| 510 if (nPage > 0 && nPage <= nPages) { | 510 if (nPage > 0 && nPage <= nPages) { |
| 511 return nPage; | 511 return nPage; |
| 512 } | 512 } |
| 513 return -1; | 513 return -1; |
| 514 } | 514 } |
| 515 int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const { | 515 int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const { |
| 516 return GetPageByLabel(PDF_EncodeText(wsLabel.GetPtr()).AsByteStringC()); | 516 return GetPageByLabel(PDF_EncodeText(wsLabel.GetPtr()).AsByteStringC()); |
| 517 } | 517 } |
| OLD | NEW |