diff options
author | Lei Zhang <thestig@chromium.org> | 2018-05-25 21:48:49 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-25 21:48:49 +0000 |
commit | 5cee3f28ead05cb336377483e24664c004af8b0a (patch) | |
tree | 8fb5db3232e1359831682c809be3ec10de1ce1e0 /core/fpdfdoc/cpdf_occontext.cpp | |
parent | 1f17bd73afa6b1b79ec4a2f81c995b43d15a9814 (diff) | |
download | pdfium-5cee3f28ead05cb336377483e24664c004af8b0a.tar.xz |
Mark more CPDF_Objects as const in action and bookmark code.
Change-Id: Ib5f4cdb9c7f9c33561028a85029649ba68f4a6e5
Reviewed-on: https://pdfium-review.googlesource.com/32912
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_occontext.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_occontext.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/core/fpdfdoc/cpdf_occontext.cpp b/core/fpdfdoc/cpdf_occontext.cpp index e59690996c..192a254329 100644 --- a/core/fpdfdoc/cpdf_occontext.cpp +++ b/core/fpdfdoc/cpdf_occontext.cpp @@ -150,9 +150,9 @@ bool CPDF_OCContext::LoadOCGState(const CPDF_Dictionary* pOCGDict) const { return true; ByteString csState = GetUsageTypeString(m_eUsageType); - CPDF_Dictionary* pUsage = pOCGDict->GetDictFor("Usage"); + const CPDF_Dictionary* pUsage = pOCGDict->GetDictFor("Usage"); if (pUsage) { - CPDF_Dictionary* pState = pUsage->GetDictFor(csState); + const CPDF_Dictionary* pState = pUsage->GetDictFor(csState); if (pState) { ByteString csFind = csState + "State"; if (pState->KeyExist(csFind)) @@ -192,18 +192,18 @@ bool CPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj) { return true; } -bool CPDF_OCContext::GetOCGVE(CPDF_Array* pExpression, int nLevel) { +bool CPDF_OCContext::GetOCGVE(const CPDF_Array* pExpression, int nLevel) { if (nLevel > 32 || !pExpression) return false; ByteString csOperator = pExpression->GetStringAt(0); if (csOperator == "Not") { - CPDF_Object* pOCGObj = pExpression->GetDirectObjectAt(1); + const CPDF_Object* pOCGObj = pExpression->GetDirectObjectAt(1); if (!pOCGObj) return false; - if (CPDF_Dictionary* pDict = pOCGObj->AsDictionary()) + if (const CPDF_Dictionary* pDict = pOCGObj->AsDictionary()) return !GetOCGVisible(pDict); - if (CPDF_Array* pArray = pOCGObj->AsArray()) + if (const CPDF_Array* pArray = pOCGObj->AsArray()) return !GetOCGVE(pArray, nLevel + 1); return false; } @@ -213,14 +213,14 @@ bool CPDF_OCContext::GetOCGVE(CPDF_Array* pExpression, int nLevel) { bool bValue = false; for (size_t i = 1; i < pExpression->GetCount(); i++) { - CPDF_Object* pOCGObj = pExpression->GetDirectObjectAt(1); + const CPDF_Object* pOCGObj = pExpression->GetDirectObjectAt(1); if (!pOCGObj) continue; bool bItem = false; - if (CPDF_Dictionary* pDict = pOCGObj->AsDictionary()) + if (const CPDF_Dictionary* pDict = pOCGObj->AsDictionary()) bItem = GetOCGVisible(pDict); - else if (CPDF_Array* pArray = pOCGObj->AsArray()) + else if (const CPDF_Array* pArray = pOCGObj->AsArray()) bItem = GetOCGVE(pArray, nLevel + 1); if (i == 1) { @@ -237,7 +237,7 @@ bool CPDF_OCContext::GetOCGVE(CPDF_Array* pExpression, int nLevel) { } bool CPDF_OCContext::LoadOCMDState(const CPDF_Dictionary* pOCMDDict) { - CPDF_Array* pVE = pOCMDDict->GetArrayFor("VE"); + const CPDF_Array* pVE = pOCMDDict->GetArrayFor("VE"); if (pVE) return GetOCGVE(pVE, 0); |