From b3e6d445cbf73da2b00062c3f639c2453041ee41 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 24 Jul 2022 15:42:23 -0400 Subject: Tweak "AndGet" mutator functions again Remove any ambiguity around whether old or new value is being returned. --- libqpdf/QPDFPageObjectHelper.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libqpdf/QPDFPageObjectHelper.cc') diff --git a/libqpdf/QPDFPageObjectHelper.cc b/libqpdf/QPDFPageObjectHelper.cc index 96a8ce69..9ad75cf8 100644 --- a/libqpdf/QPDFPageObjectHelper.cc +++ b/libqpdf/QPDFPageObjectHelper.cc @@ -595,7 +595,7 @@ QPDFPageObjectHelper::removeUnreferencedResourcesHelper( for (auto const& iter: to_filter) { QPDFObjectHandle dict = resources.getKey(iter); if (dict.isDictionary()) { - dict = resources.replaceKeyAndGet(iter, dict.shallowCopy()); + dict = resources.replaceKeyAndGetNew(iter, dict.shallowCopy()); rdicts.push_back(dict); auto keys = dict.getKeys(); known_names.insert(keys.begin(), keys.end()); @@ -1110,8 +1110,8 @@ QPDFPageObjectHelper::copyAnnotations( afdh->addAndRenameFormFields(new_fields); auto annots = this->oh.getKey("/Annots"); if (!annots.isArray()) { - annots = - this->oh.replaceKeyAndGet("/Annots", QPDFObjectHandle::newArray()); + annots = this->oh.replaceKeyAndGetNew( + "/Annots", QPDFObjectHandle::newArray()); } for (auto const& annot: new_annots) { annots.appendItem(annot); -- cgit v1.2.3-54-g00ecf