From 29fd935aab369d210c2a6cc2682e8aaac56d4d36 Mon Sep 17 00:00:00 2001 From: Artem Strygin Date: Tue, 15 Aug 2017 11:50:42 +0300 Subject: Remove useless code. Change-Id: I2c5ea6a0c4487c0200229f4709214bda1f287de8 Reviewed-on: https://pdfium-review.googlesource.com/10990 Commit-Queue: dsinclair Reviewed-by: dsinclair --- core/fpdfapi/parser/cpdf_data_avail.cpp | 26 -------------------------- core/fpdfapi/parser/cpdf_data_avail.h | 1 - 2 files changed, 27 deletions(-) diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp index ed5b2880b5..8370b8cd5f 100644 --- a/core/fpdfapi/parser/cpdf_data_avail.cpp +++ b/core/fpdfapi/parser/cpdf_data_avail.cpp @@ -127,32 +127,6 @@ void CPDF_DataAvail::SetDocument(CPDF_Document* pDoc) { m_pDocument = pDoc; } -uint32_t CPDF_DataAvail::GetObjectSize(uint32_t objnum, FX_FILESIZE& offset) { - CPDF_Parser* pParser = m_pDocument->GetParser(); - if (!pParser || !pParser->IsValidObjectNumber(objnum)) - return 0; - - if (pParser->GetObjectType(objnum) == CPDF_Parser::ObjectType::kCompressed) - objnum = pParser->GetObjectPositionOrZero(objnum); - - if (pParser->GetObjectType(objnum) != - CPDF_Parser::ObjectType::kNotCompressed && - pParser->GetObjectType(objnum) != CPDF_Parser::ObjectType::kNull) { - return 0; - } - - offset = pParser->GetObjectPositionOrZero(objnum); - if (offset == 0) - return 0; - - auto it = pParser->m_SortedOffset.find(offset); - if (it == pParser->m_SortedOffset.end() || - ++it == pParser->m_SortedOffset.end()) { - return 0; - } - return *it - offset; -} - bool CPDF_DataAvail::AreObjectsAvailable(std::vector& obj_array, bool bParsePage, std::vector& ret_array) { diff --git a/core/fpdfapi/parser/cpdf_data_avail.h b/core/fpdfapi/parser/cpdf_data_avail.h index f15f7c0e1d..30d76f3dab 100644 --- a/core/fpdfapi/parser/cpdf_data_avail.h +++ b/core/fpdfapi/parser/cpdf_data_avail.h @@ -126,7 +126,6 @@ class CPDF_DataAvail final { static const int kMaxPageRecursionDepth = 1024; - uint32_t GetObjectSize(uint32_t objnum, FX_FILESIZE& offset); bool AreObjectsAvailable(std::vector& obj_array, bool bParsePage, std::vector& ret_array); -- cgit v1.2.3