diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-01 11:17:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-05 16:08:16 +0100 |
commit | fe40724421b8c1f197871702a477772d2a633209 (patch) | |
tree | bd7f39ba8ef1506ec5626105088e3c503efcedce /lotuswordpro/source | |
parent | 2affed9bfd72628549df3049ed9f6e6a30fdb5b8 (diff) |
loplugin:useuniqueptr in XFConfigManager
Change-Id: Ia442d2dba8c6fdf577c6cdc950d518cc863d6e0e
Reviewed-on: https://gerrit.libreoffice.org/50741
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xfconfigmanager.cxx | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/lotuswordpro/source/filter/xfilter/xfconfigmanager.cxx b/lotuswordpro/source/filter/xfilter/xfconfigmanager.cxx index 00d2b3c12fa7..8592a0604723 100644 --- a/lotuswordpro/source/filter/xfilter/xfconfigmanager.cxx +++ b/lotuswordpro/source/filter/xfilter/xfconfigmanager.cxx @@ -69,43 +69,34 @@ XFConfigManager::XFConfigManager() XFConfigManager::~XFConfigManager() { - delete m_pEndnoteConfig; - delete m_pFootnoteConfig; - delete m_pLineNumberConfig; } void XFConfigManager::SetLineNumberConfig(XFLineNumberConfig *pLNConfig) { - delete m_pLineNumberConfig; - m_pLineNumberConfig = pLNConfig; + m_pLineNumberConfig.reset( pLNConfig ); } void XFConfigManager::SetFootnoteConfig(XFFootnoteConfig *pFNConfig) { - delete m_pFootnoteConfig; - m_pFootnoteConfig = pFNConfig; + m_pFootnoteConfig.reset( pFNConfig ); } void XFConfigManager::SetEndnoteConfig(XFEndnoteConfig *pENConfig) { - delete m_pEndnoteConfig; - m_pEndnoteConfig = pENConfig; + m_pEndnoteConfig.reset( pENConfig ); } void XFConfigManager::ToXml(IXFStream *pStrm) { if( m_pLineNumberConfig ) - AddStyle(m_pLineNumberConfig); + AddStyle(m_pLineNumberConfig.release()); if( m_pFootnoteConfig ) - AddStyle(m_pFootnoteConfig); + AddStyle(m_pFootnoteConfig.release()); if( m_pEndnoteConfig ) - AddStyle(m_pEndnoteConfig); + AddStyle(m_pEndnoteConfig.release()); XFStyleContainer::ToXml(pStrm); XFStyleContainer::Reset(); - m_pLineNumberConfig = nullptr; - m_pFootnoteConfig = nullptr; - m_pEndnoteConfig = nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |