summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_data_avail.cpp
diff options
context:
space:
mode:
authorArtem Strygin <art-snake@yandex-team.ru>2017-11-02 20:57:08 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-02 20:57:08 +0000
commit638c764a3312f8387bdb5b2b2f2fabefbfcbc57f (patch)
tree7908b1e0b5adc3e109e8798cc248ded2b2270232 /core/fpdfapi/parser/cpdf_data_avail.cpp
parenta39b3caf5170778981f50cc1dffea47f28acd50e (diff)
downloadpdfium-638c764a3312f8387bdb5b2b2f2fabefbfcbc57f.tar.xz
Remove useless code.
Change-Id: Id355fd03da476674181bae479ccebe50059dfa4f Reviewed-on: https://pdfium-review.googlesource.com/15511 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_data_avail.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_data_avail.cpp109
1 files changed, 0 insertions, 109 deletions
diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp
index e50a7f6369..4259d731cc 100644
--- a/core/fpdfapi/parser/cpdf_data_avail.cpp
+++ b/core/fpdfapi/parser/cpdf_data_avail.cpp
@@ -82,10 +82,7 @@ CPDF_DataAvail::CPDF_DataAvail(
: m_pFileAvail(pFileAvail) {
ASSERT(pFileRead);
m_pFileRead = pdfium::MakeRetain<CPDF_ReadValidator>(pFileRead, m_pFileAvail);
- m_Pos = 0;
m_dwFileLen = m_pFileRead->GetSize();
- m_bufferOffset = 0;
- m_bufferSize = 0;
m_PagesObjNum = 0;
m_dwInfoObjNum = 0;
m_pDocument = 0;
@@ -96,7 +93,6 @@ CPDF_DataAvail::CPDF_DataAvail(
m_bPagesLoad = false;
m_bPagesTreeLoad = false;
m_bMainXRefLoadedOK = false;
- m_pTrailer = nullptr;
m_pCurrentParser = nullptr;
m_docStatus = PDF_DATAAVAIL_HEADER;
m_bTotalLoadPageTree = false;
@@ -260,8 +256,6 @@ bool CPDF_DataAvail::CheckInfo() {
m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
return true;
}
- if (m_Pos == m_dwFileLen)
- m_docStatus = PDF_DATAAVAIL_ERROR;
return false;
}
m_docStatus = PDF_DATAAVAIL_PAGETREE;
@@ -547,109 +541,6 @@ CPDF_DataAvail::DocAvailStatus CPDF_DataAvail::CheckHeaderAndLinearized() {
return DocAvailStatus::DataAvailable;
}
-bool CPDF_DataAvail::GetNextToken(ByteString* token) {
- uint8_t ch;
- if (!GetNextChar(ch))
- return false;
-
- while (1) {
- while (PDFCharIsWhitespace(ch)) {
- if (!GetNextChar(ch))
- return false;
- }
-
- if (ch != '%')
- break;
-
- while (1) {
- if (!GetNextChar(ch))
- return false;
- if (PDFCharIsLineEnding(ch))
- break;
- }
- }
-
- uint8_t buffer[256];
- uint32_t index = 0;
- if (PDFCharIsDelimiter(ch)) {
- buffer[index++] = ch;
- if (ch == '/') {
- while (1) {
- if (!GetNextChar(ch))
- return false;
-
- if (!PDFCharIsOther(ch) && !PDFCharIsNumeric(ch)) {
- m_Pos--;
- *token = ByteString(buffer, index);
- return true;
- }
- if (index < sizeof(buffer))
- buffer[index++] = ch;
- }
- } else if (ch == '<') {
- if (!GetNextChar(ch))
- return false;
-
- if (ch == '<')
- buffer[index++] = ch;
- else
- m_Pos--;
- } else if (ch == '>') {
- if (!GetNextChar(ch))
- return false;
-
- if (ch == '>')
- buffer[index++] = ch;
- else
- m_Pos--;
- }
- *token = ByteString(buffer, index);
- return true;
- }
-
- while (1) {
- if (index < sizeof(buffer))
- buffer[index++] = ch;
-
- if (!GetNextChar(ch))
- return false;
-
- if (PDFCharIsDelimiter(ch) || PDFCharIsWhitespace(ch)) {
- m_Pos--;
- break;
- }
- }
-
- *token = ByteString(buffer, index);
- return true;
-}
-
-bool CPDF_DataAvail::GetNextChar(uint8_t& ch) {
- FX_FILESIZE pos = m_Pos;
- if (pos >= m_dwFileLen)
- return false;
-
- if (m_bufferOffset >= pos ||
- (FX_FILESIZE)(m_bufferOffset + m_bufferSize) <= pos) {
- FX_FILESIZE read_pos = pos;
- uint32_t read_size = 512;
- if ((FX_FILESIZE)read_size > m_dwFileLen)
- read_size = (uint32_t)m_dwFileLen;
-
- if ((FX_FILESIZE)(read_pos + read_size) > m_dwFileLen)
- read_pos = m_dwFileLen - read_size;
-
- if (!m_pFileRead->ReadBlock(m_bufferData, read_pos, read_size))
- return false;
-
- m_bufferOffset = read_pos;
- m_bufferSize = read_size;
- }
- ch = m_bufferData[pos - m_bufferOffset];
- m_Pos++;
- return true;
-}
-
bool CPDF_DataAvail::CheckPage(uint32_t dwPage) {
while (true) {
switch (m_docStatus) {