Commit c365a26e9df84b196eb015a0c82557fd12484da1
1 parent
dc059560
Revert "Remove QPDFObjectHandle::replaceOrRemoveKey"
This reverts commit dc059560e73e0b373a6e54e71b07e3af4b692cb4. I changed my mind. There's no harm in leaving it deprecated for a release cycle.
Showing
4 changed files
with
11 additions
and
13 deletions
ChangeLog
| 1 | -2022-04-30 Jay Berkenbilt <ejb@ql.org> | ||
| 2 | - | ||
| 3 | - * Remove QPDFObjectHandle::replaceOrRemoveKey. Call replaceKey | ||
| 4 | - instead. Its functionality is identical. Note: usually I would | ||
| 5 | - deprecate this for a release cycle, but the release of qpdf 11 | ||
| 6 | - will require virtually all users to touch their source code, so it | ||
| 7 | - actually seems better to just break this now than to put it off, | ||
| 8 | - particularly since the fix so trivial. | ||
| 9 | - | ||
| 10 | 2022-04-29 Jay Berkenbilt <ejb@ql.org> | 1 | 2022-04-29 Jay Berkenbilt <ejb@ql.org> |
| 11 | 2 | ||
| 12 | * QPDFObjectHandle: for the methods insertItem, appendItem, | 3 | * QPDFObjectHandle: for the methods insertItem, appendItem, |
include/qpdf/QPDFObjectHandle.hh
| @@ -1068,6 +1068,10 @@ class QPDFObjectHandle | @@ -1068,6 +1068,10 @@ class QPDFObjectHandle | ||
| 1068 | QPDF_DLL | 1068 | QPDF_DLL |
| 1069 | QPDFObjectHandle removeKeyAndGet(std::string const& key); | 1069 | QPDFObjectHandle removeKeyAndGet(std::string const& key); |
| 1070 | 1070 | ||
| 1071 | + // ABI: Remove in qpdf 12 | ||
| 1072 | + [[deprecated("use replaceKey -- it does the same thing")]] QPDF_DLL void | ||
| 1073 | + replaceOrRemoveKey(std::string const& key, QPDFObjectHandle const&); | ||
| 1074 | + | ||
| 1071 | // Methods for stream objects | 1075 | // Methods for stream objects |
| 1072 | QPDF_DLL | 1076 | QPDF_DLL |
| 1073 | QPDFObjectHandle getDict(); | 1077 | QPDFObjectHandle getDict(); |
libqpdf/QPDFObjectHandle.cc
| @@ -1334,6 +1334,13 @@ QPDFObjectHandle::removeKeyAndGet(std::string const& key) | @@ -1334,6 +1334,13 @@ QPDFObjectHandle::removeKeyAndGet(std::string const& key) | ||
| 1334 | return result; | 1334 | return result; |
| 1335 | } | 1335 | } |
| 1336 | 1336 | ||
| 1337 | +void | ||
| 1338 | +QPDFObjectHandle::replaceOrRemoveKey( | ||
| 1339 | + std::string const& key, QPDFObjectHandle const& value) | ||
| 1340 | +{ | ||
| 1341 | + replaceKey(key, value); | ||
| 1342 | +} | ||
| 1343 | + | ||
| 1337 | // Stream accessors | 1344 | // Stream accessors |
| 1338 | QPDFObjectHandle | 1345 | QPDFObjectHandle |
| 1339 | QPDFObjectHandle::getDict() | 1346 | QPDFObjectHandle::getDict() |
manual/release-notes.rst
| @@ -64,10 +64,6 @@ For a detailed list of changes, please see the file | @@ -64,10 +64,6 @@ For a detailed list of changes, please see the file | ||
| 64 | 64 | ||
| 65 | - API: breaking changes | 65 | - API: breaking changes |
| 66 | 66 | ||
| 67 | - - Remove ``QPDFObjectHandle::replaceOrRemoveKey``. This does the | ||
| 68 | - same thing as ``QPDFObjectHandle::replaceKey``. Just call | ||
| 69 | - ``replaceKey`` instead. | ||
| 70 | - | ||
| 71 | - Remove | 67 | - Remove |
| 72 | ``QPDFAcroFormDocumentHelper::copyFieldsFromForeignPage``. This | 68 | ``QPDFAcroFormDocumentHelper::copyFieldsFromForeignPage``. This |
| 73 | method never worked and only did something in qpdf version | 69 | method never worked and only did something in qpdf version |