summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/include/fpdf_doc.h
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-05-23 12:28:43 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-23 12:28:43 -0700
commitef4e8878cbcc19cd77f79dd8258d2a98142973f4 (patch)
treea45aa520e89967b35f9dc9347581b84615fdbaa4 /core/fpdfdoc/include/fpdf_doc.h
parent09e139e231d1a94bd99ac295f3d66cb26c54ea16 (diff)
downloadpdfium-ef4e8878cbcc19cd77f79dd8258d2a98142973f4.tar.xz
Clean up doc_ocg.cpp.
Review-Url: https://codereview.chromium.org/2006483002
Diffstat (limited to 'core/fpdfdoc/include/fpdf_doc.h')
-rw-r--r--core/fpdfdoc/include/fpdf_doc.h35
1 files changed, 14 insertions, 21 deletions
diff --git a/core/fpdfdoc/include/fpdf_doc.h b/core/fpdfdoc/include/fpdf_doc.h
index 8758ab9a42..cb751915d4 100644
--- a/core/fpdfdoc/include/fpdf_doc.h
+++ b/core/fpdfdoc/include/fpdf_doc.h
@@ -9,6 +9,7 @@
#include <map>
#include <memory>
+#include <unordered_map>
#include <vector>
#include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
@@ -124,31 +125,23 @@ class CPDF_OCContext {
public:
enum UsageType { View = 0, Design, Print, Export };
- explicit CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType = View);
+ CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType);
~CPDF_OCContext();
- 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; }
-
- void ResetOCContext();
+ bool CheckOCGVisible(const CPDF_Dictionary* pOCGDict);
+ bool CheckObjectVisible(const CPDF_PageObject* pObj);
protected:
- FX_BOOL LoadOCGStateFromConfig(const CFX_ByteString& csConfig,
- const CPDF_Dictionary* pOCGDict,
- FX_BOOL& bValidConfig) const;
- FX_BOOL LoadOCGState(const CPDF_Dictionary* pOCGDict) const;
- FX_BOOL GetOCGVisible(const CPDF_Dictionary* pOCGDict);
- FX_BOOL GetOCGVE(CPDF_Array* pExpression,
- FX_BOOL bFromConfig,
- int nLevel = 0);
- FX_BOOL LoadOCMDState(const CPDF_Dictionary* pOCMDDict, FX_BOOL bFromConfig);
-
- CPDF_Document* m_pDocument;
- UsageType m_eUsageType;
- std::map<const CPDF_Dictionary*, FX_BOOL> m_OCGStates;
+ bool LoadOCGStateFromConfig(const CFX_ByteString& csConfig,
+ const CPDF_Dictionary* pOCGDict) const;
+ bool LoadOCGState(const CPDF_Dictionary* pOCGDict) const;
+ bool GetOCGVisible(const CPDF_Dictionary* pOCGDict);
+ bool GetOCGVE(CPDF_Array* pExpression, int nLevel);
+ bool LoadOCMDState(const CPDF_Dictionary* pOCMDDict);
+
+ CPDF_Document* const m_pDocument;
+ const UsageType m_eUsageType;
+ std::unordered_map<const CPDF_Dictionary*, bool> m_OCGStates;
};
class CPDF_ActionFields {