Kaydet (Commit) 56379beb authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in DocxExport

Change-Id: Iedc5823d23102569ed32a2a0df4c3c60feaca1f6
Reviewed-on: https://gerrit.libreoffice.org/44823Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 49e1d1f0
...@@ -480,7 +480,7 @@ void DocxExport::OutputDML(uno::Reference<drawing::XShape> const & xShape) ...@@ -480,7 +480,7 @@ void DocxExport::OutputDML(uno::Reference<drawing::XShape> const & xShape)
nNamespace = XML_wpg; nNamespace = XML_wpg;
else if (xServiceInfo->supportsService("com.sun.star.drawing.GraphicObjectShape")) else if (xServiceInfo->supportsService("com.sun.star.drawing.GraphicObjectShape"))
nNamespace = XML_pic; nNamespace = XML_pic;
oox::drawingml::ShapeExport aExport(nNamespace, m_pAttrOutput->GetSerializer(), nullptr, m_pFilter, oox::drawingml::DOCUMENT_DOCX, m_pAttrOutput); oox::drawingml::ShapeExport aExport(nNamespace, m_pAttrOutput->GetSerializer(), nullptr, m_pFilter, oox::drawingml::DOCUMENT_DOCX, m_pAttrOutput.get());
aExport.WriteShape(xShape); aExport.WriteShape(xShape);
} }
...@@ -1557,28 +1557,20 @@ DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCur ...@@ -1557,28 +1557,20 @@ DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCur
SetFS(m_pDocumentFS); SetFS(m_pDocumentFS);
// the DrawingML access // the DrawingML access
m_pDrawingML = new oox::drawingml::DrawingML(m_pDocumentFS, m_pFilter, oox::drawingml::DOCUMENT_DOCX); m_pDrawingML.reset(new oox::drawingml::DrawingML(m_pDocumentFS, m_pFilter, oox::drawingml::DOCUMENT_DOCX));
// the attribute output for the document // the attribute output for the document
m_pAttrOutput = new DocxAttributeOutput( *this, m_pDocumentFS, m_pDrawingML ); m_pAttrOutput.reset(new DocxAttributeOutput( *this, m_pDocumentFS, m_pDrawingML.get() ));
// the related VMLExport // the related VMLExport
m_pVMLExport = new VMLExport( m_pDocumentFS, m_pAttrOutput ); m_pVMLExport.reset(new VMLExport( m_pDocumentFS, m_pAttrOutput.get() ));
// the related drawing export // the related drawing export
m_pSdrExport = new DocxSdrExport( *this, m_pDocumentFS, m_pDrawingML ); m_pSdrExport.reset(new DocxSdrExport( *this, m_pDocumentFS, m_pDrawingML.get() ));
} }
DocxExport::~DocxExport() DocxExport::~DocxExport()
{ {
delete m_pSdrExport;
m_pSdrExport = nullptr;
delete m_pVMLExport;
m_pVMLExport = nullptr;
delete m_pAttrOutput;
m_pAttrOutput = nullptr;
delete m_pDrawingML;
m_pDrawingML = nullptr;
} }
DocxSettingsData::DocxSettingsData() DocxSettingsData::DocxSettingsData()
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <cstdio> #include <cstdio>
#include <memory>
#include <vector> #include <vector>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <ndole.hxx> #include <ndole.hxx>
...@@ -75,10 +76,10 @@ class DocxExport : public MSWordExportBase ...@@ -75,10 +76,10 @@ class DocxExport : public MSWordExportBase
::sax_fastparser::FSHelperPtr mpFS; ::sax_fastparser::FSHelperPtr mpFS;
/// Access to the DrawingML writer. /// Access to the DrawingML writer.
oox::drawingml::DrawingML *m_pDrawingML; std::unique_ptr<oox::drawingml::DrawingML> m_pDrawingML;
/// Attribute output for document. /// Attribute output for document.
DocxAttributeOutput *m_pAttrOutput; std::unique_ptr<DocxAttributeOutput> m_pAttrOutput;
/// Sections/headers/footers /// Sections/headers/footers
MSWordSections *m_pSections; MSWordSections *m_pSections;
...@@ -99,10 +100,10 @@ class DocxExport : public MSWordExportBase ...@@ -99,10 +100,10 @@ class DocxExport : public MSWordExportBase
sal_Int32 m_nHeadersFootersInSection; sal_Int32 m_nHeadersFootersInSection;
/// Exporter of the VML shapes. /// Exporter of the VML shapes.
oox::vml::VMLExport *m_pVMLExport; std::unique_ptr<oox::vml::VMLExport> m_pVMLExport;
/// Exporter of drawings. /// Exporter of drawings.
DocxSdrExport* m_pSdrExport; std::unique_ptr<DocxSdrExport> m_pSdrExport;
/// If the result will be a .docm file or not. /// If the result will be a .docm file or not.
bool m_bDocm; bool m_bDocm;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment