aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFObjectHandle.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-08-18 04:27:55 +0200
committerJay Berkenbilt <ejb@ql.org>2019-08-18 05:02:41 +0200
commit5187a3ec85f1a83cbde9e77227e215a2dbcfccb0 (patch)
tree23c9f79d872a46da2a5eba3b4ba66939276c9a7f /libqpdf/QPDFObjectHandle.cc
parentbf7c6a80705c2b913b63a84349e030f1d9dc8233 (diff)
downloadqpdf-5187a3ec85f1a83cbde9e77227e215a2dbcfccb0.tar.zst
Shallow copy arrays without removing sparseness
Diffstat (limited to 'libqpdf/QPDFObjectHandle.cc')
-rw-r--r--libqpdf/QPDFObjectHandle.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc
index cd03ef1c..3fa0266c 100644
--- a/libqpdf/QPDFObjectHandle.cc
+++ b/libqpdf/QPDFObjectHandle.cc
@@ -2340,7 +2340,10 @@ QPDFObjectHandle::shallowCopy()
if (isArray())
{
QTC::TC("qpdf", "QPDFObjectHandle shallow copy array");
- new_obj = newArray(getArrayAsVector());
+ // No newArray for shallow copying the sparse array
+ QPDF_Array* arr = dynamic_cast<QPDF_Array*>(m->obj.getPointer());
+ new_obj = QPDFObjectHandle(
+ new QPDF_Array(arr->getElementsForShallowCopy()));
}
else if (isDictionary())
{