diff options
author | m-holger <m-holger@kubitscheck.org> | 2022-12-19 12:41:09 +0100 |
---|---|---|
committer | Jay Berkenbilt <jberkenbilt@users.noreply.github.com> | 2022-12-31 20:37:35 +0100 |
commit | 9da50ca3601ee58c2ccceaa5d430b56a1ab27306 (patch) | |
tree | 7518877907dfd1c2e43cad161b04b6fcdac272b5 /libqpdf/SparseOHArray.cc | |
parent | e91e642cf35a704866f1dabd89d9a987a309bcc2 (diff) | |
download | qpdf-9da50ca3601ee58c2ccceaa5d430b56a1ab27306.tar.zst |
Change olist variable in QPDFParser::parse to vector<shared_ptr<QPDFObject>>
Diffstat (limited to 'libqpdf/SparseOHArray.cc')
-rw-r--r-- | libqpdf/SparseOHArray.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libqpdf/SparseOHArray.cc b/libqpdf/SparseOHArray.cc index 567f9d0b..5f64f50b 100644 --- a/libqpdf/SparseOHArray.cc +++ b/libqpdf/SparseOHArray.cc @@ -1,5 +1,8 @@ #include <qpdf/SparseOHArray.hh> +#include <qpdf/QPDFObjectHandle.hh> +#include <qpdf/QPDFObject_private.hh> + #include <stdexcept> SparseOHArray::SparseOHArray() : @@ -22,6 +25,15 @@ SparseOHArray::append(QPDFObjectHandle oh) ++this->n_elements; } +void +SparseOHArray::append(std::shared_ptr<QPDFObject>&& obj) +{ + if (obj->getTypeCode() != ::ot_null || !obj->getObjGen().isIndirect()) { + this->elements[this->n_elements] = std::move(obj); + } + ++this->n_elements; +} + QPDFObjectHandle SparseOHArray::at(size_t idx) const { |