summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/include/fpdfapi/fpdf_parser.h14
-rw-r--r--core/include/fxcrt/fx_basic.h9
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp3
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp13
4 files changed, 4 insertions, 35 deletions
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h
index a12a867062..f0b50f8638 100644
--- a/core/include/fpdfapi/fpdf_parser.h
+++ b/core/include/fpdfapi/fpdf_parser.h
@@ -207,11 +207,6 @@ class CPDF_Document : public CFX_PrivateData, public CPDF_IndirectObjectHolder {
CPDF_DocRenderData* m_pDocRender;
};
-#define PDFWORD_EOF 0
-#define PDFWORD_NUMBER 1
-#define PDFWORD_TEXT 2
-#define PDFWORD_DELIMITER 3
-#define PDFWORD_NAME 4
class CPDF_SimpleParser {
public:
CPDF_SimpleParser(const uint8_t* pData, FX_DWORD dwSize);
@@ -239,14 +234,13 @@ class CPDF_SimpleParser {
}
private:
- void ParseWord(const uint8_t*& pStart, FX_DWORD& dwSize, int& type);
+ void ParseWord(const uint8_t*& pStart, FX_DWORD& dwSize);
const uint8_t* m_pData;
-
FX_DWORD m_dwSize;
-
FX_DWORD m_dwCurPos;
};
+
class CPDF_SyntaxParser {
public:
CPDF_SyntaxParser();
@@ -335,8 +329,6 @@ class CPDF_SyntaxParser {
FX_FILESIZE m_Pos;
- FX_BOOL m_bFileStream;
-
int m_MetadataObjnum;
IFX_FileRead* m_pFileAccess;
@@ -356,8 +348,6 @@ class CPDF_SyntaxParser {
uint8_t m_WordBuffer[257];
FX_DWORD m_WordSize;
-
- FX_FILESIZE m_dwWordPos;
};
#define PDFPARSE_ERROR_SUCCESS 0
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h
index 3377dec459..d34af8df2b 100644
--- a/core/include/fxcrt/fx_basic.h
+++ b/core/include/fxcrt/fx_basic.h
@@ -1162,15 +1162,6 @@ class CFX_ListArrayTemplate {
typedef CFX_ListArrayTemplate<CFX_SortListArray<sizeof(FX_FILESIZE)>,
FX_FILESIZE> CFX_FileSizeListArray;
-typedef enum {
- Ready,
- ToBeContinued,
- Found,
- NotFound,
- Failed,
- Done
-} FX_ProgressiveStatus;
-#define ProgressiveStatus FX_ProgressiveStatus
#ifdef PDF_ENABLE_XFA
class IFX_Unknown {
public:
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++;