diff options
author | Lei Zhang <thestig@chromium.org> | 2018-05-28 17:51:28 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-28 17:51:28 +0000 |
commit | fffdeebfd0ed9806d32eb5609e0fdd015c25c5ac (patch) | |
tree | 7461043e508179a7d33b850486f312c58048e4a8 /core/fpdfdoc/cpdf_structtree.cpp | |
parent | 45a55241d315d25067582d29fcdc1ff8b818965f (diff) | |
download | pdfium-fffdeebfd0ed9806d32eb5609e0fdd015c25c5ac.tar.xz |
Add const/non-const versions of remaining CPDF_Dictionary methods.
GetObjectFor() and GetDirectObjectFor().
Change-Id: I588cd994dfccf0ffd4c8f91362a4806dc109251e
Reviewed-on: https://pdfium-review.googlesource.com/32991
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_structtree.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_structtree.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/fpdfdoc/cpdf_structtree.cpp b/core/fpdfdoc/cpdf_structtree.cpp index 1e4d08aa3c..d0a67876b9 100644 --- a/core/fpdfdoc/cpdf_structtree.cpp +++ b/core/fpdfdoc/cpdf_structtree.cpp @@ -47,14 +47,14 @@ void CPDF_StructTree::LoadPageTree(const CPDF_Dictionary* pPageDict) { if (!m_pTreeRoot) return; - CPDF_Object* pKids = m_pTreeRoot->GetDirectObjectFor("K"); + const CPDF_Object* pKids = m_pTreeRoot->GetDirectObjectFor("K"); if (!pKids) return; uint32_t dwKids = 0; if (pKids->IsDictionary()) dwKids = 1; - else if (CPDF_Array* pArray = pKids->AsArray()) + else if (const CPDF_Array* pArray = pKids->AsArray()) dwKids = pArray->GetCount(); else return; @@ -119,7 +119,7 @@ RetainPtr<CPDF_StructElement> CPDF_StructTree::AddPageNode( bool CPDF_StructTree::AddTopLevelNode( const CPDF_Dictionary* pDict, const RetainPtr<CPDF_StructElement>& pElement) { - CPDF_Object* pObj = m_pTreeRoot->GetDirectObjectFor("K"); + const CPDF_Object* pObj = m_pTreeRoot->GetDirectObjectFor("K"); if (!pObj) return false; @@ -129,13 +129,13 @@ bool CPDF_StructTree::AddTopLevelNode( m_Kids[0] = pElement; } - CPDF_Array* pTopKids = pObj->AsArray(); + const CPDF_Array* pTopKids = pObj->AsArray(); if (!pTopKids) return true; bool bSave = false; for (size_t i = 0; i < pTopKids->GetCount(); i++) { - CPDF_Reference* pKidRef = ToReference(pTopKids->GetObjectAt(i)); + const CPDF_Reference* pKidRef = ToReference(pTopKids->GetObjectAt(i)); if (pKidRef && pKidRef->GetRefObjNum() == pDict->GetObjNum()) { m_Kids[i] = pElement; bSave = true; |