From 7b5bc26e8267fec38bef9f95cd04d2bd731faff3 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 5 Mar 2015 16:44:22 -0800 Subject: Merge to XFA: Make conversion between CPDF_Action and its dictionary explicit. Original Review URL: https://codereview.chromium.org/984773002 R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/984783002 --- core/include/fpdfdoc/fpdf_doc.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'core/include/fpdfdoc/fpdf_doc.h') diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h index fc34f1af4b..a21063fedd 100644 --- a/core/include/fpdfdoc/fpdf_doc.h +++ b/core/include/fpdfdoc/fpdf_doc.h @@ -264,17 +264,6 @@ public: class CPDF_Action : public CFX_Object { public: - - CPDF_Action(CPDF_Dictionary* pDict = NULL) - { - m_pDict = pDict; - } - - operator CPDF_Dictionary* () const - { - return m_pDict; - } - enum ActionType { Unknown = 0, GoTo, @@ -297,6 +286,13 @@ public: GoTo3DView }; + CPDF_Action() : m_pDict(nullptr) { } + explicit CPDF_Action(CPDF_Dictionary* pDict) : m_pDict(pDict) { } + + operator bool () const { return m_pDict != NULL; } + + CPDF_Dictionary* GetDict() const { return m_pDict; } + CFX_ByteString GetTypeName() const { return m_pDict->GetString("S"); @@ -422,7 +418,7 @@ public: CPDF_Action GetSubAction(FX_DWORD iIndex) const; - +protected: CPDF_Dictionary* m_pDict; }; class CPDF_AAction : public CFX_Object -- cgit v1.2.3