diff options
author | dsinclair <dsinclair@chromium.org> | 2016-08-24 10:31:23 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-24 10:31:23 -0700 |
commit | a61c01ea4527dd98699005099e9335a4a842b545 (patch) | |
tree | f1cc29e832c243cc0f867e8ed021a9c0ca6bd873 /core/fpdfapi/fpdf_parser/include | |
parent | 63af2c64b4ea9a0de9a9b4e9916b7f2c925e4b38 (diff) | |
download | pdfium-a61c01ea4527dd98699005099e9335a4a842b545.tar.xz |
Move parser out of IndirectObjectHolder
This Cl moves the parser out of the indirect object holder and into the
CPDF_Document where it is used.
Review-Url: https://codereview.chromium.org/2277433003
Diffstat (limited to 'core/fpdfapi/fpdf_parser/include')
-rw-r--r-- | core/fpdfapi/fpdf_parser/include/cfdf_document.h | 2 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_parser/include/cpdf_document.h | 5 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h | 7 |
3 files changed, 8 insertions, 6 deletions
diff --git a/core/fpdfapi/fpdf_parser/include/cfdf_document.h b/core/fpdfapi/fpdf_parser/include/cfdf_document.h index 18b9442fa9..834aecd1ba 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(); + ~CFDF_Document() override; 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 4a12ea97dc..31988d8c9d 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_document.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_document.h @@ -23,6 +23,7 @@ class CPDF_Font; class CPDF_FontEncoding; class CPDF_IccProfile; class CPDF_Image; +class CPDF_Parser; class CPDF_Pattern; class CPDF_StreamAcc; class JBig2_DocumentContext; @@ -40,7 +41,7 @@ class JBig2_DocumentContext; class CPDF_Document : public CPDF_IndirectObjectHolder { public: explicit CPDF_Document(CPDF_Parser* pParser); - ~CPDF_Document(); + ~CPDF_Document() override; CPDF_Parser* GetParser() const { return m_pParser; } CPDF_Dictionary* GetRoot() const { return m_pRootDict; } @@ -125,7 +126,9 @@ 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 27a9bc39db..57dafb0528 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h @@ -12,15 +12,14 @@ #include "core/fxcrt/include/fx_system.h" class CPDF_Object; -class CPDF_Parser; class CPDF_IndirectObjectHolder { public: using iterator = std::map<uint32_t, CPDF_Object*>::iterator; using const_iterator = std::map<uint32_t, CPDF_Object*>::const_iterator; - explicit CPDF_IndirectObjectHolder(CPDF_Parser* pParser); - ~CPDF_IndirectObjectHolder(); + CPDF_IndirectObjectHolder(); + virtual ~CPDF_IndirectObjectHolder(); CPDF_Object* GetIndirectObject(uint32_t objnum) const; CPDF_Object* GetOrParseIndirectObject(uint32_t objnum); @@ -40,7 +39,7 @@ class CPDF_IndirectObjectHolder { const_iterator end() const { return m_IndirectObjs.end(); } protected: - CPDF_Parser* m_pParser; + virtual CPDF_Object* ParseIndirectObject(uint32_t objnum); private: uint32_t m_LastObjNum; |