2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 10:58:58 +00:00

Fix CI failure

This commit is contained in:
m-holger 2023-06-23 18:52:57 +01:00
parent 8b030125a3
commit 2e069242e9
2 changed files with 7 additions and 5 deletions

View File

@ -970,9 +970,6 @@ QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data)
if (m->object_to_obj_users.empty()) {
// Note that we can't call optimize here because we don't know whether it should be called
// with or without allow changes.
if (getRoot().getKeyIfDict("/Pages").isNull()) {
stopOnError("no /Pages found while calculating linearization data");
}
throw std::logic_error(
"INTERNAL ERROR: QPDF::calculateLinearizationData called before optimize()");
}

View File

@ -113,6 +113,11 @@ QPDF::optimize(
}
filterCompressedObjects(object_stream_data);
if (m->obj_user_to_objects.empty()) {
stopOnError("no objects found while trying to optimize");
}
}
void
@ -376,6 +381,6 @@ QPDF::filterCompressedObjects(std::map<int, int> const& object_stream_data)
}
}
m->obj_user_to_objects = t_obj_user_to_objects;
m->object_to_obj_users = t_object_to_obj_users;
m->obj_user_to_objects.swap(t_obj_user_to_objects);
m->object_to_obj_users.swap(t_object_to_obj_users);
}