2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-05 03:40:53 +00:00

Replace calls to QPDFObjectHandle::Factory::newIndirect where possible

This commit is contained in:
m-holger 2022-08-02 12:33:07 +01:00
parent a078202c1b
commit bd300be08d
2 changed files with 3 additions and 4 deletions

View File

@ -1397,7 +1397,7 @@ QPDF::fixDanglingReferences(bool force)
std::list<QPDFObjectHandle> queue;
queue.push_back(this->m->trailer);
for (auto const& og: to_process) {
QPDFObjectHandle obj = QPDFObjectHandle::Factory::newIndirect(this, og);
auto obj = getObjectByObjGen(og);
if (obj.isDictionary() || obj.isArray()) {
queue.push_back(obj);
} else if (obj.isStream()) {
@ -1463,7 +1463,7 @@ QPDF::getAllObjects()
std::vector<QPDFObjectHandle> result;
for (auto const& iter: this->m->obj_cache) {
QPDFObjGen const& og = iter.first;
result.push_back(QPDFObjectHandle::Factory::newIndirect(this, og));
result.push_back(getObjectByObjGen(og));
}
return result;
}

View File

@ -137,8 +137,7 @@ QPDF::isLinearized()
return false;
}
QPDFObjectHandle candidate = QPDFObjectHandle::Factory::newIndirect(
this, QPDFObjGen(lindict_obj, 0));
auto candidate = getObjectByID(lindict_obj, 0);
if (!candidate.isDictionary()) {
return false;
}