loplugin:useuniqueptr in PathSettings

Change-Id: Ib0e6e293e10473b7ada3919f781cfd05ef78749c
Reviewed-on: https://gerrit.libreoffice.org/53761
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2018-05-02 14:23:11 +02:00
parent ea33ae5ef0
commit 30bb90fc2a

View file

@ -170,7 +170,7 @@ private:
/** helper to listen for configuration changes without ownership cycle problems */
css::uno::Reference< css::util::XChangesListener > m_xCfgNewListener;
::cppu::OPropertyArrayHelper* m_pPropHelp;
std::unique_ptr<::cppu::OPropertyArrayHelper> m_pPropHelp;
public:
@ -468,8 +468,7 @@ void SAL_CALL PathSettings::disposing()
m_xCfgNew.clear();
m_xCfgNewListener.clear();
delete m_pPropHelp;
m_pPropHelp = nullptr;
m_pPropHelp.reset();
}
css::uno::Any SAL_CALL PathSettings::queryInterface( const css::uno::Type& _rType )
@ -1099,8 +1098,7 @@ void PathSettings::impl_rebuildPropertyDescriptor()
++i;
}
delete m_pPropHelp;
m_pPropHelp = new ::cppu::OPropertyArrayHelper(m_lPropDesc, false); // false => not sorted ... must be done inside helper
m_pPropHelp.reset(new ::cppu::OPropertyArrayHelper(m_lPropDesc, false)); // false => not sorted ... must be done inside helper
// <- SAFE
}