diff options
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 { |