summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-01-25 15:17:46 -0800
committerTom Sepez <tsepez@chromium.org>2016-01-25 15:17:46 -0800
commit53cf01e2b67befbe371a4a56af3cf0d23f854009 (patch)
tree14ea27d84c06072b8190ba05fb40342bc370761a /core/src
parent73463f302da567dcfe94c96a8d7f852f07410414 (diff)
downloadpdfium-53cf01e2b67befbe371a4a56af3cf0d23f854009.tar.xz
Merge to Master: Remove several more unused parser values.
Review URL: https://codereview.chromium.org/1634683003 . (cherry picked from commit e24ea22700c9fc534d40cc510d59c453aa9d0ddb) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1632843004 .
Diffstat (limited to 'core/src')
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp3
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp13
2 files changed, 2 insertions, 14 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
index 6cf8b7841e..9f6665d025 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -1707,8 +1707,6 @@ CPDF_SyntaxParser::CPDF_SyntaxParser() {
m_BufSize = CPDF_ModuleMgr::kFileBufSize;
m_pFileBuf = NULL;
m_MetadataObjnum = 0;
- m_dwWordPos = 0;
- m_bFileStream = FALSE;
}
CPDF_SyntaxParser::~CPDF_SyntaxParser() {
@@ -2001,7 +1999,6 @@ void CPDF_SyntaxParser::ToNextWord() {
while (1) {
while (PDFCharIsWhitespace(ch)) {
- m_dwWordPos = m_Pos;
if (!GetNextChar(ch))
return;
}
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
index 1abf665d65..b3172dd848 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
@@ -70,12 +70,9 @@ CPDF_SimpleParser::CPDF_SimpleParser(const CFX_ByteStringC& str) {
m_dwSize = str.GetLength();
m_dwCurPos = 0;
}
-void CPDF_SimpleParser::ParseWord(const uint8_t*& pStart,
- FX_DWORD& dwSize,
- int& type) {
+void CPDF_SimpleParser::ParseWord(const uint8_t*& pStart, FX_DWORD& dwSize) {
pStart = NULL;
dwSize = 0;
- type = PDFWORD_EOF;
uint8_t ch;
while (1) {
if (m_dwSize <= m_dwCurPos)
@@ -110,12 +107,10 @@ void CPDF_SimpleParser::ParseWord(const uint8_t*& pStart,
if (!PDFCharIsOther(ch) && !PDFCharIsNumeric(ch)) {
m_dwCurPos--;
dwSize = m_dwCurPos - start_pos;
- type = PDFWORD_NAME;
return;
}
}
} else {
- type = PDFWORD_DELIMITER;
dwSize = 1;
if (ch == '<') {
if (m_dwSize <= m_dwCurPos)
@@ -138,11 +133,8 @@ void CPDF_SimpleParser::ParseWord(const uint8_t*& pStart,
return;
}
- type = PDFWORD_NUMBER;
dwSize = 1;
while (1) {
- if (!PDFCharIsNumeric(ch))
- type = PDFWORD_TEXT;
if (m_dwSize <= m_dwCurPos)
return;
ch = m_pData[m_dwCurPos++];
@@ -157,8 +149,7 @@ void CPDF_SimpleParser::ParseWord(const uint8_t*& pStart,
CFX_ByteStringC CPDF_SimpleParser::GetWord() {
const uint8_t* pStart;
FX_DWORD dwSize;
- int type;
- ParseWord(pStart, dwSize, type);
+ ParseWord(pStart, dwSize);
if (dwSize == 1 && pStart[0] == '<') {
while (m_dwCurPos < m_dwSize && m_pData[m_dwCurPos] != '>') {
m_dwCurPos++;