Commit 05f8281f4624dd9eea2b5dd0671a6f721633302b

Authored by m-holger
1 parent 953ed4b8

In QPDFWriter::PipelinePopper remove special handling of Pl_Buffer

Also, remove redundant QPDFWriter::writeBuffer.
include/qpdf/QPDFWriter.hh
... ... @@ -462,23 +462,20 @@ class QPDFWriter
462 462 friend class QPDFWriter;
463 463  
464 464 public:
465   - PipelinePopper(QPDFWriter* qw, std::shared_ptr<Buffer>* bp = nullptr) :
466   - qw(qw),
467   - bp(bp)
  465 + PipelinePopper(QPDFWriter* qw) :
  466 + qw(qw)
468 467 {
469 468 }
470 469 ~PipelinePopper();
471 470  
472 471 private:
473 472 QPDFWriter* qw;
474   - std::shared_ptr<Buffer>* bp;
475 473 std::string stack_id;
476 474 };
477 475  
478 476 unsigned int bytesNeeded(long long n);
479 477 void writeBinary(unsigned long long val, unsigned int bytes);
480 478 void writeString(std::string_view str);
481   - void writeBuffer(std::shared_ptr<Buffer>&);
482 479 void writeStringQDF(std::string_view str);
483 480 void writeStringNoQDF(std::string_view str);
484 481 void writePad(size_t nspaces);
... ...
libqpdf/QPDFWriter.cc
... ... @@ -881,12 +881,6 @@ QPDFWriter::writeString(std::string_view str)
881 881 }
882 882  
883 883 void
884   -QPDFWriter::writeBuffer(std::shared_ptr<Buffer>& b)
885   -{
886   - m->pipeline->write(b->getBuffer(), b->getSize());
887   -}
888   -
889   -void
890 884 QPDFWriter::writeStringQDF(std::string_view str)
891 885 {
892 886 if (m->qdf_mode) {
... ... @@ -956,10 +950,6 @@ QPDFWriter::PipelinePopper::~PipelinePopper()
956 950 qw->m->md5_pipeline = nullptr;
957 951 }
958 952 qw->m->pipeline_stack.pop_back();
959   - auto* buf = dynamic_cast<Pl_Buffer*>(p);
960   - if (bp && buf) {
961   - *bp = buf->getBufferSharedPointer();
962   - }
963 953 delete p;
964 954 }
965 955 qw->m->pipeline = dynamic_cast<Pl_Count*>(qw->m->pipeline_stack.back());
... ...