summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_docpagedata.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-05-09 20:13:42 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-09 20:13:42 +0000
commit54ef2cb9eb5b145c6e973e95ccb488e121556ad7 (patch)
tree1cfd20ec575e8d825693256a17ca0f55b53f6b57 /core/fpdfapi/page/cpdf_docpagedata.cpp
parenta44b288c4132711d0d9dbcc6885fc98525748ad7 (diff)
downloadpdfium-54ef2cb9eb5b145c6e973e95ccb488e121556ad7.tar.xz
Mark numerious pointers as const.
They are mostly CPDF_Object* and derived classes, but others that should be are marked const as well. Change-Id: Ib3344d7d8db90940df8edc97c0dd6c59da080541 Reviewed-on: https://pdfium-review.googlesource.com/32180 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_docpagedata.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_docpagedata.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/core/fpdfapi/page/cpdf_docpagedata.cpp b/core/fpdfapi/page/cpdf_docpagedata.cpp
index 03db315912..9ac5c1e304 100644
--- a/core/fpdfapi/page/cpdf_docpagedata.cpp
+++ b/core/fpdfapi/page/cpdf_docpagedata.cpp
@@ -209,32 +209,33 @@ void CPDF_DocPageData::ReleaseFont(const CPDF_Dictionary* pFontDict) {
}
CPDF_ColorSpace* CPDF_DocPageData::GetColorSpace(
- CPDF_Object* pCSObj,
+ const CPDF_Object* pCSObj,
const CPDF_Dictionary* pResources) {
- std::set<CPDF_Object*> visited;
+ std::set<const CPDF_Object*> visited;
return GetColorSpaceGuarded(pCSObj, pResources, &visited);
}
CPDF_ColorSpace* CPDF_DocPageData::GetColorSpaceGuarded(
- CPDF_Object* pCSObj,
+ const CPDF_Object* pCSObj,
const CPDF_Dictionary* pResources,
- std::set<CPDF_Object*>* pVisited) {
- std::set<CPDF_Object*> visitedLocal;
+ std::set<const CPDF_Object*>* pVisited) {
+ std::set<const CPDF_Object*> visitedLocal;
return GetColorSpaceInternal(pCSObj, pResources, pVisited, &visitedLocal);
}
CPDF_ColorSpace* CPDF_DocPageData::GetColorSpaceInternal(
- CPDF_Object* pCSObj,
+ const CPDF_Object* pCSObj,
const CPDF_Dictionary* pResources,
- std::set<CPDF_Object*>* pVisited,
- std::set<CPDF_Object*>* pVisitedInternal) {
+ std::set<const CPDF_Object*>* pVisited,
+ std::set<const CPDF_Object*>* pVisitedInternal) {
if (!pCSObj)
return nullptr;
if (pdfium::ContainsKey(*pVisitedInternal, pCSObj))
return nullptr;
- pdfium::ScopedSetInsertion<CPDF_Object*> insertion(pVisitedInternal, pCSObj);
+ pdfium::ScopedSetInsertion<const CPDF_Object*> insertion(pVisitedInternal,
+ pCSObj);
if (pCSObj->IsName()) {
ByteString name = pCSObj->GetString();
@@ -272,7 +273,7 @@ CPDF_ColorSpace* CPDF_DocPageData::GetColorSpaceInternal(
pVisitedInternal);
}
- CPDF_Array* pArray = pCSObj->AsArray();
+ const CPDF_Array* pArray = pCSObj->AsArray();
if (!pArray || pArray->IsEmpty())
return nullptr;
@@ -304,7 +305,8 @@ CPDF_ColorSpace* CPDF_DocPageData::GetColorSpaceInternal(
return csData->AddRef();
}
-CPDF_ColorSpace* CPDF_DocPageData::GetCopiedColorSpace(CPDF_Object* pCSObj) {
+CPDF_ColorSpace* CPDF_DocPageData::GetCopiedColorSpace(
+ const CPDF_Object* pCSObj) {
if (!pCSObj)
return nullptr;
@@ -484,7 +486,7 @@ void CPDF_DocPageData::MaybePurgeFontFileStreamAcc(
}
CPDF_CountedColorSpace* CPDF_DocPageData::FindColorSpacePtr(
- CPDF_Object* pCSObj) const {
+ const CPDF_Object* pCSObj) const {
if (!pCSObj)
return nullptr;