diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-04-16 21:48:37 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-16 21:48:37 +0000 |
commit | 6b26e1ae69321717c5ce098a1cd2c9f3e1099344 (patch) | |
tree | 0ede098fdef5fe788457ce2e9f793f745f634072 /core/fpdfapi/page/cpdf_pageobjectholder.cpp | |
parent | 8b0cf76f00c6e89e8bb7bf4bcf2189b27baac31c (diff) | |
download | pdfium-6b26e1ae69321717c5ce098a1cd2c9f3e1099344.tar.xz |
Remove non-const CPDF_PageObjectHolder::GetPageObjectList().
This makes it easier to control modifications to the page object
list.
Bug: pdfium:1051
Change-Id: Ia85c597fa6d39e89041b990b4b6c91e327ef811d
Reviewed-on: https://pdfium-review.googlesource.com/30803
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_pageobjectholder.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_pageobjectholder.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.cpp b/core/fpdfapi/page/cpdf_pageobjectholder.cpp index 67b356fc57..310858f7c8 100644 --- a/core/fpdfapi/page/cpdf_pageobjectholder.cpp +++ b/core/fpdfapi/page/cpdf_pageobjectholder.cpp @@ -119,3 +119,11 @@ bool CPDF_PageObjectHolder::RemovePageObject(CPDF_PageObject* pPageObj) { m_PageObjectList.erase(it); return true; } + +bool CPDF_PageObjectHolder::ErasePageObjectAtIndex(size_t index) { + if (index >= m_PageObjectList.size()) + return false; + + m_PageObjectList.erase(m_PageObjectList.begin() + index); + return true; +} |