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

Unified Diff: core/fpdfdoc/doc_basic.cpp

Issue 1853233002: Make down-conversion explicit from CFX_ByteString to CFX_ByteStringC. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix CPDF_Name::GetConstString() 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfdoc/doc_annot.cpp ('k') | core/fpdfdoc/doc_bookmark.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/doc_basic.cpp
diff --git a/core/fpdfdoc/doc_basic.cpp b/core/fpdfdoc/doc_basic.cpp
index c711709e73aea5f2f32525eec9130deebee63965..0c7f89540550f861c3afec36183ba859c40f3908 100644
--- a/core/fpdfdoc/doc_basic.cpp
+++ b/core/fpdfdoc/doc_basic.cpp
@@ -90,12 +90,13 @@ static CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode,
if (pLimits) {
CFX_ByteString csLeft = pLimits->GetStringAt(0);
CFX_ByteString csRight = pLimits->GetStringAt(1);
- if (csLeft.Compare(csRight) > 0) {
+ if (csLeft.Compare(csRight.AsByteStringC()) > 0) {
CFX_ByteString csTmp = csRight;
csRight = csLeft;
csLeft = csTmp;
}
- if (csName.Compare(csLeft) < 0 || csName.Compare(csRight) > 0) {
+ if (csName.Compare(csLeft.AsByteStringC()) < 0 ||
+ csName.Compare(csRight.AsByteStringC()) > 0) {
return NULL;
}
}
@@ -104,7 +105,7 @@ static CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode,
uint32_t dwCount = pNames->GetCount() / 2;
for (uint32_t i = 0; i < dwCount; i++) {
CFX_ByteString csValue = pNames->GetStringAt(i * 2);
- int32_t iCompare = csValue.Compare(csName);
+ int32_t iCompare = csValue.Compare(csName.AsByteStringC());
if (iCompare <= 0) {
if (ppFind) {
*ppFind = pNames;
@@ -500,7 +501,7 @@ int32_t CPDF_PageLabel::GetPageByLabel(const CFX_ByteStringC& bsLabel) const {
CFX_ByteString bsOrig = bsLabel;
for (int i = 0; i < nPages; i++) {
bsLbl = PDF_EncodeText(GetLabel(i));
- if (!bsLbl.Compare(bsOrig)) {
+ if (!bsLbl.Compare(bsOrig.AsByteStringC())) {
return i;
}
}
@@ -512,6 +513,5 @@ int32_t CPDF_PageLabel::GetPageByLabel(const CFX_ByteStringC& bsLabel) const {
return -1;
}
int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const {
- CFX_ByteString bsLabel = PDF_EncodeText(wsLabel.GetPtr());
- return GetPageByLabel(bsLabel);
+ return GetPageByLabel(PDF_EncodeText(wsLabel.GetPtr()).AsByteStringC());
}
« no previous file with comments | « core/fpdfdoc/doc_annot.cpp ('k') | core/fpdfdoc/doc_bookmark.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698