summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_interform.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-05-25 21:48:49 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-25 21:48:49 +0000
commit5cee3f28ead05cb336377483e24664c004af8b0a (patch)
tree8fb5db3232e1359831682c809be3ec10de1ce1e0 /fpdfsdk/cpdfsdk_interform.cpp
parent1f17bd73afa6b1b79ec4a2f81c995b43d15a9814 (diff)
downloadpdfium-5cee3f28ead05cb336377483e24664c004af8b0a.tar.xz
Mark more CPDF_Objects as const in action and bookmark code.
Change-Id: Ib5f4cdb9c7f9c33561028a85029649ba68f4a6e5 Reviewed-on: https://pdfium-review.googlesource.com/32912 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_interform.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_interform.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp
index b37562ccf2..638b4dfc07 100644
--- a/fpdfsdk/cpdfsdk_interform.cpp
+++ b/fpdfsdk/cpdfsdk_interform.cpp
@@ -412,7 +412,7 @@ bool CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action) {
ASSERT(action.GetDict());
CPDF_ActionFields af(&action);
- std::vector<CPDF_Object*> fieldObjects = af.GetAllFields();
+ std::vector<const CPDF_Object*> fieldObjects = af.GetAllFields();
std::vector<CPDF_FormField*> fields = GetFieldFromObjects(fieldObjects);
bool bHide = action.GetHideStatus();
@@ -446,11 +446,11 @@ bool CPDFSDK_InterForm::DoAction_SubmitForm(const CPDF_Action& action) {
if (sDestination.IsEmpty())
return false;
- CPDF_Dictionary* pActionDict = action.GetDict();
+ const CPDF_Dictionary* pActionDict = action.GetDict();
if (pActionDict->KeyExist("Fields")) {
CPDF_ActionFields af(&action);
uint32_t dwFlags = action.GetFlags();
- std::vector<CPDF_Object*> fieldObjects = af.GetAllFields();
+ std::vector<const CPDF_Object*> fieldObjects = af.GetAllFields();
std::vector<CPDF_FormField*> fields = GetFieldFromObjects(fieldObjects);
if (!fields.empty()) {
bool bIncludeOrExclude = !(dwFlags & 0x01);
@@ -590,7 +590,7 @@ ByteString CPDFSDK_InterForm::ExportFormToFDFTextBuf() {
void CPDFSDK_InterForm::DoAction_ResetForm(const CPDF_Action& action) {
ASSERT(action.GetDict());
- CPDF_Dictionary* pActionDict = action.GetDict();
+ const CPDF_Dictionary* pActionDict = action.GetDict();
if (!pActionDict->KeyExist("Fields")) {
m_pInterForm->ResetForm(true);
return;
@@ -599,15 +599,15 @@ void CPDFSDK_InterForm::DoAction_ResetForm(const CPDF_Action& action) {
CPDF_ActionFields af(&action);
uint32_t dwFlags = action.GetFlags();
- std::vector<CPDF_Object*> fieldObjects = af.GetAllFields();
+ std::vector<const CPDF_Object*> fieldObjects = af.GetAllFields();
std::vector<CPDF_FormField*> fields = GetFieldFromObjects(fieldObjects);
m_pInterForm->ResetForm(fields, !(dwFlags & 0x01), true);
}
std::vector<CPDF_FormField*> CPDFSDK_InterForm::GetFieldFromObjects(
- const std::vector<CPDF_Object*>& objects) const {
+ const std::vector<const CPDF_Object*>& objects) const {
std::vector<CPDF_FormField*> fields;
- for (CPDF_Object* pObject : objects) {
+ for (const CPDF_Object* pObject : objects) {
if (!pObject || !pObject->IsString())
continue;