Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Side by Side Diff: core/fpdfdoc/doc_basic.cpp

Issue 1857073002: Make down-conversion explicit from CFX_Widetring to CFX_WideStringC. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: String argument type Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | core/fxcrt/fx_xml_parser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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.raw_str()).AsByteStringC()); 516 return GetPageByLabel(PDF_EncodeText(wsLabel.raw_str()).AsByteStringC());
517 } 517 }
OLDNEW
« no previous file with comments | « no previous file | core/fxcrt/fx_xml_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698