aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_Array.cc
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-06-16 18:45:04 +0200
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-06-27 18:47:02 +0200
commitf0a8178091dfc87bbf9a6751f8fedf007e8eb144 (patch)
tree9a4b3af6d96a274016f0feecbc5deecb345c5f4f /libqpdf/QPDF_Array.cc
parent5aa8225f493dc3c3171662fecc8a9ff5d0a16feb (diff)
downloadqpdf-f0a8178091dfc87bbf9a6751f8fedf007e8eb144.tar.zst
Refactor QPDFObject creation and cloning
Move responsibility for creating shared pointers to objects and cloning from QPDFObjectHandle to QPDFObject.
Diffstat (limited to 'libqpdf/QPDF_Array.cc')
-rw-r--r--libqpdf/QPDF_Array.cc24
1 files changed, 18 insertions, 6 deletions
diff --git a/libqpdf/QPDF_Array.cc b/libqpdf/QPDF_Array.cc
index fd046ec7..55e4d20a 100644
--- a/libqpdf/QPDF_Array.cc
+++ b/libqpdf/QPDF_Array.cc
@@ -14,6 +14,24 @@ QPDF_Array::QPDF_Array(SparseOHArray const& items) :
{
}
+std::shared_ptr<QPDFObject>
+QPDF_Array::create(std::vector<QPDFObjectHandle> const& items)
+{
+ return do_create(new QPDF_Array(items));
+}
+
+std::shared_ptr<QPDFObject>
+QPDF_Array::create(SparseOHArray const& items)
+{
+ return do_create(new QPDF_Array(items));
+}
+
+std::shared_ptr<QPDFObject>
+QPDF_Array::shallowCopy()
+{
+ return create(elements);
+}
+
void
QPDF_Array::releaseResolved()
{
@@ -121,12 +139,6 @@ QPDF_Array::eraseItem(int at)
this->elements.erase(QIntC::to_size(at));
}
-SparseOHArray const&
-QPDF_Array::getElementsForShallowCopy() const
-{
- return this->elements;
-}
-
void
QPDF_Array::addExplicitElementsToList(std::list<QPDFObjectHandle>& l) const
{