Commit 070b38bf25ca298c0048241d6f0d2e973d6003d1

Authored by m-holger
1 parent 0885a160

Move `reconstructed_xref` to `QPDF::Doc` and update references

Relocate `reconstructed_xref` to `QPDF::Doc` for improved encapsulation of cross-reference reconstruction state. Adjust all references to use the updated placement.
include/qpdf/QPDF.hh
... ... @@ -791,7 +791,6 @@ class QPDF
791 791  
792 792 class Doc;
793 793  
794   - inline bool reconstructed_xref() const;
795 794 inline Doc& doc();
796 795  
797 796 // For testing only -- do not add to DLL
... ...
libqpdf/NNTree.cc
... ... @@ -30,7 +30,7 @@ void
30 30 NNTreeImpl::warn(QPDFObjectHandle const& node, std::string const& msg)
31 31 {
32 32 qpdf.warn(qpdf_e_damaged_pdf, get_description(node), 0, msg);
33   - if (++error_count > 5 && qpdf.reconstructed_xref()) {
  33 + if (++error_count > 5 && qpdf.doc().reconstructed_xref()) {
34 34 error(node, "too many errors - giving up");
35 35 }
36 36 }
... ...
libqpdf/QPDFParser.cc
... ... @@ -79,7 +79,7 @@ QPDFParser::parse_content(
79 79 true,
80 80 0,
81 81 0,
82   - context && context->reconstructed_xref())
  82 + context && context->doc().reconstructed_xref())
83 83 .parse(empty, true);
84 84 }
85 85  
... ...
libqpdf/qpdf/QPDF_private.hh
... ... @@ -364,6 +364,8 @@ class QPDF::Doc
364 364 {
365 365 }
366 366  
  367 + bool reconstructed_xref() const;
  368 +
367 369 QPDFAcroFormDocumentHelper&
368 370 acroform()
369 371 {
... ... @@ -523,9 +525,9 @@ class QPDF::Doc::Resolver
523 525 };
524 526  
525 527 inline bool
526   -QPDF::reconstructed_xref() const
  528 +QPDF::Doc::reconstructed_xref() const
527 529 {
528   - return m->reconstructed_xref;
  530 + return m.reconstructed_xref;
529 531 }
530 532  
531 533 inline QPDF::Doc&
... ...