From a68703b07e928be0eeb909c0e777e13e88cbf86d Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 9 Apr 2022 14:35:56 -0400 Subject: Replace PointerHolder with std::shared_ptr in library sources only (patrepl and cleanpatch are my own utilities) patrepl s/PointerHolder/std::shared_ptr/g {include,libqpdf}/qpdf/*.hh patrepl s/PointerHolder/std::shared_ptr/g libqpdf/*.cc patrepl s/make_pointer_holder/std::make_shared/g libqpdf/*.cc patrepl s/make_array_pointer_holder/QUtil::make_shared_array/g libqpdf/*.cc patrepl s,qpdf/std::shared_ptr,qpdf/PointerHolder, **/*.cc **/*.hh git restore include/qpdf/PointerHolder.hh cleanpatch ./format-code --- libqpdf/QPDFAcroFormDocumentHelper.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libqpdf/QPDFAcroFormDocumentHelper.cc') diff --git a/libqpdf/QPDFAcroFormDocumentHelper.cc b/libqpdf/QPDFAcroFormDocumentHelper.cc index 276fc542..8a01f556 100644 --- a/libqpdf/QPDFAcroFormDocumentHelper.cc +++ b/libqpdf/QPDFAcroFormDocumentHelper.cc @@ -772,7 +772,7 @@ QPDFAcroFormDocumentHelper::adjustAppearanceStream( QTC::TC("qpdf", "QPDFAcroFormDocumentHelper AP parse error"); } auto rr = new ResourceReplacer(dr_map, rf.getNamesByResourceType()); - auto tf = PointerHolder(rr); + auto tf = std::shared_ptr(rr); stream.addTokenFilter(tf); } catch (std::exception& e) { // No way to reproduce in test suite right now since error @@ -792,13 +792,13 @@ QPDFAcroFormDocumentHelper::transformAnnotations( QPDF* from_qpdf, QPDFAcroFormDocumentHelper* from_afdh) { - PointerHolder afdhph; + std::shared_ptr afdhph; if (!from_qpdf) { // Assume these are from the same QPDF. from_qpdf = &this->qpdf; from_afdh = this; } else if ((from_qpdf != &this->qpdf) && (!from_afdh)) { - afdhph = make_pointer_holder(*from_qpdf); + afdhph = std::make_shared(*from_qpdf); from_afdh = afdhph.get(); } bool foreign = (from_qpdf != &this->qpdf); -- cgit v1.2.3-54-g00ecf