summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_array.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/parser/cpdf_array.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_array.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/core/fpdfapi/parser/cpdf_array.cpp b/core/fpdfapi/parser/cpdf_array.cpp
index 4caad10631..ea4ca7eaeb 100644
--- a/core/fpdfapi/parser/cpdf_array.cpp
+++ b/core/fpdfapi/parser/cpdf_array.cpp
@@ -136,14 +136,20 @@ CPDF_Array* CPDF_Array::GetArrayAt(size_t i) const {
return ToArray(GetDirectObjectAt(i));
}
-void CPDF_Array::RemoveAt(size_t i, size_t nCount) {
- if (i >= m_Objects.size())
- return;
+void CPDF_Array::RemoveAt(size_t i) {
+ if (i < m_Objects.size())
+ m_Objects.erase(m_Objects.begin() + i);
+}
+
+void CPDF_Array::Clear() {
+ m_Objects.clear();
+}
- if (nCount <= 0 || nCount > m_Objects.size() - i)
+void CPDF_Array::Truncate(size_t nNewSize) {
+ if (nNewSize >= m_Objects.size())
return;
- m_Objects.erase(m_Objects.begin() + i, m_Objects.begin() + i + nCount);
+ m_Objects.resize(nNewSize);
}
void CPDF_Array::ConvertToIndirectObjectAt(size_t i,