2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-10 15:20:54 +00:00

Tune QPDFWriter::enqueueObject

This commit is contained in:
m-holger 2023-01-06 13:24:11 +00:00 committed by Jay Berkenbilt
parent 98dff46310
commit 9c216a06d9

View File

@ -1257,17 +1257,17 @@ QPDFWriter::enqueueObject(QPDFObjectHandle object)
// indicates that an object stream is inside itself.
QTC::TC("qpdf", "QPDFWriter ignore self-referential object stream");
}
} else if (object.isArray()) {
if (!this->m->linearized) {
int n = object.getArrayNItems();
for (int i = 0; i < n; ++i) {
enqueueObject(object.getArrayItem(i));
}
return;
} else if (!this->m->linearized) {
if (object.isArray()) {
for (auto& item: object.getArrayAsVector()) {
enqueueObject(item);
}
} else if (object.isDictionary()) {
if (!this->m->linearized) {
for (auto const& key: object.getKeys()) {
enqueueObject(object.getKey(key));
for (auto& item: object.getDictAsMap()) {
if (!item.second.isNull()) {
enqueueObject(item.second);
}
}
}
} else {