diff options
author | Lei Zhang <thestig@chromium.org> | 2018-05-09 23:15:12 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-09 23:15:12 +0000 |
commit | 3774c7a452886b9c8beeb5fa1b54a34611551180 (patch) | |
tree | aba96eeb7d9fc266ecbe7bc460dcaac869514ecf /core/fpdfapi/edit | |
parent | 7e28208d26764438bef62e051d2e1fed13e1e0ec (diff) | |
download | pdfium-3774c7a452886b9c8beeb5fa1b54a34611551180.tar.xz |
Add proper const/non-const versions of CPDF_Array methods.
Instead of having const methods that return non-const pointers.
BUG=pdfium:234
Change-Id: I61495543f67229500dfcf2248e93468e9a9b23cf
Reviewed-on: https://pdfium-review.googlesource.com/32183
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fpdfapi/edit')
-rw-r--r-- | core/fpdfapi/edit/cpdf_creator.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/fpdfapi/edit/cpdf_creator.cpp b/core/fpdfapi/edit/cpdf_creator.cpp index 872860b0ed..71237f7915 100644 --- a/core/fpdfapi/edit/cpdf_creator.cpp +++ b/core/fpdfapi/edit/cpdf_creator.cpp @@ -258,7 +258,7 @@ bool CPDF_Creator::WriteDirectObj(uint32_t objnum, const CPDF_Array* p = pObj->AsArray(); for (size_t i = 0; i < p->GetCount(); i++) { - CPDF_Object* pElement = p->GetObjectAt(i); + const CPDF_Object* pElement = p->GetObjectAt(i); if (!pElement->IsInline()) { if (!m_Archive->WriteString(" ") || !m_Archive->WriteDWord(pElement->GetObjNum()) || @@ -773,7 +773,8 @@ void CPDF_Creator::InitID() { bool idArrayPreExisting = !!m_pIDArray; if (!idArrayPreExisting) { m_pIDArray = pdfium::MakeUnique<CPDF_Array>(); - CPDF_Object* pID1 = pOldIDArray ? pOldIDArray->GetObjectAt(0) : nullptr; + const CPDF_Object* pID1 = + pOldIDArray ? pOldIDArray->GetObjectAt(0) : nullptr; if (pID1) { m_pIDArray->Add(pID1->Clone()); } else { @@ -785,7 +786,7 @@ void CPDF_Creator::InitID() { } if (pOldIDArray) { - CPDF_Object* pID2 = pOldIDArray->GetObjectAt(1); + const CPDF_Object* pID2 = pOldIDArray->GetObjectAt(1); if (IsIncremental() && m_pEncryptDict && pID2) { m_pIDArray->Add(pID2->Clone()); return; |