summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_occontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfdoc/cpdf_occontext.cpp')
-rw-r--r--core/fpdfdoc/cpdf_occontext.cpp20
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);