Revert "Remove QPDFObjectHandle::replaceOrRemoveKey"

This reverts commit dc059560e7.

I changed my mind. There's no harm in leaving it deprecated for a
release cycle.
This commit is contained in:
Jay Berkenbilt 2022-04-30 14:14:41 -04:00
parent dc059560e7
commit c365a26e9d
4 changed files with 11 additions and 13 deletions

View File

@ -1,12 +1,3 @@
2022-04-30 Jay Berkenbilt <ejb@ql.org>
* Remove QPDFObjectHandle::replaceOrRemoveKey. Call replaceKey
instead. Its functionality is identical. Note: usually I would
deprecate this for a release cycle, but the release of qpdf 11
will require virtually all users to touch their source code, so it
actually seems better to just break this now than to put it off,
particularly since the fix so trivial.
2022-04-29 Jay Berkenbilt <ejb@ql.org>
* QPDFObjectHandle: for the methods insertItem, appendItem,

View File

@ -1068,6 +1068,10 @@ class QPDFObjectHandle
QPDF_DLL
QPDFObjectHandle removeKeyAndGet(std::string const& key);
// ABI: Remove in qpdf 12
[[deprecated("use replaceKey -- it does the same thing")]] QPDF_DLL void
replaceOrRemoveKey(std::string const& key, QPDFObjectHandle const&);
// Methods for stream objects
QPDF_DLL
QPDFObjectHandle getDict();

View File

@ -1334,6 +1334,13 @@ QPDFObjectHandle::removeKeyAndGet(std::string const& key)
return result;
}
void
QPDFObjectHandle::replaceOrRemoveKey(
std::string const& key, QPDFObjectHandle const& value)
{
replaceKey(key, value);
}
// Stream accessors
QPDFObjectHandle
QPDFObjectHandle::getDict()

View File

@ -64,10 +64,6 @@ For a detailed list of changes, please see the file
- API: breaking changes
- Remove ``QPDFObjectHandle::replaceOrRemoveKey``. This does the
same thing as ``QPDFObjectHandle::replaceKey``. Just call
``replaceKey`` instead.
- Remove
``QPDFAcroFormDocumentHelper::copyFieldsFromForeignPage``. This
method never worked and only did something in qpdf version