diff options
Diffstat (limited to 'libqpdf/QPDF_linearization.cc')
-rw-r--r-- | libqpdf/QPDF_linearization.cc | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/libqpdf/QPDF_linearization.cc b/libqpdf/QPDF_linearization.cc index f89ed188..e09f7b68 100644 --- a/libqpdf/QPDF_linearization.cc +++ b/libqpdf/QPDF_linearization.cc @@ -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; } @@ -706,7 +705,7 @@ QPDF::getUncompressedObject( return obj; } else { int repl = (*(object_stream_data.find(obj.getObjectID()))).second; - return getObjectByObjGen(QPDFObjGen(repl, 0)); + return getObject(repl, 0); } } @@ -1381,9 +1380,9 @@ QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data) stopOnError("found other than one root while" " calculating linearization data"); } - this->m->part4.push_back(getObjectByObjGen(*(lc_root.begin()))); + this->m->part4.push_back(getObject(*(lc_root.begin()))); for (auto const& og: lc_open_document) { - this->m->part4.push_back(getObjectByObjGen(og)); + this->m->part4.push_back(getObject(og)); } // Part 6: first page objects. Note: implementation note 124 @@ -1412,11 +1411,11 @@ QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data) // hint tables. for (auto const& og: lc_first_page_private) { - this->m->part6.push_back(getObjectByObjGen(og)); + this->m->part6.push_back(getObject(og)); } for (auto const& og: lc_first_page_shared) { - this->m->part6.push_back(getObjectByObjGen(og)); + this->m->part6.push_back(getObject(og)); } // Place the outline dictionary if it goes in the first page section. @@ -1462,7 +1461,7 @@ QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data) for (auto const& og: this->m->obj_user_to_objects[ou]) { if (lc_other_page_private.count(og)) { lc_other_page_private.erase(og); - this->m->part7.push_back(getObjectByObjGen(og)); + this->m->part7.push_back(getObject(og)); ++this->m->c_page_offset_data.entries.at(i).nobjects; } } @@ -1479,7 +1478,7 @@ QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data) // Order is unimportant. for (auto const& og: lc_other_page_shared) { - this->m->part8.push_back(getObjectByObjGen(og)); + this->m->part8.push_back(getObject(og)); } // Part 9: other objects @@ -1501,7 +1500,7 @@ QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data) for (auto const& og: pages_ogs) { if (lc_other.count(og)) { lc_other.erase(og); - this->m->part9.push_back(getObjectByObjGen(og)); + this->m->part9.push_back(getObject(og)); } } @@ -1531,7 +1530,7 @@ QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data) for (auto const& og: ogs) { if (lc_thumbnail_private.count(og)) { lc_thumbnail_private.erase(og); - this->m->part9.push_back(getObjectByObjGen(og)); + this->m->part9.push_back(getObject(og)); } } } @@ -1544,7 +1543,7 @@ QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data) // Place shared thumbnail objects for (auto const& og: lc_thumbnail_shared) { - this->m->part9.push_back(getObjectByObjGen(og)); + this->m->part9.push_back(getObject(og)); } // Place outlines unless in first page @@ -1554,7 +1553,7 @@ QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data) // Place all remaining objects for (auto const& og: lc_other) { - this->m->part9.push_back(getObjectByObjGen(og)); + this->m->part9.push_back(getObject(og)); } // Make sure we got everything exactly once. @@ -1656,7 +1655,7 @@ QPDF::pushOutlinesToPart( lc_outlines.erase(outlines_og); part.push_back(outlines); for (auto const& og: lc_outlines) { - part.push_back(getObjectByObjGen(og)); + part.push_back(getObject(og)); ++this->m->c_outline_data.nobjects; } } |