| 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/fpdfdoc/include/fpdf_doc.h" | 10 #include "core/fpdfdoc/include/fpdf_doc.h" |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 return result; | 309 return result; |
| 310 #else | 310 #else |
| 311 return filepath; | 311 return filepath; |
| 312 #endif | 312 #endif |
| 313 } | 313 } |
| 314 | 314 |
| 315 bool CPDF_FileSpec::GetFileName(CFX_WideString* csFileName) const { | 315 bool CPDF_FileSpec::GetFileName(CFX_WideString* csFileName) const { |
| 316 if (CPDF_Dictionary* pDict = m_pObj->AsDictionary()) { | 316 if (CPDF_Dictionary* pDict = m_pObj->AsDictionary()) { |
| 317 *csFileName = pDict->GetUnicodeTextBy("UF"); | 317 *csFileName = pDict->GetUnicodeTextBy("UF"); |
| 318 if (csFileName->IsEmpty()) { | 318 if (csFileName->IsEmpty()) { |
| 319 *csFileName = CFX_WideString::FromLocal(pDict->GetConstStringBy("F")); | 319 *csFileName = |
| 320 CFX_WideString::FromLocal(pDict->GetStringBy("F").AsStringC()); |
| 320 } | 321 } |
| 321 if (pDict->GetStringBy("FS") == "URL") | 322 if (pDict->GetStringBy("FS") == "URL") |
| 322 return true; | 323 return true; |
| 323 if (csFileName->IsEmpty()) { | 324 if (csFileName->IsEmpty()) { |
| 324 if (pDict->KeyExist("DOS")) { | 325 if (pDict->KeyExist("DOS")) { |
| 325 *csFileName = | 326 *csFileName = |
| 326 CFX_WideString::FromLocal(pDict->GetStringBy("DOS").AsStringC()); | 327 CFX_WideString::FromLocal(pDict->GetStringBy("DOS").AsStringC()); |
| 327 } else if (pDict->KeyExist("Mac")) { | 328 } else if (pDict->KeyExist("Mac")) { |
| 328 *csFileName = | 329 *csFileName = |
| 329 CFX_WideString::FromLocal(pDict->GetStringBy("Mac").AsStringC()); | 330 CFX_WideString::FromLocal(pDict->GetStringBy("Mac").AsStringC()); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 bsLbl = bsOrig; | 513 bsLbl = bsOrig; |
| 513 int nPage = FXSYS_atoi(bsLbl); | 514 int nPage = FXSYS_atoi(bsLbl); |
| 514 if (nPage > 0 && nPage <= nPages) { | 515 if (nPage > 0 && nPage <= nPages) { |
| 515 return nPage; | 516 return nPage; |
| 516 } | 517 } |
| 517 return -1; | 518 return -1; |
| 518 } | 519 } |
| 519 int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const { | 520 int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const { |
| 520 return GetPageByLabel(PDF_EncodeText(wsLabel.c_str()).AsStringC()); | 521 return GetPageByLabel(PDF_EncodeText(wsLabel.c_str()).AsStringC()); |
| 521 } | 522 } |
| OLD | NEW |