diff options
Diffstat (limited to 'libqpdf/SparseOHArray.cc')
-rw-r--r-- | libqpdf/SparseOHArray.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libqpdf/SparseOHArray.cc b/libqpdf/SparseOHArray.cc index 6ff02f6c..567f9d0b 100644 --- a/libqpdf/SparseOHArray.cc +++ b/libqpdf/SparseOHArray.cc @@ -110,6 +110,19 @@ SparseOHArray::insert(size_t idx, QPDFObjectHandle oh) } } +SparseOHArray +SparseOHArray::copy() +{ + SparseOHArray result; + result.n_elements = this->n_elements; + for (auto const& element: this->elements) { + auto value = element.second; + result.elements[element.first] = + value.isIndirect() ? value : value.shallowCopy(); + } + return result; +} + SparseOHArray::const_iterator SparseOHArray::begin() const { |