aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/NNTree.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-05-18 00:28:50 +0200
committerJay Berkenbilt <ejb@ql.org>2022-05-20 15:16:25 +0200
commit56f1b411feeb58b55e92ee77daffaa49c51b7dad (patch)
tree4337c0ada5ccc979f89af9aecf0873c087329c05 /libqpdf/NNTree.cc
parent7e7a9c437982b7ede2af9cd0b12b3e47b4bc3a3d (diff)
downloadqpdf-56f1b411feeb58b55e92ee77daffaa49c51b7dad.tar.zst
Back out fluent QPDFObjectHandle methods. Keep the andGet methods.
I decided these were confusing and inconsistent with how JSON works. They muddle the API rather than improving it.
Diffstat (limited to 'libqpdf/NNTree.cc')
-rw-r--r--libqpdf/NNTree.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/libqpdf/NNTree.cc b/libqpdf/NNTree.cc
index bfeb15a1..a5df209d 100644
--- a/libqpdf/NNTree.cc
+++ b/libqpdf/NNTree.cc
@@ -208,8 +208,9 @@ NNTreeIterator::resetLimits(
}
}
if (first.isInitialized() && last.isInitialized()) {
- auto limits =
- QPDFObjectHandle::newArray().appendItem(first).appendItem(last);
+ auto limits = QPDFObjectHandle::newArray();
+ limits.appendItem(first);
+ limits.appendItem(last);
auto olimits = node.getKey("/Limits");
if (olimits.isArray() && (olimits.getArrayNItems() == 2)) {
auto ofirst = olimits.getArrayItem(0);
@@ -340,10 +341,9 @@ NNTreeIterator::split(
first_node.replaceKey(key, first_half);
QPDFObjectHandle new_kids = QPDFObjectHandle::newArray();
new_kids.appendItem(first_node);
- to_split
- .removeKey("/Limits") // already shouldn't be there for root
- .removeKey(impl.details.itemsKey())
- .replaceKey("/Kids", new_kids);
+ to_split.removeKey("/Limits"); // already shouldn't be there for root
+ to_split.removeKey(impl.details.itemsKey());
+ to_split.replaceKey("/Kids", new_kids);
if (is_leaf) {
QTC::TC("qpdf", "NNTree split root + leaf");
this->node = first_node;
@@ -884,8 +884,9 @@ NNTreeImpl::repair()
for (auto const& i: *this) {
repl.insert(i.first, i.second);
}
- this->oh.replaceKey("/Kids", new_node.getKey("/Kids"))
- .replaceKey(details.itemsKey(), new_node.getKey(details.itemsKey()));
+ this->oh.replaceKey("/Kids", new_node.getKey("/Kids"));
+ this->oh.replaceKey(
+ details.itemsKey(), new_node.getKey(details.itemsKey()));
}
NNTreeImpl::iterator