diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-23 09:35:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-24 08:33:07 +0200 |
commit | 94e3568d3d1aa399d13c53f53a699c49da3e929c (patch) | |
tree | 8fb83bf58ca353884bde5cedda0ff2749d57f99e /sw/source/filter/xml/xmltble.cxx | |
parent | dba5dccfc5606ed6c6c888524460c9546143aaef (diff) |
loplugin:useuniqueptr in SwXMLExport
Change-Id: Id0354b73b0ff14b6a168b672f25483c07988494e
Reviewed-on: https://gerrit.libreoffice.org/57864
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/xml/xmltble.cxx')
-rw-r--r-- | sw/source/filter/xml/xmltble.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index 4077ce852723..9dbc82d0e92a 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -569,7 +569,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines, // pass 1: calculate columns SwXMLTableLines_Impl *pLines = new SwXMLTableLines_Impl( rLines ); if( !m_pTableLines ) - m_pTableLines = new SwXMLTableLinesCache_Impl; + m_pTableLines.reset(new SwXMLTableLinesCache_Impl); m_pTableLines->push_back( pLines ); @@ -995,10 +995,7 @@ void SwXMLExport::ExportTableLines( const SwTableLines& rLines, m_pTableLines->erase( it ); if( m_pTableLines->empty() ) - { - delete m_pTableLines ; - m_pTableLines = nullptr; - } + m_pTableLines.reset(); // pass 2: export columns const SwXMLTableColumns_Impl& rCols = pLines->GetColumns(); @@ -1201,7 +1198,7 @@ void SwXMLExport::DeleteTableLines() for (SwXMLTableLines_Impl* p : *m_pTableLines) delete p; m_pTableLines->clear(); - delete m_pTableLines; + m_pTableLines.reset(); } } |