From 280862f53a182928c5a9702784bb25f60a6eff08 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Fri, 8 Jun 2018 19:18:37 +0000 Subject: Remove CPDF_Creator::InitOldObjNumOffsets(). It does nothing. This method is called, but it returns void and has no side effects: all called methods are const, and no member or static variable is modified. Change-Id: I12084000621728b9994fe7b487852928e7b1180e Reviewed-on: https://pdfium-review.googlesource.com/34690 Reviewed-by: Ryan Harrison Commit-Queue: Henrique Nakashima --- core/fpdfapi/edit/cpdf_creator.cpp | 25 ------------------------- core/fpdfapi/edit/cpdf_creator.h | 1 - 2 files changed, 26 deletions(-) diff --git a/core/fpdfapi/edit/cpdf_creator.cpp b/core/fpdfapi/edit/cpdf_creator.cpp index d386217f23..1935c7362f 100644 --- a/core/fpdfapi/edit/cpdf_creator.cpp +++ b/core/fpdfapi/edit/cpdf_creator.cpp @@ -346,27 +346,6 @@ bool CPDF_Creator::WriteNewObjs() { return true; } -void CPDF_Creator::InitOldObjNumOffsets() { - if (!m_pParser) - return; - - uint32_t dwStart = 0; - uint32_t dwEnd = m_pParser->GetLastObjNum(); - while (dwStart <= dwEnd) { - while (dwStart <= dwEnd && m_pParser->IsObjectFreeOrNull(dwStart)) - dwStart++; - - if (dwStart > dwEnd) - break; - - uint32_t j = dwStart; - while (j <= dwEnd && !m_pParser->IsObjectFreeOrNull(j)) - j++; - - dwStart = j; - } -} - void CPDF_Creator::InitNewObjNumOffsets() { for (const auto& pair : *m_pDocument) { const uint32_t objnum = pair.first; @@ -411,8 +390,6 @@ int32_t CPDF_Creator::WriteDoc_Stage1() { !m_Archive->WriteString("\r\n%\xA1\xB3\xC5\xD7\r\n")) { return -1; } - - InitOldObjNumOffsets(); m_iStage = 20; } else { m_SavedOffset = m_pParser->GetFileAccess()->GetSize(); @@ -438,8 +415,6 @@ int32_t CPDF_Creator::WriteDoc_Stage1() { } } if (IsOriginal() && m_pParser->GetLastXRefOffset() == 0) { - InitOldObjNumOffsets(); - for (uint32_t num = 0; num <= m_pParser->GetLastObjNum(); ++num) { if (m_pParser->IsObjectFreeOrNull(num)) continue; diff --git a/core/fpdfapi/edit/cpdf_creator.h b/core/fpdfapi/edit/cpdf_creator.h index f95cab44eb..2b36fdd136 100644 --- a/core/fpdfapi/edit/cpdf_creator.h +++ b/core/fpdfapi/edit/cpdf_creator.h @@ -61,7 +61,6 @@ class CPDF_Creator { private: void Clear(); - void InitOldObjNumOffsets(); void InitNewObjNumOffsets(); void InitID(); -- cgit v1.2.3