Commit a48eae3c86ad62dd80d175b592acf826c32e4d19

Authored by m-holger
1 parent 46cb7392

Refactor `QPDFWriter` pipeline stack activation to utilize `pl::Link` and stream…

…line `linearization pass1` logic  when writing pass1 file
Showing 1 changed file with 5 additions and 2 deletions
libqpdf/QPDFWriter.cc
... ... @@ -2751,8 +2751,11 @@ QPDFWriter::writeLinearized()
2751 2751 if (pass == 1) {
2752 2752 if (!m->lin_pass1_filename.empty()) {
2753 2753 lin_pass1_file = QUtil::safe_fopen(m->lin_pass1_filename.c_str(), "wb");
2754   - m->pipeline_stack.push(new Pl_StdioFile("linearization pass1", lin_pass1_file));
2755   - m->pipeline_stack.activate(pp_pass1);
  2754 + m->pipeline_stack.activate(
  2755 + pp_pass1,
  2756 + std::make_unique<pl::Link>(
  2757 + nullptr,
  2758 + std::make_unique<Pl_StdioFile>("linearization pass1", lin_pass1_file)));
2756 2759 } else {
2757 2760 m->pipeline_stack.activate(pp_pass1, true);
2758 2761 }
... ...