mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-03 15:17:29 +00:00
Explicitly deprecate old name/number tree constructors
Use C++14 [[deprecated]] tag
This commit is contained in:
parent
1b3f84f967
commit
2538d84413
@ -55,6 +55,7 @@ class QPDFNameTreeObjectHelper: public QPDFObjectHelper
|
||||
// QPDFNameTreeObjectHelper constructed in this way can't be
|
||||
// modified or repaired and will silently ignore problems in the
|
||||
// structure.
|
||||
[[deprecated]]
|
||||
QPDF_DLL
|
||||
QPDFNameTreeObjectHelper(QPDFObjectHandle);
|
||||
|
||||
|
@ -52,6 +52,7 @@ class QPDFNumberTreeObjectHelper: public QPDFObjectHelper
|
||||
// QPDFNumberTreeObjectHelper constructed in this way can't be
|
||||
// modified or repaired and will silently ignore problems in the
|
||||
// structure.
|
||||
[[deprecated]]
|
||||
QPDF_DLL
|
||||
QPDFNumberTreeObjectHelper(QPDFObjectHandle);
|
||||
|
||||
|
@ -1856,8 +1856,18 @@ void runtest(int n, char const* filename1, char const* arg2)
|
||||
|
||||
// Exercise deprecated API until qpdf 11
|
||||
std::cout << "/Bad1: deprecated API" << std::endl;
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable: 4996)
|
||||
#endif
|
||||
#if (defined(__GNUC__) || defined(__clang__))
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
auto bad1 = QPDFNumberTreeObjectHelper(
|
||||
pdf.getTrailer().getKey("/Bad1"));
|
||||
#if (defined(__GNUC__) || defined(__clang__))
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
assert(bad1.begin() == bad1.end());
|
||||
|
||||
std::cout << "/Bad1" << std::endl;
|
||||
@ -2058,8 +2068,18 @@ void runtest(int n, char const* filename1, char const* arg2)
|
||||
|
||||
// Exercise deprecated API until qpdf 11
|
||||
std::cout << "/Bad1: deprecated API" << std::endl;
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable: 4996)
|
||||
#endif
|
||||
#if (defined(__GNUC__) || defined(__clang__))
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
auto bad1 = QPDFNameTreeObjectHelper(
|
||||
pdf.getTrailer().getKey("/Bad1"));
|
||||
#if (defined(__GNUC__) || defined(__clang__))
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
try
|
||||
{
|
||||
bad1.find("G", true);
|
||||
|
Loading…
Reference in New Issue
Block a user