Commit afe96a94ebc6cda4411fe34da02ca7b9e8f7a6d8
1 parent
263fc288
Remove more deprecated API
Showing
5 changed files
with
17 additions
and
70 deletions
include/qpdf/QPDFObject.hh
| ... | ... | @@ -23,58 +23,14 @@ |
| 23 | 23 | #ifndef QPDFOBJECT_OLD_HH |
| 24 | 24 | #define QPDFOBJECT_OLD_HH |
| 25 | 25 | |
| 26 | -// ********************************************************************** | |
| 27 | -// | |
| 28 | -// This file is for backward compatibility. The header file for the | |
| 29 | -// internal QPDFObject class (not part of the public API) is in | |
| 30 | -// QPDFObject_private.hh (not installed). | |
| 31 | -// | |
| 32 | -// ********************************************************************** | |
| 33 | - | |
| 34 | -// ABI: in qpdf 12, leave this file in place and have it generate an | |
| 35 | -// error. This is to prevent someone from being able to successfully | |
| 36 | -// include this file and get a copy from a previous installation | |
| 37 | -// thereby accidentally creating sources depend on having an older | |
| 38 | -// version installed. When enough time has passed, this file can be | |
| 39 | -// removed, and libqpdf/qpdf/QPDFObject_private.hh can be renamed to | |
| 40 | -// libqpdf/qpdf/QPDFObject.hh. | |
| 41 | - | |
| 42 | -#ifndef QPDF_OBJECT_NOWARN | |
| 43 | -// ABI: remove this file in qpdf 12 | |
| 44 | -# warning "QPDFObject.hh is deprecated see comments in QPDFObject.hh" | |
| 45 | -#endif | |
| 46 | - | |
| 47 | -#include <qpdf/Constants.h> | |
| 48 | -class QPDFObject | |
| 49 | -{ | |
| 50 | - public: | |
| 51 | - // This file and these symbols will be removed in QPDF 12. Instead | |
| 52 | - // of including this header, include <qpdf/Constants.h>. Replace | |
| 53 | - // `QPDFObject::ot_` with `::ot_` in your code. | |
| 54 | - | |
| 55 | - // Prior to qpdf 10.5, qpdf_object_type_e was | |
| 56 | - // QPDFObject::object_type_e but was moved to make it accessible | |
| 57 | - // to the C API. The code below is for backward compatibility | |
| 58 | - // until qpdf 12. | |
| 59 | - typedef enum qpdf_object_type_e object_type_e; | |
| 60 | - static constexpr object_type_e ot_uninitialized = ::ot_uninitialized; | |
| 61 | - static constexpr object_type_e ot_reserved = ::ot_reserved; | |
| 62 | - static constexpr object_type_e ot_null = ::ot_null; | |
| 63 | - static constexpr object_type_e ot_boolean = ::ot_boolean; | |
| 64 | - static constexpr object_type_e ot_integer = ::ot_integer; | |
| 65 | - static constexpr object_type_e ot_real = ::ot_real; | |
| 66 | - static constexpr object_type_e ot_string = ::ot_string; | |
| 67 | - static constexpr object_type_e ot_name = ::ot_name; | |
| 68 | - static constexpr object_type_e ot_array = ::ot_array; | |
| 69 | - static constexpr object_type_e ot_dictionary = ::ot_dictionary; | |
| 70 | - static constexpr object_type_e ot_stream = ::ot_stream; | |
| 71 | - static constexpr object_type_e ot_operator = ::ot_operator; | |
| 72 | - static constexpr object_type_e ot_inlineimage = ::ot_inlineimage; | |
| 73 | - | |
| 74 | - private: | |
| 75 | - QPDFObject() = delete; | |
| 76 | - QPDFObject(QPDFObject const&) = delete; | |
| 77 | - QPDFObject& operator=(QPDFObject const&) = delete; | |
| 78 | -}; | |
| 26 | +// This file exists so that if anyone still includes <qpdf/QPDFObject.hh> | |
| 27 | +// and has been ignoring the warning, they will get an error. This reduces | |
| 28 | +// the chances of someone accidentally including the file from an | |
| 29 | +// installed, old version. The QPDFObject API, which is not part of the | |
| 30 | +// public API, is defined in QPDFObject_private.hh. Prior to qpdf 11, this | |
| 31 | +// file was exposed for some constants. This error was introduced in qpdf | |
| 32 | +// 12. | |
| 33 | + | |
| 34 | +#error "QPDFObject.hh is no longer a valid QPDF Header file" | |
| 79 | 35 | |
| 80 | 36 | #endif // QPDFOBJECT_OLD_HH | ... | ... |
include/qpdf/QPDFObjectHandle.hh
| ... | ... | @@ -963,10 +963,6 @@ class QPDFObjectHandle |
| 963 | 963 | QPDF_DLL |
| 964 | 964 | QPDFObjectHandle removeKeyAndGetOld(std::string const& key); |
| 965 | 965 | |
| 966 | - // ABI: Remove in qpdf 12 | |
| 967 | - [[deprecated("use replaceKey -- it does the same thing")]] QPDF_DLL void | |
| 968 | - replaceOrRemoveKey(std::string const& key, QPDFObjectHandle const&); | |
| 969 | - | |
| 970 | 966 | // Methods for stream objects |
| 971 | 967 | QPDF_DLL |
| 972 | 968 | QPDFObjectHandle getDict() const; | ... | ... |
libqpdf/QPDFObjectHandle.cc
| ... | ... | @@ -1262,12 +1262,6 @@ QPDFObjectHandle::removeKeyAndGetOld(std::string const& key) |
| 1262 | 1262 | return result; |
| 1263 | 1263 | } |
| 1264 | 1264 | |
| 1265 | -void | |
| 1266 | -QPDFObjectHandle::replaceOrRemoveKey(std::string const& key, QPDFObjectHandle const& value) | |
| 1267 | -{ | |
| 1268 | - replaceKey(key, value); | |
| 1269 | -} | |
| 1270 | - | |
| 1271 | 1265 | // Stream accessors |
| 1272 | 1266 | |
| 1273 | 1267 | QPDFObjectHandle | ... | ... |
manual/release-notes.rst
| ... | ... | @@ -15,6 +15,14 @@ more detail. |
| 15 | 15 | 12.0.0: not yet released |
| 16 | 16 | - API: breaking changes |
| 17 | 17 | |
| 18 | + - The header file ``qpdf/QPDFObject.hh`` now generates an error if | |
| 19 | + included. This is to prevent that includes it from accidentally | |
| 20 | + working because an old version is installed somewhere on the | |
| 21 | + system. | |
| 22 | + | |
| 23 | + - ``QPDFObjectHandle::replaceOrRemoveKey`` has been removed since | |
| 24 | + it was identical to ``QPDFObjectHandle::replaceKey``. | |
| 25 | + | |
| 18 | 26 | - ``JSON::checkDictionaryKeySeen`` has been removed. If ``JSON::parse`` |
| 19 | 27 | encounters duplicate keys the last value is silently accepted instead |
| 20 | 28 | of throwing a runtime error. | ... | ... |
qpdf/test_driver.cc
| ... | ... | @@ -34,9 +34,6 @@ |
| 34 | 34 | #include <map> |
| 35 | 35 | #include <sstream> |
| 36 | 36 | |
| 37 | -#define QPDF_OBJECT_NOWARN | |
| 38 | -#include <qpdf/QPDFObject.hh> | |
| 39 | - | |
| 40 | 37 | static char const* whoami = nullptr; |
| 41 | 38 | |
| 42 | 39 | void |
| ... | ... | @@ -3489,10 +3486,6 @@ runtest(int n, char const* filename1, char const* arg2) |
| 3489 | 3486 | QPDFObjectHandle uninitialized; |
| 3490 | 3487 | assert(uninitialized.getTypeCode() == ::ot_uninitialized); |
| 3491 | 3488 | assert(strcmp(uninitialized.getTypeName(), "uninitialized") == 0); |
| 3492 | - | |
| 3493 | - // ABI: until QPDF 12, spot check deprecated constants | |
| 3494 | - assert(QPDFObject::ot_dictionary == ::ot_dictionary); | |
| 3495 | - assert(QPDFObject::ot_uninitialized == ::ot_uninitialized); | |
| 3496 | 3489 | } |
| 3497 | 3490 | |
| 3498 | 3491 | QPDF pdf; | ... | ... |