From cd0c07dc0c3300e51d0fac5d99f70783bb2d5ffb Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 11 Aug 2022 20:31:45 +0100 Subject: Use simplified XmlDocumentSerializer interface --- gentoobrowse-api/service/xsltStreamSerializer.cpp | 10 +++------- gentoobrowse-api/service/xsltStreamSerializer.h | 3 --- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/gentoobrowse-api/service/xsltStreamSerializer.cpp b/gentoobrowse-api/service/xsltStreamSerializer.cpp index cebae7b..acb5750 100644 --- a/gentoobrowse-api/service/xsltStreamSerializer.cpp +++ b/gentoobrowse-api/service/xsltStreamSerializer.cpp @@ -36,20 +36,16 @@ namespace Gentoo { } XsltStreamSerializer::XsltStreamSerializer(IceTray::Mail::EmailPtr e, xsltStylesheet * ss) : - Slicer::XmlDocumentSerializer(doc), mail(std::move(e)), doc(nullptr), stylesheet(ss) + mail(std::move(e)), stylesheet(ss) { } - XsltStreamSerializer::~XsltStreamSerializer() - { - delete doc; - } - void XsltStreamSerializer::Serialize(Slicer::ModelPartForRootPtr mp) { Slicer::XmlDocumentSerializer::Serialize(mp); - auto result = std::shared_ptr(xsltApplyStylesheet(stylesheet, doc->cobj(), nullptr), xmlFreeDoc); + auto result = std::unique_ptr( + xsltApplyStylesheet(stylesheet, doc.cobj(), nullptr), xmlFreeDoc); if (!result) { throw xmlpp::exception("Failed to apply XSL transform"); } diff --git a/gentoobrowse-api/service/xsltStreamSerializer.h b/gentoobrowse-api/service/xsltStreamSerializer.h index f13f774..71f5e3f 100644 --- a/gentoobrowse-api/service/xsltStreamSerializer.h +++ b/gentoobrowse-api/service/xsltStreamSerializer.h @@ -14,8 +14,6 @@ namespace Gentoo { class DLL_PUBLIC XsltStreamSerializer : public Slicer::XmlDocumentSerializer { public: XsltStreamSerializer(IceTray::Mail::EmailPtr, xsltStylesheet *); - ~XsltStreamSerializer() override; - SPECIAL_MEMBERS_DELETE(XsltStreamSerializer); void Serialize(Slicer::ModelPartForRootPtr mp) override; @@ -24,7 +22,6 @@ namespace Gentoo { static IceTray::Mime::BasicPartPtr getText(xmlDoc *); IceTray::Mail::EmailPtr mail; - xmlpp::Document * doc; xsltStylesheet * stylesheet; }; } -- cgit v1.2.3