diff options
author | Lei Zhang <thestig@chromium.org> | 2018-05-28 17:51:28 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-28 17:51:28 +0000 |
commit | fffdeebfd0ed9806d32eb5609e0fdd015c25c5ac (patch) | |
tree | 7461043e508179a7d33b850486f312c58048e4a8 /core/fpdfdoc/cpdf_dest.cpp | |
parent | 45a55241d315d25067582d29fcdc1ff8b818965f (diff) | |
download | pdfium-fffdeebfd0ed9806d32eb5609e0fdd015c25c5ac.tar.xz |
Add const/non-const versions of remaining CPDF_Dictionary methods.
GetObjectFor() and GetDirectObjectFor().
Change-Id: I588cd994dfccf0ffd4c8f91362a4806dc109251e
Reviewed-on: https://pdfium-review.googlesource.com/32991
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_dest.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_dest.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/core/fpdfdoc/cpdf_dest.cpp b/core/fpdfdoc/cpdf_dest.cpp index e787dcdd22..58d0ac26b8 100644 --- a/core/fpdfdoc/cpdf_dest.cpp +++ b/core/fpdfdoc/cpdf_dest.cpp @@ -34,16 +34,16 @@ CPDF_Dest::CPDF_Dest() {} CPDF_Dest::CPDF_Dest(const CPDF_Dest& that) = default; -CPDF_Dest::CPDF_Dest(CPDF_Array* pObj) : m_pObj(pObj) {} +CPDF_Dest::CPDF_Dest(const CPDF_Array* pObj) : m_pObj(pObj) {} CPDF_Dest::~CPDF_Dest() {} int CPDF_Dest::GetPageIndexDeprecated(CPDF_Document* pDoc) const { - CPDF_Array* pArray = ToArray(m_pObj.Get()); + const CPDF_Array* pArray = ToArray(m_pObj.Get()); if (!pArray) return 0; - CPDF_Object* pPage = pArray->GetDirectObjectAt(0); + const CPDF_Object* pPage = pArray->GetDirectObjectAt(0); if (!pPage) return 0; @@ -57,11 +57,11 @@ int CPDF_Dest::GetPageIndexDeprecated(CPDF_Document* pDoc) const { } int CPDF_Dest::GetDestPageIndex(CPDF_Document* pDoc) const { - CPDF_Array* pArray = ToArray(m_pObj.Get()); + const CPDF_Array* pArray = ToArray(m_pObj.Get()); if (!pArray) return -1; - CPDF_Object* pPage = pArray->GetDirectObjectAt(0); + const CPDF_Object* pPage = pArray->GetDirectObjectAt(0); if (!pPage) return -1; @@ -75,11 +75,11 @@ int CPDF_Dest::GetDestPageIndex(CPDF_Document* pDoc) const { } uint32_t CPDF_Dest::GetPageObjNum() const { - CPDF_Array* pArray = ToArray(m_pObj.Get()); + const CPDF_Array* pArray = ToArray(m_pObj.Get()); if (!pArray) return 0; - CPDF_Object* pPage = pArray->GetDirectObjectAt(0); + const CPDF_Object* pPage = pArray->GetDirectObjectAt(0); if (!pPage) return 0; if (pPage->IsNumber()) @@ -90,11 +90,11 @@ uint32_t CPDF_Dest::GetPageObjNum() const { } int CPDF_Dest::GetZoomMode() const { - CPDF_Array* pArray = ToArray(m_pObj.Get()); + const CPDF_Array* pArray = ToArray(m_pObj.Get()); if (!pArray) return 0; - CPDF_Object* pObj = pArray->GetDirectObjectAt(1); + const CPDF_Object* pObj = pArray->GetDirectObjectAt(1); if (!pObj) return 0; @@ -117,7 +117,7 @@ bool CPDF_Dest::GetXYZ(bool* pHasX, *pHasY = false; *pHasZoom = false; - CPDF_Array* pArray = ToArray(m_pObj.Get()); + const CPDF_Array* pArray = ToArray(m_pObj.Get()); if (!pArray) return false; @@ -155,7 +155,7 @@ bool CPDF_Dest::GetXYZ(bool* pHasX, } unsigned long CPDF_Dest::GetNumParams() const { - CPDF_Array* pArray = ToArray(m_pObj.Get()); + const CPDF_Array* pArray = ToArray(m_pObj.Get()); if (!pArray || pArray->GetCount() < 2) return 0; @@ -165,7 +165,7 @@ unsigned long CPDF_Dest::GetNumParams() const { } float CPDF_Dest::GetParam(int index) const { - CPDF_Array* pArray = ToArray(m_pObj.Get()); + const CPDF_Array* pArray = ToArray(m_pObj.Get()); return pArray ? pArray->GetNumberAt(2 + index) : 0; } |