| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "../../include/fpdfdoc/fpdf_doc.h" | 7 #include "../../include/fpdfdoc/fpdf_doc.h" |
| 8 static int32_t FPDFDOC_OCG_FindGroup(const CPDF_Object *pObject, const CPDF_Dict
ionary *pGroupDict) | 8 static int32_t FPDFDOC_OCG_FindGroup(const CPDF_Object *pObject, const CPDF_Dict
ionary *pGroupDict) |
| 9 { | 9 { |
| 10 if (pObject == NULL || pGroupDict == NULL) { | 10 if (pObject == NULL || pGroupDict == NULL) { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 FX_BOOL bDefValid = FALSE; | 174 FX_BOOL bDefValid = FALSE; |
| 175 return LoadOCGStateFromConfig(csState, pOCGDict, bDefValid); | 175 return LoadOCGStateFromConfig(csState, pOCGDict, bDefValid); |
| 176 } | 176 } |
| 177 FX_BOOL CPDF_OCContext::GetOCGVisible(const CPDF_Dictionary *pOCGDict) | 177 FX_BOOL CPDF_OCContext::GetOCGVisible(const CPDF_Dictionary *pOCGDict) |
| 178 { | 178 { |
| 179 if (!pOCGDict) { | 179 if (!pOCGDict) { |
| 180 return FALSE; | 180 return FALSE; |
| 181 } | 181 } |
| 182 FX_LPVOID bState = NULL; | 182 void* bState = NULL; |
| 183 if (m_OCGStates.Lookup(pOCGDict, bState)) { | 183 if (m_OCGStates.Lookup(pOCGDict, bState)) { |
| 184 return (uintptr_t)bState != 0; | 184 return (uintptr_t)bState != 0; |
| 185 } | 185 } |
| 186 bState = (FX_LPVOID)(uintptr_t)LoadOCGState(pOCGDict); | 186 bState = (void*)(uintptr_t)LoadOCGState(pOCGDict); |
| 187 m_OCGStates.SetAt(pOCGDict, bState); | 187 m_OCGStates.SetAt(pOCGDict, bState); |
| 188 return (uintptr_t)bState != 0; | 188 return (uintptr_t)bState != 0; |
| 189 } | 189 } |
| 190 FX_BOOL CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromConfig, i
nt nLevel) | 190 FX_BOOL CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromConfig, i
nt nLevel) |
| 191 { | 191 { |
| 192 if (nLevel > 32) { | 192 if (nLevel > 32) { |
| 193 return FALSE; | 193 return FALSE; |
| 194 } | 194 } |
| 195 if (pExpression == NULL) { | 195 if (pExpression == NULL) { |
| 196 return FALSE; | 196 return FALSE; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 if (csType == FX_BSTRC("OCG")) { | 291 if (csType == FX_BSTRC("OCG")) { |
| 292 return GetOCGVisible(pOCGDict); | 292 return GetOCGVisible(pOCGDict); |
| 293 } else { | 293 } else { |
| 294 return LoadOCMDState(pOCGDict, FALSE); | 294 return LoadOCMDState(pOCGDict, FALSE); |
| 295 } | 295 } |
| 296 } | 296 } |
| 297 void CPDF_OCContext::ResetOCContext() | 297 void CPDF_OCContext::ResetOCContext() |
| 298 { | 298 { |
| 299 m_OCGStates.RemoveAll(); | 299 m_OCGStates.RemoveAll(); |
| 300 } | 300 } |
| OLD | NEW |