From a48eae3c86ad62dd80d175b592acf826c32e4d19 Mon Sep 17 00:00:00 2001 From: m-holger Date: Wed, 16 Jul 2025 12:23:30 +0100 Subject: [PATCH] Refactor `QPDFWriter` pipeline stack activation to utilize `pl::Link` and streamline `linearization pass1` logic when writing pass1 file --- libqpdf/QPDFWriter.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc index 2310afd..3fe9de8 100644 --- a/libqpdf/QPDFWriter.cc +++ b/libqpdf/QPDFWriter.cc @@ -2751,8 +2751,11 @@ QPDFWriter::writeLinearized() if (pass == 1) { if (!m->lin_pass1_filename.empty()) { lin_pass1_file = QUtil::safe_fopen(m->lin_pass1_filename.c_str(), "wb"); - m->pipeline_stack.push(new Pl_StdioFile("linearization pass1", lin_pass1_file)); - m->pipeline_stack.activate(pp_pass1); + m->pipeline_stack.activate( + pp_pass1, + std::make_unique( + nullptr, + std::make_unique("linearization pass1", lin_pass1_file))); } else { m->pipeline_stack.activate(pp_pass1, true); } -- libgit2 0.21.4