diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-03-05 16:30:09 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-03-05 16:30:09 -0800 |
commit | 624b6c1e0fc6a5b0467061ef37b6db6856681afb (patch) | |
tree | 8b1083b0b3f167da7fa7747ab530a9b37dab44b7 /core/include/fpdfdoc/fpdf_doc.h | |
parent | 61c25eebf5a0fcf44dd1a434c88f502a34073eac (diff) | |
download | pdfium-624b6c1e0fc6a5b0467061ef37b6db6856681afb.tar.xz |
Make conversion between CPDF_Action and its dictionary explicit.
Precursor to taking a second shot at cleaning up the FPDF_*
APIs. A FPDF_Action is a CPDF_Dictionary, and a CPDF_Action
is a structure holding a FPDF_Action. This goes against the
convention that FPDF_ types get cast to CPDF_* types, so we
want to make it clear where objects are getting constructed,
etc.
Also tidy fpdf_actionhandler.cpp because it bugs me.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/984773002
Diffstat (limited to 'core/include/fpdfdoc/fpdf_doc.h')
-rw-r--r-- | core/include/fpdfdoc/fpdf_doc.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h index 60f41a5554..dbcc7f433e 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 |