aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/NNTree.cc2
-rw-r--r--libqpdf/QPDFAcroFormDocumentHelper.cc6
-rw-r--r--libqpdf/QPDFJob.cc4
-rw-r--r--libqpdf/QPDFObjectHandle.cc8
4 files changed, 10 insertions, 10 deletions
diff --git a/libqpdf/NNTree.cc b/libqpdf/NNTree.cc
index 02881e99..fa054794 100644
--- a/libqpdf/NNTree.cc
+++ b/libqpdf/NNTree.cc
@@ -591,7 +591,7 @@ NNTreeIterator::deepen(QPDFObjectHandle node, bool first, bool allow_empty)
bool failed = false;
QPDFObjGen::set seen;
- for (auto i: this->path) {
+ for (auto const& i: this->path) {
seen.add(i.node);
}
while (!failed) {
diff --git a/libqpdf/QPDFAcroFormDocumentHelper.cc b/libqpdf/QPDFAcroFormDocumentHelper.cc
index 83feb358..5a54bf75 100644
--- a/libqpdf/QPDFAcroFormDocumentHelper.cc
+++ b/libqpdf/QPDFAcroFormDocumentHelper.cc
@@ -70,7 +70,7 @@ QPDFAcroFormDocumentHelper::addAndRenameFormFields(std::vector<QPDFObjectHandle>
if (seen.add(obj)) {
auto kids = obj.getKey("/Kids");
if (kids.isArray()) {
- for (auto kid: kids.aitems()) {
+ for (auto const& kid: kids.aitems()) {
queue.push_back(kid);
}
}
@@ -104,7 +104,7 @@ QPDFAcroFormDocumentHelper::addAndRenameFormFields(std::vector<QPDFObjectHandle>
}
}
- for (auto i: fields) {
+ for (auto const& i: fields) {
addFormField(i);
}
}
@@ -1018,7 +1018,7 @@ QPDFAcroFormDocumentHelper::fixCopiedAnnotations(
to_page.replaceKey("/Annots", QPDFObjectHandle::newArray(new_annots));
addAndRenameFormFields(new_fields);
if (added_fields) {
- for (auto f: new_fields) {
+ for (auto const& f: new_fields) {
added_fields->insert(f.getObjGen());
}
}
diff --git a/libqpdf/QPDFJob.cc b/libqpdf/QPDFJob.cc
index c33c4b70..3f3bcbb1 100644
--- a/libqpdf/QPDFJob.cc
+++ b/libqpdf/QPDFJob.cc
@@ -894,7 +894,7 @@ QPDFJob::doListAttachments(QPDF& pdf)
v << " " << i2.first << " -> " << i2.second << "\n";
}
v << " all data streams:\n";
- for (auto i2: efoh->getEmbeddedFileStreams().ditems()) {
+ for (auto const& i2: efoh->getEmbeddedFileStreams().ditems()) {
auto efs = QPDFEFStreamObjectHelper(i2.second);
v << " " << i2.first << " -> "
<< efs.getObjectHandle().getObjGen().unparse(',') << "\n";
@@ -1329,7 +1329,7 @@ QPDFJob::doJSONAttachments(Pipeline* p, bool& first, QPDF& pdf)
j_names.addDictionaryMember(i2.first, JSON::makeString(i2.second));
}
auto j_streams = j_details.addDictionaryMember("streams", JSON::makeDictionary());
- for (auto i2: fsoh->getEmbeddedFileStreams().ditems()) {
+ for (auto const& i2: fsoh->getEmbeddedFileStreams().ditems()) {
auto efs = QPDFEFStreamObjectHelper(i2.second);
auto j_stream = j_streams.addDictionaryMember(i2.first, JSON::makeDictionary());
j_stream.addDictionaryMember(
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc
index 9ec87f79..3ce748b0 100644
--- a/libqpdf/QPDFObjectHandle.cc
+++ b/libqpdf/QPDFObjectHandle.cc
@@ -1048,7 +1048,7 @@ QPDFObjectHandle::makeResourcesIndirect(QPDF& owning_qpdf)
if (!sub.isDictionary()) {
continue;
}
- for (auto i2: sub.ditems()) {
+ for (auto const& i2: sub.ditems()) {
std::string const& key = i2.first;
QPDFObjectHandle val = i2.second;
if (!val.isIndirect()) {
@@ -1069,7 +1069,7 @@ QPDFObjectHandle::mergeResources(
auto make_og_to_name = [](QPDFObjectHandle& dict,
std::map<QPDFObjGen, std::string>& og_to_name) {
- for (auto i: dict.ditems()) {
+ for (auto const& i: dict.ditems()) {
if (i.second.isIndirect()) {
og_to_name[i.second.getObjGen()] = i.first;
}
@@ -1078,7 +1078,7 @@ QPDFObjectHandle::mergeResources(
// This algorithm is described in comments in QPDFObjectHandle.hh
// above the declaration of mergeResources.
- for (auto o_top: other.ditems()) {
+ for (auto const& o_top: other.ditems()) {
std::string const& rtype = o_top.first;
QPDFObjectHandle other_val = o_top.second;
if (hasKey(rtype)) {
@@ -1095,7 +1095,7 @@ QPDFObjectHandle::mergeResources(
std::set<std::string> rnames;
int min_suffix = 1;
bool initialized_maps = false;
- for (auto ov_iter: other_val.ditems()) {
+ for (auto const& ov_iter: other_val.ditems()) {
std::string const& key = ov_iter.first;
QPDFObjectHandle rval = ov_iter.second;
if (!this_val.hasKey(key)) {