From 3e3a78b68c31a5e7b27ef9ebd35f287603abe7fa Mon Sep 17 00:00:00 2001 From: Artem Strygin Date: Wed, 13 Sep 2017 21:09:21 +0300 Subject: Improve readability for CPDF_LinearizedHeader. Change-Id: Ic564139cd8b14d2a8a2a5b4a70251b398753e50f Reviewed-on: https://pdfium-review.googlesource.com/13830 Commit-Queue: Art Snake Reviewed-by: dsinclair --- core/fpdfapi/parser/cpdf_data_avail.cpp | 5 +++-- core/fpdfapi/parser/cpdf_linearized_header.cpp | 2 +- core/fpdfapi/parser/cpdf_linearized_header.h | 6 ++++-- 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::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; -- cgit v1.2.3