14d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann// Copyright 2016 PDFium Authors. All rights reserved. 24d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann// Use of this source code is governed by a BSD-style license that can be 34d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann// found in the LICENSE file. 44d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 54d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 64d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 74d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#include "core/fpdfapi/page/cpdf_pageobjectlist.h" 84d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 94d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#include "core/fpdfapi/page/pageint.h" 104d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann#include "third_party/base/stl_util.h" 114d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann 124d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. MoltmannCPDF_PageObject* CPDF_PageObjectList::GetPageObjectByIndex(int index) { 134d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann if (index < 0 || index >= pdfium::CollectionSize<int>(*this)) 144d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann return nullptr; 154d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann return (*this)[index].get(); 164d3acf4ec42bf6e838f9060103aff98fbf170794Philip P. Moltmann} 17