From 2c6a3e977798f7c0b0e38d19bda2094ff4c7547f Mon Sep 17 00:00:00 2001 From: m-holger Date: Fri, 19 Sep 2025 15:55:02 +0100 Subject: [PATCH] Refactor `QPDFJob::Selection`: remove redundant `qpdf` member, update related logic in `handlePageSpecs` and `new_selection`, and simplify page processing. --- libqpdf/QPDFJob.cc | 5 ++--- libqpdf/qpdf/QPDFJob_private.hh | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/libqpdf/QPDFJob.cc b/libqpdf/QPDFJob.cc index 79d4fbb..0c506a0 100644 --- a/libqpdf/QPDFJob.cc +++ b/libqpdf/QPDFJob.cc @@ -2416,7 +2416,6 @@ QPDFJob::Inputs::process_all() // Read original pages from the PDF, and parse the page range associated with this // occurrence of the file. auto const& file_spec = files[selection.filename]; - selection.qpdf = file_spec.qpdf; if (selection.range.empty()) { selection.selected_pages.reserve(static_cast(file_spec.n_pages)); for (int i = 1; i <= file_spec.n_pages; ++i) { @@ -2533,8 +2532,8 @@ QPDFJob::handlePageSpecs(QPDF& pdf) if (input.cfis) { input.cfis->stayOpen(true); } - auto& pldh = selection.qpdf->page_labels(); - auto& other_afdh = selection.qpdf->acroform(); + auto& pldh = input.qpdf->page_labels(); + auto& other_afdh = input.qpdf->acroform(); if (pldh.hasPageLabels()) { any_page_labels = true; } diff --git a/libqpdf/qpdf/QPDFJob_private.hh b/libqpdf/qpdf/QPDFJob_private.hh index 5f6367f..2d4118d 100644 --- a/libqpdf/qpdf/QPDFJob_private.hh +++ b/libqpdf/qpdf/QPDFJob_private.hh @@ -20,7 +20,6 @@ struct QPDFJob::Selection Selection(QPDFJob::Selection const& other, int page) : filename(other.filename), // range and password are no longer required when this constructor is called. - qpdf(other.qpdf), selected_pages({page}) { } @@ -30,7 +29,6 @@ struct QPDFJob::Selection std::string filename; std::string password; std::string range; - QPDF* qpdf; std::vector selected_pages; }; -- libgit2 0.21.4