summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_parser
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-11 17:35:35 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-11 17:35:35 -0700
commitf7fe678a4ada859a2e4fbbeeb0b1dff5b5887227 (patch)
tree271f61e203bcb7026db6b4936668f51f7f5e0de8 /core/fpdfapi/fpdf_parser
parent94dfd56acc7ceb2acfc2e5c7ae516e34b160ea15 (diff)
downloadpdfium-f7fe678a4ada859a2e4fbbeeb0b1dff5b5887227.tar.xz
Add much-needed Find() method for CFX_*StringC
BUG=pdfium:493 Review-Url: https://codereview.chromium.org/1968233002
Diffstat (limited to 'core/fpdfapi/fpdf_parser')
-rw-r--r--core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp b/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
index 466ccaffa5..03975149b0 100644
--- a/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
+++ b/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
@@ -89,9 +89,9 @@ int32_t GetDirectInteger(CPDF_Dictionary* pDict, const CFX_ByteStringC& key) {
CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& bstr) {
int size = bstr.GetLength();
const FX_CHAR* pSrc = bstr.c_str();
- if (!FXSYS_memchr(pSrc, '#', size)) {
+ if (bstr.Find('#') == -1)
return bstr;
- }
+
CFX_ByteString result;
FX_CHAR* pDestStart = result.GetBuffer(size);
FX_CHAR* pDest = pDestStart;
@@ -109,9 +109,8 @@ CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& bstr) {
}
CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig) {
- if (!FXSYS_memchr(orig.c_str(), '#', orig.GetLength())) {
+ if (orig.Find('#') == -1)
return orig;
- }
return PDF_NameDecode(orig.AsStringC());
}