From d647a6b2e3fbd2711273637e5a56e659a113d2e9 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 26 Apr 2016 13:13:20 -0700 Subject: Remove several IPDF_ interfaces and CPDF_RenderModule. This CL removes the interfaces: * IPDF_ObjectRenderer * IPDF_OCContext * IPDF_RenderModule * IPDF_PageModule The CPDF_RenderModule was just wrapping new and delete calls. This Cl moves those up to the callers and removes the CPDF_RenderModule class. Review URL: https://codereview.chromium.org/1918323003 --- core/fpdfdoc/doc_ocg.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'core/fpdfdoc/doc_ocg.cpp') diff --git a/core/fpdfdoc/doc_ocg.cpp b/core/fpdfdoc/doc_ocg.cpp index bea3c2ce33..bc5c00b540 100644 --- a/core/fpdfdoc/doc_ocg.cpp +++ b/core/fpdfdoc/doc_ocg.cpp @@ -4,6 +4,8 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include "core/fpdfapi/fpdf_page/cpdf_contentmarkdata.h" +#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "core/fpdfdoc/include/fpdf_doc.h" @@ -181,6 +183,19 @@ FX_BOOL CPDF_OCContext::GetOCGVisible(const CPDF_Dictionary* pOCGDict) { return bState; } +FX_BOOL CPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj) { + const CPDF_ContentMarkData* pData = pObj->m_ContentMark; + for (int i = 0; i < pData->CountItems(); i++) { + const CPDF_ContentMarkItem& item = pData->GetItem(i); + if (item.GetName() == "OC" && + item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict && + !CheckOCGVisible(item.GetParam())) { + return FALSE; + } + } + return TRUE; +} + FX_BOOL CPDF_OCContext::GetOCGVE(CPDF_Array* pExpression, FX_BOOL bFromConfig, int nLevel) { -- cgit v1.2.3