summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_save.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-05-24 01:36:40 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-24 01:36:40 +0000
commitdbf13f6562a902df17f6e543d3be844ca82956e2 (patch)
tree7ba195555b7534e51708fd8d26000db0700b7cfe /fpdfsdk/fpdf_save.cpp
parent7e33dbeec78dfa051df52619672133da6a799240 (diff)
downloadpdfium-dbf13f6562a902df17f6e543d3be844ca82956e2.tar.xz
Improve constness for more CPDF_Objects pointers.
Most of them can be marked const. A couple are marked non-const because eventually something inside gets modified. Change-Id: I5415ca8d1efdac451cde340272436cd1e6ec433f Reviewed-on: https://pdfium-review.googlesource.com/32184 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_save.cpp')
-rw-r--r--fpdfsdk/fpdf_save.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/fpdfsdk/fpdf_save.cpp b/fpdfsdk/fpdf_save.cpp
index e4a1a607bb..6064a73629 100644
--- a/fpdfsdk/fpdf_save.cpp
+++ b/fpdfsdk/fpdf_save.cpp
@@ -59,7 +59,7 @@ bool SaveXFADocumentData(CPDFXFA_Context* pContext,
if (!pPDFDocument)
return false;
- const CPDF_Dictionary* pRoot = pPDFDocument->GetRoot();
+ CPDF_Dictionary* pRoot = pPDFDocument->GetRoot();
if (!pRoot)
return false;
@@ -80,7 +80,7 @@ bool SaveXFADocumentData(CPDFXFA_Context* pContext,
int iDataSetsIndex = -1;
int iLast = size - 2;
for (int i = 0; i < size - 1; i++) {
- CPDF_Object* pPDFObj = pArray->GetObjectAt(i);
+ const CPDF_Object* pPDFObj = pArray->GetObjectAt(i);
if (!pPDFObj->IsString())
continue;
if (pPDFObj->GetString() == "form")
@@ -90,7 +90,6 @@ bool SaveXFADocumentData(CPDFXFA_Context* pContext,
}
CPDF_Stream* pFormStream = nullptr;
- CPDF_Stream* pDataSetsStream = nullptr;
if (iFormIndex != -1) {
// Get form CPDF_Stream
CPDF_Object* pFormPDFObj = pArray->GetObjectAt(iFormIndex);
@@ -104,6 +103,7 @@ bool SaveXFADocumentData(CPDFXFA_Context* pContext,
}
}
+ CPDF_Stream* pDataSetsStream = nullptr;
if (iDataSetsIndex != -1) {
// Get datasets CPDF_Stream
CPDF_Object* pDataSetsPDFObj = pArray->GetObjectAt(iDataSetsIndex);