aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFWriter.cc
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-05-21 16:18:15 +0200
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-05-21 22:06:29 +0200
commit6c69a747b9f7a801be2ad58985f35886bd38239e (patch)
treea35f002d4564ad1811044335c34f1b510a6774b8 /libqpdf/QPDFWriter.cc
parent70ccd807c45f477d6caf73b9390ba3acda53d1db (diff)
downloadqpdf-6c69a747b9f7a801be2ad58985f35886bd38239e.tar.zst
Code clean up: use range-style for loops wherever possible
Remove variables obsoleted by commit 4f24617.
Diffstat (limited to 'libqpdf/QPDFWriter.cc')
-rw-r--r--libqpdf/QPDFWriter.cc21
1 files changed, 7 insertions, 14 deletions
diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc
index 70c65c5d..b1bb4ad7 100644
--- a/libqpdf/QPDFWriter.cc
+++ b/libqpdf/QPDFWriter.cc
@@ -1237,8 +1237,7 @@ QPDFWriter::enqueueObject(QPDFObjectHandle object)
}
}
} else if (object.isDictionary()) {
- std::set<std::string> keys = object.getKeys();
- for (auto const& key: keys) {
+ for (auto const& key: object.getKeys()) {
if (!this->m->linearized) {
enqueueObject(object.getKey(key));
}
@@ -1283,8 +1282,7 @@ QPDFWriter::writeTrailer(
writeString(" /Size ");
writeString(QUtil::int_to_string(size));
} else {
- std::set<std::string> keys = trailer.getKeys();
- for (auto const& key: keys) {
+ for (auto const& key: trailer.getKeys()) {
writeStringQDF(" ");
writeStringNoQDF(" ");
writeString(QPDF_Name::normalizeName(key));
@@ -1644,8 +1642,7 @@ QPDFWriter::unparseObject(
writeString("<<");
writeStringQDF("\n");
- std::set<std::string> keys = object.getKeys();
- for (auto const& key: keys) {
+ for (auto const& key: object.getKeys()) {
writeStringQDF(indent);
writeStringQDF(" ");
writeStringNoQDF(" ");
@@ -2074,8 +2071,7 @@ QPDFWriter::generateID()
seed += " QPDF ";
if (trailer.hasKey("/Info")) {
QPDFObjectHandle info = trailer.getKey("/Info");
- std::set<std::string> keys = info.getKeys();
- for (auto const& key: keys) {
+ for (auto const& key: info.getKeys()) {
QPDFObjectHandle obj = info.getKey(key);
if (obj.isString()) {
seed += " ";
@@ -2365,8 +2361,7 @@ QPDFWriter::doWriteSetup()
if (this->m->linearized) {
// Page dictionaries are not allowed to be compressed objects.
- std::vector<QPDFObjectHandle> pages = this->m->pdf.getAllPages();
- for (auto& page: pages) {
+ for (auto& page: this->m->pdf.getAllPages()) {
QPDFObjGen og = page.getObjGen();
if (this->m->object_to_object_stream.count(og)) {
QTC::TC("qpdf", "QPDFWriter uncompressing page dictionary");
@@ -3251,8 +3246,7 @@ QPDFWriter::enqueueObjectsStandard()
// dictionary into the queue, handling direct objects recursively.
// Root is already there, so enqueuing it a second time is a
// no-op.
- std::set<std::string> keys = trailer.getKeys();
- for (auto const& key: keys) {
+ for (auto const& key: trailer.getKeys()) {
enqueueObject(trailer.getKey(key));
}
}
@@ -3276,8 +3270,7 @@ QPDFWriter::enqueueObjectsPCLm()
// enqueue all the strips for each page
QPDFObjectHandle strips = page.getKey("/Resources").getKey("/XObject");
- std::set<std::string> keys = strips.getKeys();
- for (auto const& image: keys) {
+ for (auto const& image: strips.getKeys()) {
enqueueObject(strips.getKey(image));
enqueueObject(QPDFObjectHandle::newStream(
&this->m->pdf, image_transform_content));