Index: core/fpdfapi/fpdf_parser/ipdf_occontext.cpp |
diff --git a/core/fpdfapi/fpdf_parser/ipdf_occontext.cpp b/core/fpdfapi/fpdf_parser/ipdf_occontext.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..56a2412d9ada2a953d4632913ff3f54d2ed4ef22 |
--- /dev/null |
+++ b/core/fpdfapi/fpdf_parser/ipdf_occontext.cpp |
@@ -0,0 +1,25 @@ |
+// Copyright 2016 PDFium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
+ |
+#include "core/fpdfapi/fpdf_parser/ipdf_occontext.h" |
+ |
+#include "core/include/fpdfapi/fpdf_pageobj.h" |
+ |
+IPDF_OCContext::~IPDF_OCContext() {} |
+ |
+FX_BOOL IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj) { |
+ const CPDF_ContentMarkData* pData = pObj->m_ContentMark; |
+ int nItems = pData->CountItems(); |
+ for (int i = 0; i < nItems; i++) { |
+ const CPDF_ContentMarkItem& item = pData->GetItem(i); |
+ if (item.GetName() == "OC" && |
+ item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict && |
+ !CheckOCGVisible(item.GetParam())) { |
+ return FALSE; |
+ } |
+ } |
+ return TRUE; |
+} |