summaryrefslogtreecommitdiff
path: root/core/fpdfdoc
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-26 13:13:20 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-26 13:13:20 -0700
commitd647a6b2e3fbd2711273637e5a56e659a113d2e9 (patch)
tree91c3a2865fe5abeed901d4a5c392afa95205eed4 /core/fpdfdoc
parent518fd4c5ababbfbf28e010a9c27098e8f6669e4b (diff)
downloadpdfium-d647a6b2e3fbd2711273637e5a56e659a113d2e9.tar.xz
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
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r--core/fpdfdoc/doc_annot.cpp3
-rw-r--r--core/fpdfdoc/doc_ocg.cpp15
-rw-r--r--core/fpdfdoc/include/fpdf_doc.h10
3 files changed, 21 insertions, 7 deletions
diff --git a/core/fpdfdoc/doc_annot.cpp b/core/fpdfdoc/doc_annot.cpp
index 576c8b76fa..db0322c768 100644
--- a/core/fpdfdoc/doc_annot.cpp
+++ b/core/fpdfdoc/doc_annot.cpp
@@ -9,7 +9,6 @@
#include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_reference.h"
-#include "core/fpdfapi/fpdf_parser/ipdf_occontext.h"
#include "core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h"
#include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h"
#include "core/fpdfdoc/cpvt_generateap.h"
@@ -79,7 +78,7 @@ void CPDF_AnnotList::DisplayPass(CPDF_Page* pPage,
continue;
if (pOptions) {
- IPDF_OCContext* pOCContext = pOptions->m_pOCContext;
+ CPDF_OCContext* pOCContext = pOptions->m_pOCContext;
CPDF_Dictionary* pAnnotDict = pAnnot->GetAnnotDict();
if (pOCContext && pAnnotDict &&
!pOCContext->CheckOCGVisible(pAnnotDict->GetDictBy("OC"))) {
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) {
diff --git a/core/fpdfdoc/include/fpdf_doc.h b/core/fpdfdoc/include/fpdf_doc.h
index c11bf43c4e..306b131b88 100644
--- a/core/fpdfdoc/include/fpdf_doc.h
+++ b/core/fpdfdoc/include/fpdf_doc.h
@@ -13,7 +13,6 @@
#include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
#include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h"
-#include "core/fpdfapi/fpdf_parser/ipdf_occontext.h"
#include "core/fxge/include/fx_dib.h"
class CFDF_Document;
@@ -40,6 +39,7 @@ class CPDF_Link;
class CPDF_Metadata;
class CPDF_OCContext;
class CPDF_Page;
+class CPDF_PageObject;
class CPDF_Font;
class CPDF_Form;
class CPDF_RenderOptions;
@@ -118,15 +118,15 @@ class CPDF_Dest {
CPDF_Object* m_pObj;
};
-class CPDF_OCContext : public IPDF_OCContext {
+class CPDF_OCContext {
public:
enum UsageType { View = 0, Design, Print, Export };
explicit CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType = View);
- ~CPDF_OCContext() override;
+ ~CPDF_OCContext();
- // IPDF_OCContext:
- FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCGDict) override;
+ FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCGDict);
+ FX_BOOL CheckObjectVisible(const CPDF_PageObject* pObj);
CPDF_Document* GetDocument() const { return m_pDocument; }
UsageType GetUsageType() const { return m_eUsageType; }