summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorArtem Strygin <art-snake@yandex-team.ru>2017-09-13 21:09:21 +0300
committerChromium commit bot <commit-bot@chromium.org>2017-10-04 16:20:25 +0000
commit3e3a78b68c31a5e7b27ef9ebd35f287603abe7fa (patch)
tree15f98dce81d63e5274fe43e0c9d7f65503de997e /core
parent55469aed5acffcce3259d37418ba9e8b8e60d801 (diff)
downloadpdfium-3e3a78b68c31a5e7b27ef9ebd35f287603abe7fa.tar.xz
Improve readability for CPDF_LinearizedHeader.
Change-Id: Ic564139cd8b14d2a8a2a5b4a70251b398753e50f Reviewed-on: https://pdfium-review.googlesource.com/13830 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/parser/cpdf_data_avail.cpp5
-rw-r--r--core/fpdfapi/parser/cpdf_linearized_header.cpp2
-rw-r--r--core/fpdfapi/parser/cpdf_linearized_header.h6
3 files changed, 8 insertions, 5 deletions
diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp
index 91fc8c1087..f066117fe9 100644
--- a/core/fpdfapi/parser/cpdf_data_avail.cpp
+++ b/core/fpdfapi/parser/cpdf_data_avail.cpp
@@ -578,7 +578,8 @@ bool CPDF_DataAvail::CheckHeader() {
bool CPDF_DataAvail::CheckFirstPage() {
if (!m_pLinearized->GetFirstPageEndOffset() ||
- !m_pLinearized->GetFileSize() || !m_pLinearized->GetLastXRefOffset()) {
+ !m_pLinearized->GetFileSize() ||
+ !m_pLinearized->GetMainXRefTableFirstEntryOffset()) {
m_docStatus = PDF_DATAAVAIL_ERROR;
return false;
}
@@ -1167,7 +1168,7 @@ CPDF_DataAvail::DocAvailStatus CPDF_DataAvail::CheckLinearizedData() {
if (m_bLinearedDataOK)
return DataAvailable;
ASSERT(m_pLinearized);
- if (!m_pLinearized->GetLastXRefOffset())
+ if (!m_pLinearized->GetMainXRefTableFirstEntryOffset())
return DataError;
if (!m_bMainXRefLoadTried) {
diff --git a/core/fpdfapi/parser/cpdf_linearized_header.cpp b/core/fpdfapi/parser/cpdf_linearized_header.cpp
index 4d0b0e0acc..98cdcc450f 100644
--- a/core/fpdfapi/parser/cpdf_linearized_header.cpp
+++ b/core/fpdfapi/parser/cpdf_linearized_header.cpp
@@ -52,7 +52,7 @@ std::unique_ptr<CPDF_LinearizedHeader> CPDF_LinearizedHeader::CreateForObject(
CPDF_LinearizedHeader::CPDF_LinearizedHeader(const CPDF_Dictionary* pDict) {
m_szFileSize = pDict->GetIntegerFor("L");
m_dwFirstPageNo = pDict->GetIntegerFor("P");
- m_szLastXRefOffset = pDict->GetIntegerFor("T");
+ m_szMainXRefTableFirstEntryOffset = pDict->GetIntegerFor("T");
m_PageCount = pDict->GetIntegerFor("N");
m_szFirstPageEndOffset = pDict->GetIntegerFor("E");
m_FirstPageObjNum = pDict->GetIntegerFor("O");
diff --git a/core/fpdfapi/parser/cpdf_linearized_header.h b/core/fpdfapi/parser/cpdf_linearized_header.h
index 79795b872f..98ae9c650f 100644
--- a/core/fpdfapi/parser/cpdf_linearized_header.h
+++ b/core/fpdfapi/parser/cpdf_linearized_header.h
@@ -25,7 +25,9 @@ class CPDF_LinearizedHeader {
FX_FILESIZE GetFileSize() const { return m_szFileSize; }
uint32_t GetFirstPageNo() const { return m_dwFirstPageNo; }
// Will only return values > 0.
- FX_FILESIZE GetLastXRefOffset() const { return m_szLastXRefOffset; }
+ FX_FILESIZE GetMainXRefTableFirstEntryOffset() const {
+ return m_szMainXRefTableFirstEntryOffset;
+ }
uint32_t GetPageCount() const { return m_PageCount; }
// Will only return values > 0.
FX_FILESIZE GetFirstPageEndOffset() const { return m_szFirstPageEndOffset; }
@@ -43,7 +45,7 @@ class CPDF_LinearizedHeader {
private:
FX_FILESIZE m_szFileSize = 0;
uint32_t m_dwFirstPageNo = 0;
- FX_FILESIZE m_szLastXRefOffset = 0;
+ FX_FILESIZE m_szMainXRefTableFirstEntryOffset = 0;
uint32_t m_PageCount = 0;
FX_FILESIZE m_szFirstPageEndOffset = 0;
uint32_t m_FirstPageObjNum = 0;