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

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

Issue 1885973002: Remove implicit cast from CFX_ByteString to (const char*). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Typo 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 | « core/fpdfapi/fpdf_render/fpdf_render_text.cpp ('k') | core/fpdfdoc/doc_form.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/fpdfdoc/include/fpdf_doc.h" 10 #include "core/fpdfdoc/include/fpdf_doc.h"
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 int nPages = m_pDocument->GetPageCount(); 504 int nPages = m_pDocument->GetPageCount();
505 CFX_ByteString bsLbl; 505 CFX_ByteString bsLbl;
506 CFX_ByteString bsOrig = bsLabel; 506 CFX_ByteString bsOrig = bsLabel;
507 for (int i = 0; i < nPages; i++) { 507 for (int i = 0; i < nPages; i++) {
508 bsLbl = PDF_EncodeText(GetLabel(i)); 508 bsLbl = PDF_EncodeText(GetLabel(i));
509 if (!bsLbl.Compare(bsOrig.AsStringC())) { 509 if (!bsLbl.Compare(bsOrig.AsStringC())) {
510 return i; 510 return i;
511 } 511 }
512 } 512 }
513 bsLbl = bsOrig; 513 bsLbl = bsOrig;
514 int nPage = FXSYS_atoi(bsLbl); 514 int nPage = FXSYS_atoi(bsLbl.c_str());
515 if (nPage > 0 && nPage <= nPages) { 515 if (nPage > 0 && nPage <= nPages) {
516 return nPage; 516 return nPage;
517 } 517 }
518 return -1; 518 return -1;
519 } 519 }
520 int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const { 520 int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const {
521 return GetPageByLabel(PDF_EncodeText(wsLabel.c_str()).AsStringC()); 521 return GetPageByLabel(PDF_EncodeText(wsLabel.c_str()).AsStringC());
522 } 522 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_render/fpdf_render_text.cpp ('k') | core/fpdfdoc/doc_form.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698