From 3b093630d55ad97807bcc710227b03819944605b Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 18 May 2016 10:16:43 -0700 Subject: Use std::vector in CPDF_StructTreeImpl Allows use of CFX_RetainPtrs in place of explicit refcounting. Review-Url: https://codereview.chromium.org/1985253002 --- core/fpdfdoc/tagged_int.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'core/fpdfdoc/tagged_int.h') diff --git a/core/fpdfdoc/tagged_int.h b/core/fpdfdoc/tagged_int.h index 7b9a32fa84..d508211441 100644 --- a/core/fpdfdoc/tagged_int.h +++ b/core/fpdfdoc/tagged_int.h @@ -8,8 +8,12 @@ #define CORE_FPDFDOC_TAGGED_INT_H_ #include +#include +#include #include "core/fpdfdoc/include/fpdf_tagged.h" +#include "core/fxcrt/include/cfx_retain_ptr.h" +#include "third_party/base/stl_util.h" class CPDF_StructElementImpl; @@ -35,7 +39,8 @@ class CPDF_StructTreeImpl final : public IPDF_StructTree { const CPDF_Dictionary* const m_pTreeRoot; const CPDF_Dictionary* const m_pRoleMap; const CPDF_Dictionary* m_pPage; - CFX_ArrayTemplate m_Kids; + std::vector> m_Kids; + friend class CPDF_StructElementImpl; }; @@ -50,9 +55,9 @@ class CPDF_StructElementImpl final : public IPDF_StructElement { const CFX_ByteString& GetType() const override { return m_Type; } IPDF_StructElement* GetParent() const override { return m_pParent; } CPDF_Dictionary* GetDict() const override { return m_pDict; } - int CountKids() const override { return m_Kids.GetSize(); } + int CountKids() const override { return pdfium::CollectionSize(m_Kids); } const CPDF_StructKid& GetKid(int index) const override { - return m_Kids.GetData()[index]; + return m_Kids[index]; } CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, @@ -96,7 +101,7 @@ class CPDF_StructElementImpl final : public IPDF_StructElement { CPDF_StructElementImpl* const m_pParent; CPDF_Dictionary* const m_pDict; CFX_ByteString m_Type; - CFX_ArrayTemplate m_Kids; + std::vector m_Kids; friend class CPDF_StructTreeImpl; }; -- cgit v1.2.3