diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-10-04 16:51:16 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-05 17:04:50 +0000 |
commit | 645e78a1152b035fb83ac5bbe93715b54f11a1b6 (patch) | |
tree | e3de326e955bf60c94303397c04d46072ff8e43d /core/fpdfapi/parser/cpdf_object.h | |
parent | 5e2cfb5310c9b25a5ce4c772a6656373309bc956 (diff) | |
download | pdfium-645e78a1152b035fb83ac5bbe93715b54f11a1b6.tar.xz |
Remove CPDF_Object friends
This CL removes the friends from CPDF_Object and adds accessors as
needed. The m_GenNum was moved to a private member as none of the
overriding classes needed access.
Change-Id: If23a1a6752dea31eb80669a36694973f3c581123
Reviewed-on: https://pdfium-review.googlesource.com/15470
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_object.h')
-rw-r--r-- | core/fpdfapi/parser/cpdf_object.h | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/core/fpdfapi/parser/cpdf_object.h b/core/fpdfapi/parser/cpdf_object.h index 4d4279f98a..7a14492d70 100644 --- a/core/fpdfapi/parser/cpdf_object.h +++ b/core/fpdfapi/parser/cpdf_object.h @@ -44,7 +44,9 @@ class CPDF_Object { virtual Type GetType() const = 0; uint32_t GetObjNum() const { return m_ObjNum; } + void SetObjNum(uint32_t objnum) { m_ObjNum = objnum; } uint32_t GetGenNum() const { return m_GenNum; } + void SetGenNum(uint32_t gennum) { m_GenNum = gennum; } bool IsInline() const { return m_ObjNum == 0; } // Create a deep copy of the object. @@ -92,18 +94,6 @@ class CPDF_Object { virtual bool WriteTo(IFX_ArchiveStream* archive) const = 0; - protected: - friend class CPDF_Array; - friend class CPDF_Dictionary; - friend class CPDF_IndirectObjectHolder; - friend class CPDF_SyntaxParser; - friend class CPDF_Reference; - friend class CPDF_Stream; - - CPDF_Object() : m_ObjNum(0), m_GenNum(0) {} - - std::unique_ptr<CPDF_Object> CloneObjectNonCyclic(bool bDirect) const; - // Create a deep copy of the object with the option to either // copy a reference object or directly copy the object it refers to // when |bDirect| is true. @@ -114,11 +104,17 @@ class CPDF_Object { bool bDirect, std::set<const CPDF_Object*>* pVisited) const; + protected: + CPDF_Object() : m_ObjNum(0), m_GenNum(0) {} + + std::unique_ptr<CPDF_Object> CloneObjectNonCyclic(bool bDirect) const; + uint32_t m_ObjNum; - uint32_t m_GenNum; private: CPDF_Object(const CPDF_Object& src) {} + + uint32_t m_GenNum; }; template <typename T> |