aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFObjectHandle.cc
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-11-20 16:15:04 +0100
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-11-20 18:07:22 +0100
commit3e3b79a774a294ca2020a7bad8ee6ddd2c0179de (patch)
tree3bfad2bfd652e80ef32dcaa91d33644cafb8b576 /libqpdf/QPDFObjectHandle.cc
parent3efd6657039eeb5a33b01b9bd07ba3d5875f5b64 (diff)
downloadqpdf-3e3b79a774a294ca2020a7bad8ee6ddd2c0179de.tar.zst
Remove redundant parameter first_level_only from QPDFObjectHandle::shallowCopyInternal2 and copyObject2
Diffstat (limited to 'libqpdf/QPDFObjectHandle.cc')
-rw-r--r--libqpdf/QPDFObjectHandle.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc
index 6c5055a7..3e37a966 100644
--- a/libqpdf/QPDFObjectHandle.cc
+++ b/libqpdf/QPDFObjectHandle.cc
@@ -2201,13 +2201,12 @@ QPDFObjectHandle
QPDFObjectHandle::shallowCopy()
{
QPDFObjectHandle result;
- shallowCopyInternal1(result, false);
+ shallowCopyInternal1(result);
return result;
}
void
-QPDFObjectHandle::shallowCopyInternal1(
- QPDFObjectHandle& new_obj, bool first_level_only)
+QPDFObjectHandle::shallowCopyInternal1(QPDFObjectHandle& new_obj)
{
assertInitialized();
@@ -2218,12 +2217,11 @@ QPDFObjectHandle::shallowCopyInternal1(
new_obj = QPDFObjectHandle(obj->copy(true));
std::set<QPDFObjGen> visited;
- new_obj.copyObject1(visited, first_level_only);
+ new_obj.copyObject1(visited);
}
void
-QPDFObjectHandle::copyObject1(
- std::set<QPDFObjGen>& visited, bool first_level_only)
+QPDFObjectHandle::copyObject1(std::set<QPDFObjGen>& visited)
{
assertInitialized();
@@ -2258,8 +2256,8 @@ QPDFObjectHandle::copyObject1(
int n = array->getNItems();
for (int i = 0; i < n; ++i) {
items.push_back(array->getItem(i));
- if ((!first_level_only) && !items.back().isIndirect()) {
- items.back().copyObject1(visited, first_level_only);
+ if (!items.back().isIndirect()) {
+ items.back().copyObject1(visited);
}
}
new_obj = QPDF_Array::create(items);
@@ -2268,8 +2266,8 @@ QPDFObjectHandle::copyObject1(
auto dict = asDictionary();
for (auto const& key: getKeys()) {
items[key] = dict->getKey(key);
- if ((!first_level_only) && !items[key].isIndirect()) {
- items[key].copyObject1(visited, first_level_only);
+ if (!items[key].isIndirect()) {
+ items[key].copyObject1(visited);
}
}
new_obj = QPDF_Dictionary::create(items);