From e6ccf2578ae04c796a69f3596e4b4730a45da378 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 27 Nov 2017 19:34:46 +0000 Subject: Convert CPDF_StructTree to size_t This CL removes the use of CollectionSize from CPDF_StructTree and uses size_t in the callers. Bug: pdfium:774 Change-Id: I860a51a533642c949c497ca26e74ba064a8aa9ba Reviewed-on: https://pdfium-review.googlesource.com/19530 Commit-Queue: dsinclair Reviewed-by: Ryan Harrison Reviewed-by: Tom Sepez --- core/fpdfdoc/cpdf_structtree.cpp | 9 --------- core/fpdfdoc/cpdf_structtree.h | 4 ++-- 2 files changed, 2 insertions(+), 11 deletions(-) (limited to 'core') diff --git a/core/fpdfdoc/cpdf_structtree.cpp b/core/fpdfdoc/cpdf_structtree.cpp index 0e9b529ca8..48b83f555c 100644 --- a/core/fpdfdoc/cpdf_structtree.cpp +++ b/core/fpdfdoc/cpdf_structtree.cpp @@ -12,7 +12,6 @@ #include "core/fpdfapi/parser/cpdf_reference.h" #include "core/fpdfdoc/cpdf_numbertree.h" #include "core/fpdfdoc/cpdf_structelement.h" -#include "third_party/base/stl_util.h" namespace { @@ -45,14 +44,6 @@ CPDF_StructTree::CPDF_StructTree(const CPDF_Document* pDoc) CPDF_StructTree::~CPDF_StructTree() {} -int CPDF_StructTree::CountTopElements() const { - return pdfium::CollectionSize(m_Kids); -} - -CPDF_StructElement* CPDF_StructTree::GetTopElement(int i) const { - return m_Kids[i].Get(); -} - void CPDF_StructTree::LoadPageTree(const CPDF_Dictionary* pPageDict) { m_pPage = pPageDict; if (!m_pTreeRoot) diff --git a/core/fpdfdoc/cpdf_structtree.h b/core/fpdfdoc/cpdf_structtree.h index 9f1d50e066..99342fb6de 100644 --- a/core/fpdfdoc/cpdf_structtree.h +++ b/core/fpdfdoc/cpdf_structtree.h @@ -27,8 +27,8 @@ class CPDF_StructTree { explicit CPDF_StructTree(const CPDF_Document* pDoc); ~CPDF_StructTree(); - int CountTopElements() const; - CPDF_StructElement* GetTopElement(int i) const; + size_t CountTopElements() const { return m_Kids.size(); } + CPDF_StructElement* GetTopElement(size_t i) const { return m_Kids[i].Get(); } const CPDF_Dictionary* GetRoleMap() const { return m_pRoleMap.Get(); } const CPDF_Dictionary* GetPage() const { return m_pPage.Get(); } const CPDF_Dictionary* GetTreeRoot() const { return m_pTreeRoot.Get(); } -- cgit v1.2.3