diff options
Diffstat (limited to 'core/fpdfapi/fpdf_parser/include')
4 files changed, 12 insertions, 23 deletions
diff --git a/core/fpdfapi/fpdf_parser/include/cfdf_document.h b/core/fpdfapi/fpdf_parser/include/cfdf_document.h index 834aecd1ba..18b9442fa9 100644 --- a/core/fpdfapi/fpdf_parser/include/cfdf_document.h +++ b/core/fpdfapi/fpdf_parser/include/cfdf_document.h @@ -19,7 +19,7 @@ class CFDF_Document : public CPDF_IndirectObjectHolder { static CFDF_Document* ParseFile(IFX_FileRead* pFile, FX_BOOL bOwnFile = FALSE); static CFDF_Document* ParseMemory(const uint8_t* pData, uint32_t size); - ~CFDF_Document() override; + ~CFDF_Document(); FX_BOOL WriteBuf(CFX_ByteTextBuf& buf) const; CPDF_Dictionary* GetRoot() const { return m_pRootDict; } diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_document.h b/core/fpdfapi/fpdf_parser/include/cpdf_document.h index adb8587f4f..4a12ea97dc 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_document.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_document.h @@ -40,7 +40,7 @@ class JBig2_DocumentContext; class CPDF_Document : public CPDF_IndirectObjectHolder { public: explicit CPDF_Document(CPDF_Parser* pParser); - ~CPDF_Document() override; + ~CPDF_Document(); CPDF_Parser* GetParser() const { return m_pParser; } CPDF_Dictionary* GetRoot() const { return m_pRootDict; } @@ -125,9 +125,7 @@ class CPDF_Document : public CPDF_IndirectObjectHolder { int& index, int level = 0); FX_BOOL CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting); - CPDF_Object* ParseIndirectObject(uint32_t objnum) override; - CPDF_Parser* m_pParser; CPDF_Dictionary* m_pRootDict; CPDF_Dictionary* m_pInfoDict; CFX_ByteString m_ID1; diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h b/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h index 63fadf19d6..c29746fdd7 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h @@ -19,32 +19,24 @@ class CPDF_IndirectObjectHolder { using iterator = std::map<uint32_t, CPDF_Object*>::iterator; using const_iterator = std::map<uint32_t, CPDF_Object*>::const_iterator; - CPDF_IndirectObjectHolder(); - virtual ~CPDF_IndirectObjectHolder(); - - CPDF_Object* GetIndirectObject(uint32_t objnum) const; - CPDF_Object* GetOrParseIndirectObject(uint32_t objnum); + explicit CPDF_IndirectObjectHolder(CPDF_Parser* pParser); + ~CPDF_IndirectObjectHolder(); + CPDF_Object* GetIndirectObject(uint32_t objnum); + uint32_t AddIndirectObject(CPDF_Object* pObj); void ReleaseIndirectObject(uint32_t objnum); - // The following take ownership of |pObj|. - uint32_t AddIndirectObject(CPDF_Object* pObj); - void ReplaceIndirectObject(CPDF_Object* pObj); - bool ReplaceIndirectObjectIfHigherGeneration(uint32_t objnum, - CPDF_Object* pObj); + // Takes ownership of |pObj|. + bool InsertIndirectObject(uint32_t objnum, CPDF_Object* pObj); uint32_t GetLastObjNum() const { return m_LastObjNum; } - void SetLastObjNum(uint32_t objnum) { m_LastObjNum = objnum; } - iterator begin() { return m_IndirectObjs.begin(); } const_iterator begin() const { return m_IndirectObjs.begin(); } iterator end() { return m_IndirectObjs.end(); } const_iterator end() const { return m_IndirectObjs.end(); } protected: - virtual CPDF_Object* ParseIndirectObject(uint32_t objnum); - - private: + CPDF_Parser* m_pParser; uint32_t m_LastObjNum; std::map<uint32_t, CPDF_Object*> m_IndirectObjs; }; diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_object.h b/core/fpdfapi/fpdf_parser/include/cpdf_object.h index 86f3879ce1..f637e36667 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_object.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_object.h @@ -79,10 +79,6 @@ class CPDF_Object { virtual const CPDF_String* AsString() const; protected: - friend class CPDF_Document; - friend class CPDF_IndirectObjectHolder; - friend class CPDF_Parser; - CPDF_Object() : m_ObjNum(0), m_GenNum(0) {} virtual ~CPDF_Object(); void Destroy() { delete this; } @@ -90,6 +86,9 @@ class CPDF_Object { uint32_t m_ObjNum; uint32_t m_GenNum; + friend class CPDF_IndirectObjectHolder; + friend class CPDF_Parser; + private: CPDF_Object(const CPDF_Object& src) {} }; |