summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_page
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_page
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_page')
-rw-r--r--core/fpdfapi/fpdf_page/fpdf_page_parser.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index a13fb5021d..da1355724f 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -271,18 +271,18 @@ int CPDF_StreamContentParser::GetNextParamPos() {
}
void CPDF_StreamContentParser::AddNameParam(const FX_CHAR* name, int len) {
+ CFX_ByteStringC bsName(name, len);
int index = GetNextParamPos();
if (len > 32) {
m_ParamBuf[index].m_Type = ContentParam::OBJECT;
- m_ParamBuf[index].m_pObject =
- new CPDF_Name(PDF_NameDecode(CFX_ByteStringC(name, len)));
+ m_ParamBuf[index].m_pObject = new CPDF_Name(PDF_NameDecode(bsName));
} else {
m_ParamBuf[index].m_Type = ContentParam::NAME;
- if (!FXSYS_memchr(name, '#', len)) {
+ if (bsName.Find('#') == -1) {
FXSYS_memcpy(m_ParamBuf[index].m_Name.m_Buffer, name, len);
m_ParamBuf[index].m_Name.m_Len = len;
} else {
- CFX_ByteString str = PDF_NameDecode(CFX_ByteStringC(name, len));
+ CFX_ByteString str = PDF_NameDecode(bsName);
FXSYS_memcpy(m_ParamBuf[index].m_Name.m_Buffer, str.c_str(),
str.GetLength());
m_ParamBuf[index].m_Name.m_Len = str.GetLength();