From c99d883447cc37b017d8c2fce95877177095d301 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 25 Jul 2018 13:49:07 +0200 Subject: loplugin:useuniqueptr in DocxExport Change-Id: I8d98585fa759070a82bf5738d20b018ec9fbabf0 Reviewed-on: https://gerrit.libreoffice.org/58016 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/filter/ww8/docxexport.cxx | 5 ++--- sw/source/filter/ww8/docxexport.hxx | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'sw/source') diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index c3bf421ef793..82125851f571 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -511,7 +511,7 @@ void DocxExport::ExportDocument_Impl() InitStyles(); // init sections - m_pSections = new MSWordSections( *this ); + m_pSections.reset(new MSWordSections( *this )); // Make sure images are counted from one, even when exporting multiple documents. oox::drawingml::DrawingML::ResetCounters(); @@ -541,8 +541,7 @@ void DocxExport::ExportDocument_Impl() m_aLinkedTextboxesHelper.clear(); //final cleanup delete m_pStyles; m_pStyles = nullptr; - delete m_pSections; - m_pSections = nullptr; + m_pSections.reset(); } void DocxExport::AppendSection( const SwPageDesc *pPageDesc, const SwSectionFormat* pFormat, sal_uLong nLnNum ) diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 12813a33f507..8361f81e2691 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -82,7 +82,7 @@ class DocxExport : public MSWordExportBase std::unique_ptr m_pAttrOutput; /// Sections/headers/footers - MSWordSections *m_pSections; + std::unique_ptr m_pSections; /// Header counter. sal_Int32 m_nHeaders; -- cgit