summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-16 14:55:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-17 08:11:12 +0100
commit56379beb1ea55c1262382039aba2dbb335e92b67 (patch)
tree017757cc513b463d2e756a211e6bc1cbb7af495c /sw
parent49e1d1f0482969520f8ac64d5ff5fbba5f7c00bf (diff)
loplugin:useuniqueptr in DocxExport
Change-Id: Iedc5823d23102569ed32a2a0df4c3c60feaca1f6 Reviewed-on: https://gerrit.libreoffice.org/44823 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/docxexport.cxx18
-rw-r--r--sw/source/filter/ww8/docxexport.hxx9
2 files changed, 10 insertions, 17 deletions
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index cc9b518ff1a5..2cab3777a532 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -480,7 +480,7 @@ void DocxExport::OutputDML(uno::Reference<drawing::XShape> const & xShape)
nNamespace = XML_wpg;
else if (xServiceInfo->supportsService("com.sun.star.drawing.GraphicObjectShape"))
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);
}
@@ -1557,28 +1557,20 @@ DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCur
SetFS(m_pDocumentFS);
// 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
- m_pAttrOutput = new DocxAttributeOutput( *this, m_pDocumentFS, m_pDrawingML );
+ m_pAttrOutput.reset(new DocxAttributeOutput( *this, m_pDocumentFS, m_pDrawingML.get() ));
// 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
- m_pSdrExport = new DocxSdrExport( *this, m_pDocumentFS, m_pDrawingML );
+ m_pSdrExport.reset(new DocxSdrExport( *this, m_pDocumentFS, m_pDrawingML.get() ));
}
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()
diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx
index df65f3d39e93..b553ba3f2601 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -27,6 +27,7 @@
#include <rtl/ustring.hxx>
#include <cstdio>
+#include <memory>
#include <vector>
#include <boost/optional.hpp>
#include <ndole.hxx>
@@ -75,10 +76,10 @@ class DocxExport : public MSWordExportBase
::sax_fastparser::FSHelperPtr mpFS;
/// Access to the DrawingML writer.
- oox::drawingml::DrawingML *m_pDrawingML;
+ std::unique_ptr<oox::drawingml::DrawingML> m_pDrawingML;
/// Attribute output for document.
- DocxAttributeOutput *m_pAttrOutput;
+ std::unique_ptr<DocxAttributeOutput> m_pAttrOutput;
/// Sections/headers/footers
MSWordSections *m_pSections;
@@ -99,10 +100,10 @@ class DocxExport : public MSWordExportBase
sal_Int32 m_nHeadersFootersInSection;
/// Exporter of the VML shapes.
- oox::vml::VMLExport *m_pVMLExport;
+ std::unique_ptr<oox::vml::VMLExport> m_pVMLExport;
/// Exporter of drawings.
- DocxSdrExport* m_pSdrExport;
+ std::unique_ptr<DocxSdrExport> m_pSdrExport;
/// If the result will be a .docm file or not.
bool m_bDocm;