diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-06-08 20:27:14 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-06-08 20:27:14 +0000 |
commit | e88da630ef7d61dfca86f76d088dcb088940e1f8 (patch) | |
tree | c16d38d0bc9e2674eaa7bf56bd0c9be8504a18df /core/fpdfapi/edit | |
parent | 280862f53a182928c5a9702784bb25f60a6eff08 (diff) | |
download | pdfium-e88da630ef7d61dfca86f76d088dcb088940e1f8.tar.xz |
Remove unused methods in CPDF_Creator, mark others as private.
Also remove the member variable m_dwEncryptObjNum which is never read.
Change-Id: Ieb674d6d9783ef298ba3ece1544437b15ad0afe2
Reviewed-on: https://pdfium-review.googlesource.com/34694
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fpdfapi/edit')
-rw-r--r-- | core/fpdfapi/edit/cpdf_creator.cpp | 2 | ||||
-rw-r--r-- | core/fpdfapi/edit/cpdf_creator.h | 27 |
2 files changed, 4 insertions, 25 deletions
diff --git a/core/fpdfapi/edit/cpdf_creator.cpp b/core/fpdfapi/edit/cpdf_creator.cpp index 1935c7362f..5c6da1d4fa 100644 --- a/core/fpdfapi/edit/cpdf_creator.cpp +++ b/core/fpdfapi/edit/cpdf_creator.cpp @@ -146,7 +146,6 @@ CPDF_Creator::CPDF_Creator(CPDF_Document* pDoc, m_pParser(pDoc->GetParser()), m_bSecurityChanged(false), m_pEncryptDict(m_pParser ? m_pParser->GetEncryptDict() : nullptr), - m_dwEncryptObjNum(0), m_pSecurityHandler(m_pParser ? m_pParser->GetSecurityHandler() : nullptr), m_dwLastObjNum(m_pDocument->GetLastObjNum()), m_Archive(pdfium::MakeUnique<CFX_FileBufferArchive>(archive)), @@ -462,7 +461,6 @@ int32_t CPDF_Creator::WriteDoc_Stage2() { return -1; m_ObjectOffsets[m_dwLastObjNum] = saveOffset; - m_dwEncryptObjNum = m_dwLastObjNum; if (IsIncremental()) m_NewObjNumArray.push_back(m_dwLastObjNum); } diff --git a/core/fpdfapi/edit/cpdf_creator.h b/core/fpdfapi/edit/cpdf_creator.h index 2b36fdd136..47f279f653 100644 --- a/core/fpdfapi/edit/cpdf_creator.h +++ b/core/fpdfapi/edit/cpdf_creator.h @@ -35,30 +35,10 @@ class CPDF_Creator { void RemoveSecurity(); bool Create(uint32_t flags); - int32_t Continue(); bool SetFileVersion(int32_t fileVersion); - IFX_ArchiveStream* GetArchive() { return m_Archive.get(); } - - uint32_t GetNextObjectNumber() { return ++m_dwLastObjNum; } - uint32_t GetLastObjectNumber() const { return m_dwLastObjNum; } - CPDF_CryptoHandler* GetCryptoHandler(); - CPDF_Document* GetDocument() const { return m_pDocument.Get(); } - CPDF_Array* GetIDArray() const { return m_pIDArray.get(); } - CPDF_Dictionary* GetEncryptDict() const { return m_pEncryptDict.Get(); } - uint32_t GetEncryptObjectNumber() const { return m_dwEncryptObjNum; } - - uint32_t GetObjectOffset(uint32_t objnum) { return m_ObjectOffsets[objnum]; } - bool HasObjectNumber(uint32_t objnum) { - return m_ObjectOffsets.find(objnum) != m_ObjectOffsets.end(); - } - void SetObjectOffset(uint32_t objnum, FX_FILESIZE offset) { - m_ObjectOffsets[objnum] = offset; - } - bool IsIncremental() const { return !!(m_dwFlags & FPDFCREATE_INCREMENTAL); } - bool IsOriginal() const { return !(m_dwFlags & FPDFCREATE_NO_ORIGINAL); } - private: + int32_t Continue(); void Clear(); void InitNewObjNumOffsets(); @@ -79,13 +59,14 @@ class CPDF_Creator { uint32_t objnum, CPDF_CryptoHandler* pCrypto); - bool IsXRefNeedEnd(); + CPDF_CryptoHandler* GetCryptoHandler(); + bool IsIncremental() const { return !!(m_dwFlags & FPDFCREATE_INCREMENTAL); } + bool IsOriginal() const { return !(m_dwFlags & FPDFCREATE_NO_ORIGINAL); } UnownedPtr<CPDF_Document> const m_pDocument; UnownedPtr<CPDF_Parser> const m_pParser; bool m_bSecurityChanged; UnownedPtr<CPDF_Dictionary> m_pEncryptDict; - uint32_t m_dwEncryptObjNum; fxcrt::MaybeOwned<CPDF_SecurityHandler> m_pSecurityHandler; UnownedPtr<const CPDF_Object> m_pMetadata; uint32_t m_dwLastObjNum; |