From 56f1b411feeb58b55e92ee77daffaa49c51b7dad Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Tue, 17 May 2022 18:28:50 -0400 Subject: 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. --- libqpdf/NNTree.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'libqpdf/NNTree.cc') 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 -- cgit v1.2.3-70-g09d2