From ab36e73c8c5409fa262d4fa2faffe65c8804a792 Mon Sep 17 00:00:00 2001 From: tsepez Date: Tue, 11 Oct 2016 13:42:12 -0700 Subject: Add CPDF_Object::IsInline() Prevent having to remember what an object number of 0 implies. Review-Url: https://codereview.chromium.org/2412673002 --- core/fpdfapi/parser/cpdf_array.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/fpdfapi/parser/cpdf_array.cpp') diff --git a/core/fpdfapi/parser/cpdf_array.cpp b/core/fpdfapi/parser/cpdf_array.cpp index 0d0c02f28d..1aec3e06f3 100644 --- a/core/fpdfapi/parser/cpdf_array.cpp +++ b/core/fpdfapi/parser/cpdf_array.cpp @@ -161,7 +161,7 @@ void CPDF_Array::ConvertToIndirectObjectAt(size_t i, void CPDF_Array::SetAt(size_t i, CPDF_Object* pObj) { ASSERT(IsArray()); - CHECK(!pObj || pObj->GetObjNum() == 0); + CHECK(!pObj || pObj->IsInline()); if (i >= m_Objects.size()) { ASSERT(false); return; @@ -174,7 +174,7 @@ void CPDF_Array::SetAt(size_t i, CPDF_Object* pObj) { void CPDF_Array::InsertAt(size_t index, CPDF_Object* pObj) { ASSERT(IsArray()); - CHECK(!pObj || pObj->GetObjNum() == 0); + CHECK(!pObj || pObj->IsInline()); if (index >= m_Objects.size()) { // Allocate space first. m_Objects.resize(index + 1, nullptr); @@ -187,7 +187,7 @@ void CPDF_Array::InsertAt(size_t index, CPDF_Object* pObj) { void CPDF_Array::Add(CPDF_Object* pObj) { ASSERT(IsArray()); - CHECK(!pObj || pObj->GetObjNum() == 0); + CHECK(!pObj || pObj->IsInline()); m_Objects.push_back(pObj); } -- cgit v1.2.3