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

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

Issue 1889863002: Make CPDF_Dictionary methods take CFX_ByteString arguments (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: One last caller. 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/fpdfdoc/doc_annot.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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 break; 475 break;
476 } 476 }
477 n--; 477 n--;
478 } 478 }
479 if (pValue) { 479 if (pValue) {
480 pValue = pValue->GetDirect(); 480 pValue = pValue->GetDirect();
481 if (CPDF_Dictionary* pLabel = pValue->AsDictionary()) { 481 if (CPDF_Dictionary* pLabel = pValue->AsDictionary()) {
482 if (pLabel->KeyExist("P")) { 482 if (pLabel->KeyExist("P")) {
483 wsLabel += pLabel->GetUnicodeTextBy("P"); 483 wsLabel += pLabel->GetUnicodeTextBy("P");
484 } 484 }
485 CFX_ByteString bsNumberingStyle = pLabel->GetStringBy("S", NULL); 485 CFX_ByteString bsNumberingStyle = pLabel->GetStringBy("S", nullptr);
486 int nLabelNum = nPage - n + pLabel->GetIntegerBy("St", 1); 486 int nLabelNum = nPage - n + pLabel->GetIntegerBy("St", 1);
487 CFX_WideString wsNumPortion = 487 CFX_WideString wsNumPortion =
488 _GetLabelNumPortion(nLabelNum, bsNumberingStyle); 488 _GetLabelNumPortion(nLabelNum, bsNumberingStyle);
489 wsLabel += wsNumPortion; 489 wsLabel += wsNumPortion;
490 return wsLabel; 490 return wsLabel;
491 } 491 }
492 } 492 }
493 wsLabel.Format(L"%d", nPage + 1); 493 wsLabel.Format(L"%d", nPage + 1);
494 return wsLabel; 494 return wsLabel;
495 } 495 }
(...skipping 17 matching lines...) Expand all
513 bsLbl = bsOrig; 513 bsLbl = bsOrig;
514 int nPage = FXSYS_atoi(bsLbl.c_str()); 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/fpdfdoc/doc_annot.cpp ('k') | core/fpdfdoc/doc_form.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698