Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(847)

Unified Diff: core/fpdfapi/fpdf_parser/ipdf_occontext.cpp

Issue 1805603002: core/include/fdpfapi cleanup Part I. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_parser/ipdf_occontext.h ('k') | core/fpdfapi/fpdf_parser/ipdf_security_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+}
« no previous file with comments | « core/fpdfapi/fpdf_parser/ipdf_occontext.h ('k') | core/fpdfapi/fpdf_parser/ipdf_security_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698