diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-27 19:08:26 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-27 19:08:26 +0000 |
commit | 81ad373a24575985413c142820be8bf945cad71f (patch) | |
tree | 54d5bc47d423f5805def8c7e831ae056e1ed0c2a /core/fpdfdoc | |
parent | 3071871519db375e22950fad02b87aed43963efc (diff) | |
download | pdfium-81ad373a24575985413c142820be8bf945cad71f.tar.xz |
Convert CPDF_StructElement::CountKids to size_t
This CL changes CountKids to not used CollectionSize and returns size_t
directly. Callers updated as needed.
Bug: pdfium:774
Change-Id: I8862218e62cd13be9473fa8116afd29cd3afde04
Reviewed-on: https://pdfium-review.googlesource.com/19510
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r-- | core/fpdfdoc/cpdf_structelement.cpp | 7 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_structelement.h | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/core/fpdfdoc/cpdf_structelement.cpp b/core/fpdfdoc/cpdf_structelement.cpp index 0b0b542852..13985b8fed 100644 --- a/core/fpdfdoc/cpdf_structelement.cpp +++ b/core/fpdfdoc/cpdf_structelement.cpp @@ -14,7 +14,6 @@ #include "core/fpdfapi/parser/cpdf_reference.h" #include "core/fpdfapi/parser/cpdf_stream.h" #include "core/fpdfdoc/cpdf_structtree.h" -#include "third_party/base/stl_util.h" CPDF_StructKid::CPDF_StructKid() : m_Type(Invalid), @@ -45,11 +44,11 @@ CPDF_StructElement::CPDF_StructElement(CPDF_StructTree* pTree, CPDF_StructElement::~CPDF_StructElement() = default; -int CPDF_StructElement::CountKids() const { - return pdfium::CollectionSize<int>(m_Kids); +size_t CPDF_StructElement::CountKids() const { + return m_Kids.size(); } -CPDF_StructElement* CPDF_StructElement::GetKidIfElement(int index) const { +CPDF_StructElement* CPDF_StructElement::GetKidIfElement(size_t index) const { return m_Kids[index].m_Type == CPDF_StructKid::Element ? m_Kids[index].m_pElement.Get() : nullptr; diff --git a/core/fpdfdoc/cpdf_structelement.h b/core/fpdfdoc/cpdf_structelement.h index 57f8aee2e8..51ee93bd54 100644 --- a/core/fpdfdoc/cpdf_structelement.h +++ b/core/fpdfdoc/cpdf_structelement.h @@ -43,8 +43,8 @@ class CPDF_StructElement : public Retainable { const ByteString& GetTitle() const { return m_Title; } CPDF_Dictionary* GetDict() const { return m_pDict.Get(); } - int CountKids() const; - CPDF_StructElement* GetKidIfElement(int index) const; + size_t CountKids() const; + CPDF_StructElement* GetKidIfElement(size_t index) const; std::vector<CPDF_StructKid>* GetKids() { return &m_Kids; } private: |