diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-03-06 10:34:48 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-03-06 10:34:48 -0800 |
commit | 5a370d77d0db7550e91888f0ff50ee305f0f9f3d (patch) | |
tree | 8904d0b898864938c5ad8b4eb26c0ae9fbcb21b4 /core/include | |
parent | 7348faecc70ca3bff5aa3715da32032f0c897c23 (diff) | |
download | pdfium-5a370d77d0db7550e91888f0ff50ee305f0f9f3d.tar.xz |
Make conversion between CPDF_Dest and its object explicit.
Precursor to taking a second shot at cleaning up the FPDF_*
APIs. A FPDF_Dest is a CPDF_Array, and a CPDF_Dest
is a structure holding a FPDF_Dest. 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.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/984703004
Diffstat (limited to 'core/include')
-rw-r--r-- | core/include/fpdfdoc/fpdf_doc.h | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h index dbcc7f433e..dac215e711 100644 --- a/core/include/fpdfdoc/fpdf_doc.h +++ b/core/include/fpdfdoc/fpdf_doc.h @@ -124,28 +124,19 @@ public: class CPDF_Dest : public CFX_Object { public: + CPDF_Dest() : m_pObj(nullptr) { } + explicit CPDF_Dest(CPDF_Object* pObj) : m_pObj(pObj) { } - CPDF_Dest(CPDF_Object* pObj = NULL) - { - m_pObj = pObj; - } - - operator CPDF_Object* () const - { - return m_pObj; - } + operator bool () const { return m_pObj != NULL; } + CPDF_Object* GetObject() const { return m_pObj; } CFX_ByteString GetRemoteName(); - int GetPageIndex(CPDF_Document* pDoc); - FX_DWORD GetPageObjNum(); - int GetZoomMode(); - FX_FLOAT GetParam(int index); - +protected: CPDF_Object* m_pObj; }; class CPDF_OCContext : public CFX_Object, public IPDF_OCContext |