summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-01 11:17:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-05 16:08:16 +0100
commitfe40724421b8c1f197871702a477772d2a633209 (patch)
treebd7f39ba8ef1506ec5626105088e3c503efcedce /lotuswordpro
parent2affed9bfd72628549df3049ed9f6e6a30fdb5b8 (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')
-rw-r--r--lotuswordpro/inc/xfilter/xfconfigmanager.hxx7
-rw-r--r--lotuswordpro/source/filter/xfilter/xfconfigmanager.cxx21
2 files changed, 10 insertions, 18 deletions
diff --git a/lotuswordpro/inc/xfilter/xfconfigmanager.hxx b/lotuswordpro/inc/xfilter/xfconfigmanager.hxx
index ded25e948ff1..d33779a64007 100644
--- a/lotuswordpro/inc/xfilter/xfconfigmanager.hxx
+++ b/lotuswordpro/inc/xfilter/xfconfigmanager.hxx
@@ -65,6 +65,7 @@
#include <xfilter/xffootnoteconfig.hxx>
#include <xfilter/xfendnoteconfig.hxx>
#include <xfilter/xfdefs.hxx>
+#include <memory>
/**
* @brief
@@ -100,9 +101,9 @@ public:
virtual void ToXml(IXFStream *pStrm) override;
private:
- XFLineNumberConfig *m_pLineNumberConfig;
- XFFootnoteConfig *m_pFootnoteConfig;
- XFEndnoteConfig *m_pEndnoteConfig;
+ std::unique_ptr<XFLineNumberConfig> m_pLineNumberConfig;
+ std::unique_ptr<XFFootnoteConfig> m_pFootnoteConfig;
+ std::unique_ptr<XFEndnoteConfig> m_pEndnoteConfig;
};
#endif
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: */