| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/fpdfdoc/include/cpdf_occontext.h" | 7 #include "core/fpdfdoc/include/cpdf_occontext.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" | 9 #include "core/fpdfapi/fpdf_page/cpdf_pageobject.h" |
| 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 10 #include "core/fpdfapi/fpdf_parser/cpdf_array.h" |
| 11 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 11 #include "core/fpdfapi/fpdf_parser/cpdf_document.h" |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 int32_t FindGroup(const CPDF_Array* pArray, const CPDF_Dictionary* pGroupDict) { | 15 int32_t FindGroup(const CPDF_Array* pArray, const CPDF_Dictionary* pGroupDict) { |
| 16 if (!pArray || !pGroupDict) | 16 if (!pArray || !pGroupDict) |
| 17 return -1; | 17 return -1; |
| 18 | 18 |
| 19 for (size_t i = 0; i < pArray->GetCount(); i++) { | 19 for (size_t i = 0; i < pArray->GetCount(); i++) { |
| 20 if (pArray->GetDictAt(i) == pGroupDict) | 20 if (pArray->GetDictAt(i) == pGroupDict) |
| 21 return i; | 21 return i; |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 270 |
| 271 bool CPDF_OCContext::CheckOCGVisible(const CPDF_Dictionary* pOCGDict) { | 271 bool CPDF_OCContext::CheckOCGVisible(const CPDF_Dictionary* pOCGDict) { |
| 272 if (!pOCGDict) | 272 if (!pOCGDict) |
| 273 return true; | 273 return true; |
| 274 | 274 |
| 275 CFX_ByteString csType = pOCGDict->GetStringFor("Type", "OCG"); | 275 CFX_ByteString csType = pOCGDict->GetStringFor("Type", "OCG"); |
| 276 if (csType == "OCG") | 276 if (csType == "OCG") |
| 277 return GetOCGVisible(pOCGDict); | 277 return GetOCGVisible(pOCGDict); |
| 278 return LoadOCMDState(pOCGDict); | 278 return LoadOCMDState(pOCGDict); |
| 279 } | 279 } |
| OLD | NEW |