aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/SparseOHArray.cc
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-12-19 12:41:09 +0100
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-12-31 20:37:35 +0100
commit9da50ca3601ee58c2ccceaa5d430b56a1ab27306 (patch)
tree7518877907dfd1c2e43cad161b04b6fcdac272b5 /libqpdf/SparseOHArray.cc
parente91e642cf35a704866f1dabd89d9a987a309bcc2 (diff)
downloadqpdf-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.cc12
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
{