2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-01 01:40:51 +00:00

Dangling ref test: show new object ID

This commit is contained in:
Jay Berkenbilt 2022-11-25 13:30:22 -05:00
parent 5489f1d8d6
commit f6367bbada
3 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,4 @@
new object: 11 0 R
all objects
1 0 R
2 0 R

View File

@ -1,3 +1,4 @@
new object: 7 0 R
all objects
1 0 R
2 0 R

View File

@ -2062,8 +2062,10 @@ test_53(QPDF& pdf, char const* arg2)
{
// Test get all objects and dangling ref handling
QPDFObjectHandle root = pdf.getRoot();
root.replaceKey(
"/Q1", pdf.makeIndirectObject(QPDFObjectHandle::newString("potato")));
auto new_obj =
pdf.makeIndirectObject(QPDFObjectHandle::newString("potato"));
root.replaceKey("/Q1", new_obj);
std::cout << "new object: " << new_obj.unparse() << std::endl;
std::cout << "all objects" << std::endl;
for (auto& obj: pdf.getAllObjects()) {
std::cout << obj.unparse() << std::endl;