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_structelement.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_structelement.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_structelement.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/fpdfdoc/cpdf_structelement.cpp b/core/fpdfdoc/cpdf_structelement.cpp index ed5c8c7366..24c028fb61 100644 --- a/core/fpdfdoc/cpdf_structelement.cpp +++ b/core/fpdfdoc/cpdf_structelement.cpp @@ -59,15 +59,15 @@ void CPDF_StructElement::LoadKids(const CPDF_Dictionary* pDict) { if (const CPDF_Reference* pRef = ToReference(pObj)) PageObjNum = pRef->GetRefObjNum(); - CPDF_Object* pKids = pDict->GetDirectObjectFor("K"); + const CPDF_Object* pKids = pDict->GetDirectObjectFor("K"); if (!pKids) return; m_Kids.clear(); - if (CPDF_Array* pArray = pKids->AsArray()) { + if (const CPDF_Array* pArray = pKids->AsArray()) { m_Kids.resize(pArray->GetCount()); for (uint32_t i = 0; i < pArray->GetCount(); i++) { - CPDF_Object* pKid = pArray->GetDirectObjectAt(i); + const CPDF_Object* pKid = pArray->GetDirectObjectAt(i); LoadKid(PageObjNum, pKid, &m_Kids[i]); } return; @@ -78,7 +78,7 @@ void CPDF_StructElement::LoadKids(const CPDF_Dictionary* pDict) { } void CPDF_StructElement::LoadKid(uint32_t PageObjNum, - CPDF_Object* pKidObj, + const CPDF_Object* pKidObj, CPDF_StructKid* pKid) { pKid->m_Type = CPDF_StructKid::Invalid; if (!pKidObj) @@ -94,10 +94,10 @@ void CPDF_StructElement::LoadKid(uint32_t PageObjNum, return; } - CPDF_Dictionary* pKidDict = pKidObj->AsDictionary(); + const CPDF_Dictionary* pKidDict = pKidObj->AsDictionary(); if (!pKidDict) return; - if (CPDF_Reference* pRef = ToReference(pKidDict->GetObjectFor("Pg"))) + if (const CPDF_Reference* pRef = ToReference(pKidDict->GetObjectFor("Pg"))) PageObjNum = pRef->GetRefObjNum(); ByteString type = pKidDict->GetStringFor("Type"); @@ -108,7 +108,7 @@ void CPDF_StructElement::LoadKid(uint32_t PageObjNum, if (type == "MCR") { pKid->m_Type = CPDF_StructKid::StreamContent; - CPDF_Reference* pRef = ToReference(pKidDict->GetObjectFor("Stm")); + const CPDF_Reference* pRef = ToReference(pKidDict->GetObjectFor("Stm")); pKid->m_RefObjNum = pRef ? pRef->GetRefObjNum() : 0; pKid->m_PageObjNum = PageObjNum; pKid->m_ContentId = pKidDict->GetIntegerFor("MCID"); @@ -117,7 +117,7 @@ void CPDF_StructElement::LoadKid(uint32_t PageObjNum, if (type == "OBJR") { pKid->m_Type = CPDF_StructKid::Object; - CPDF_Reference* pObj = ToReference(pKidDict->GetObjectFor("Obj")); + const CPDF_Reference* pObj = ToReference(pKidDict->GetObjectFor("Obj")); pKid->m_RefObjNum = pObj ? pObj->GetRefObjNum() : 0; pKid->m_PageObjNum = PageObjNum; return; |