From 0c7c7e4ba485fd39f5b6d41fa2924c607d2eeda0 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 25 Jun 2022 13:55:45 -0400 Subject: Track whether certain page modifying methods have been called We need to know whether pushInheritedAttributesToPage or getAllPages have been called when generating JSON output. When reading the JSON back in, we have to call the same methods so that object numbers will line up properly. --- include/qpdf/QPDF.hh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index 52bc3579..f0c9f6b4 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -709,6 +709,11 @@ class QPDF QPDF_DLL std::vector const& getAllPages(); + QPDF_DLL + bool everCalledGetAllPages() const; + QPDF_DLL + bool everPushedInheritedAttributesToPages() const; + // These methods, given a page object or its object/generation // number, returns the 0-based index into the array returned by // getAllPages() for that page. An exception is thrown if the page @@ -1690,6 +1695,8 @@ class QPDF std::vector all_pages; std::map pageobj_to_pages_pos; bool pushed_inherited_attributes_to_pages; + bool ever_pushed_inherited_attributes_to_pages; + bool ever_called_get_all_pages; std::vector warnings; std::map object_copiers; std::shared_ptr copied_streams; -- cgit v1.2.3-54-g00ecf