From 05f8281f4624dd9eea2b5dd0671a6f721633302b Mon Sep 17 00:00:00 2001 From: m-holger Date: Sun, 23 Mar 2025 13:52:57 +0000 Subject: [PATCH] In QPDFWriter::PipelinePopper remove special handling of Pl_Buffer --- include/qpdf/QPDFWriter.hh | 7 ++----- libqpdf/QPDFWriter.cc | 10 ---------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/include/qpdf/QPDFWriter.hh b/include/qpdf/QPDFWriter.hh index 31dddc6..748a945 100644 --- a/include/qpdf/QPDFWriter.hh +++ b/include/qpdf/QPDFWriter.hh @@ -462,23 +462,20 @@ class QPDFWriter friend class QPDFWriter; public: - PipelinePopper(QPDFWriter* qw, std::shared_ptr* bp = nullptr) : - qw(qw), - bp(bp) + PipelinePopper(QPDFWriter* qw) : + qw(qw) { } ~PipelinePopper(); private: QPDFWriter* qw; - std::shared_ptr* bp; std::string stack_id; }; unsigned int bytesNeeded(long long n); void writeBinary(unsigned long long val, unsigned int bytes); void writeString(std::string_view str); - void writeBuffer(std::shared_ptr&); void writeStringQDF(std::string_view str); void writeStringNoQDF(std::string_view str); void writePad(size_t nspaces); diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc index 9d0b869..793ea2e 100644 --- a/libqpdf/QPDFWriter.cc +++ b/libqpdf/QPDFWriter.cc @@ -881,12 +881,6 @@ QPDFWriter::writeString(std::string_view str) } void -QPDFWriter::writeBuffer(std::shared_ptr& b) -{ - m->pipeline->write(b->getBuffer(), b->getSize()); -} - -void QPDFWriter::writeStringQDF(std::string_view str) { if (m->qdf_mode) { @@ -956,10 +950,6 @@ QPDFWriter::PipelinePopper::~PipelinePopper() qw->m->md5_pipeline = nullptr; } qw->m->pipeline_stack.pop_back(); - auto* buf = dynamic_cast(p); - if (bp && buf) { - *bp = buf->getBufferSharedPointer(); - } delete p; } qw->m->pipeline = dynamic_cast(qw->m->pipeline_stack.back()); -- libgit2 0.21.4