diff options
author | Lei Zhang <thestig@chromium.org> | 2015-08-14 21:49:19 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-08-14 21:49:19 -0700 |
commit | 62b2e912dc2a508972fbf01b25f7449c39ff1543 (patch) | |
tree | 47a244dc5891b2a338ca529b796e12994e642cbc /core/src/fpdfdoc/tagged_int.h | |
parent | bdf72c353af5b8a34ef5efdeddfff36d2089a158 (diff) | |
download | pdfium-62b2e912dc2a508972fbf01b25f7449c39ff1543.tar.xz |
Merge to XFA: Use override in more classes in core/
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1292613003 .
(cherry picked from commit c2c3f7b5f0396409451a9d344f35ec1929a76e9f)
Review URL: https://codereview.chromium.org/1296043002 .
Diffstat (limited to 'core/src/fpdfdoc/tagged_int.h')
-rw-r--r-- | core/src/fpdfdoc/tagged_int.h | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/core/src/fpdfdoc/tagged_int.h b/core/src/fpdfdoc/tagged_int.h index 7cf368083c..de6854ea0b 100644 --- a/core/src/fpdfdoc/tagged_int.h +++ b/core/src/fpdfdoc/tagged_int.h @@ -10,14 +10,18 @@ #include "../../include/fpdfdoc/fpdf_tagged.h" class CPDF_StructElementImpl; + class CPDF_StructTreeImpl : public CPDF_StructTree { public: - CPDF_StructTreeImpl(const CPDF_Document* pDoc); - ~CPDF_StructTreeImpl(); - int CountTopElements() const { return m_Kids.GetSize(); } - CPDF_StructElement* GetTopElement(int i) const { + explicit CPDF_StructTreeImpl(const CPDF_Document* pDoc); + ~CPDF_StructTreeImpl() override; + + // CPDF_StructTree + int CountTopElements() const override { return m_Kids.GetSize(); } + CPDF_StructElement* GetTopElement(int i) const override { return (CPDF_StructElement*)m_Kids.GetAt(i); } + void LoadDocTree(); void LoadPageTree(const CPDF_Dictionary* pPageDict); CPDF_StructElementImpl* AddPageNode(CPDF_Dictionary* pElement, @@ -33,46 +37,48 @@ class CPDF_StructTreeImpl : public CPDF_StructTree { CFX_ArrayTemplate<CPDF_StructElementImpl*> m_Kids; friend class CPDF_StructElementImpl; }; + class CPDF_StructElementImpl final : public CPDF_StructElement { public: CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, CPDF_StructElementImpl* pParent, CPDF_Dictionary* pDict); - CPDF_StructTree* GetTree() const { return m_pTree; } - const CFX_ByteString& GetType() const { return m_Type; } - CPDF_StructElement* GetParent() const { return m_pParent; } - CPDF_Dictionary* GetDict() const { return m_pDict; } - int CountKids() const { return m_Kids.GetSize(); } - const CPDF_StructKid& GetKid(int index) const { + + // CPDF_StructTreeImpl + CPDF_StructTree* GetTree() const override { return m_pTree; } + const CFX_ByteString& GetType() const override { return m_Type; } + CPDF_StructElement* GetParent() const override { return m_pParent; } + CPDF_Dictionary* GetDict() const override { return m_pDict; } + int CountKids() const override { return m_Kids.GetSize(); } + const CPDF_StructKid& GetKid(int index) const override { return m_Kids.GetData()[index]; } - CFX_PtrArray* GetObjectArray() { return &m_ObjectArray; } - + CFX_PtrArray* GetObjectArray() override { return &m_ObjectArray; } CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_BOOL bInheritable = FALSE, - FX_FLOAT fLevel = 0.0F); - + FX_FLOAT fLevel = 0.0F) override; CFX_ByteString GetName(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, const CFX_ByteStringC& default_value, FX_BOOL bInheritable = FALSE, - int subindex = -1); + int subindex = -1) override; FX_ARGB GetColor(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_ARGB default_value, FX_BOOL bInheritable = FALSE, - int subindex = -1); + int subindex = -1) override; FX_FLOAT GetNumber(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_FLOAT default_value, FX_BOOL bInheritable = FALSE, - int subindex = -1); + int subindex = -1) override; int GetInteger(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, int default_value, FX_BOOL bInheritable = FALSE, - int subindex = -1); + int subindex = -1) override; + CFX_PtrArray m_ObjectArray; void LoadKids(CPDF_Dictionary* pDict); void LoadKid(FX_DWORD PageObjNum, CPDF_Object* pObj, CPDF_StructKid* pKid); @@ -84,7 +90,7 @@ class CPDF_StructElementImpl final : public CPDF_StructElement { void Release(); protected: - ~CPDF_StructElementImpl(); + ~CPDF_StructElementImpl() override; CPDF_StructTreeImpl* m_pTree; CFX_ByteString m_Type; |