From 070b38bf25ca298c0048241d6f0d2e973d6003d1 Mon Sep 17 00:00:00 2001 From: m-holger Date: Sun, 5 Oct 2025 12:25:25 +0100 Subject: [PATCH] Move `reconstructed_xref` to `QPDF::Doc` and update references --- include/qpdf/QPDF.hh | 1 - libqpdf/NNTree.cc | 2 +- libqpdf/QPDFParser.cc | 2 +- libqpdf/qpdf/QPDF_private.hh | 6 ++++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index 9774ca1..16e8f72 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -791,7 +791,6 @@ class QPDF class Doc; - inline bool reconstructed_xref() const; inline Doc& doc(); // For testing only -- do not add to DLL diff --git a/libqpdf/NNTree.cc b/libqpdf/NNTree.cc index c00a472..51c0cc5 100644 --- a/libqpdf/NNTree.cc +++ b/libqpdf/NNTree.cc @@ -30,7 +30,7 @@ void NNTreeImpl::warn(QPDFObjectHandle const& node, std::string const& msg) { qpdf.warn(qpdf_e_damaged_pdf, get_description(node), 0, msg); - if (++error_count > 5 && qpdf.reconstructed_xref()) { + if (++error_count > 5 && qpdf.doc().reconstructed_xref()) { error(node, "too many errors - giving up"); } } diff --git a/libqpdf/QPDFParser.cc b/libqpdf/QPDFParser.cc index c4ceee1..0428995 100644 --- a/libqpdf/QPDFParser.cc +++ b/libqpdf/QPDFParser.cc @@ -79,7 +79,7 @@ QPDFParser::parse_content( true, 0, 0, - context && context->reconstructed_xref()) + context && context->doc().reconstructed_xref()) .parse(empty, true); } diff --git a/libqpdf/qpdf/QPDF_private.hh b/libqpdf/qpdf/QPDF_private.hh index 06157de..e45d57d 100644 --- a/libqpdf/qpdf/QPDF_private.hh +++ b/libqpdf/qpdf/QPDF_private.hh @@ -364,6 +364,8 @@ class QPDF::Doc { } + bool reconstructed_xref() const; + QPDFAcroFormDocumentHelper& acroform() { @@ -523,9 +525,9 @@ class QPDF::Doc::Resolver }; inline bool -QPDF::reconstructed_xref() const +QPDF::Doc::reconstructed_xref() const { - return m->reconstructed_xref; + return m.reconstructed_xref; } inline QPDF::Doc& -- libgit2 0.21.4