summaryrefslogtreecommitdiff
path: root/svl/source/fsstor
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-10 14:54:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-11 14:50:11 +0100
commitccf986a77a4b218964033e70601ae220eb2c9b13 (patch)
tree08dc4cfd477a6723e8e389046fef9af67ca753a9 /svl/source/fsstor
parent9d6b6fc96718389d7bf5f84a9e00fc5bb275c265 (diff)
loplugin:useuniqueptr in svl
Change-Id: I2fdb63517349474d90cb17ad2bd667f30840e83d Reviewed-on: https://gerrit.libreoffice.org/47727 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl/source/fsstor')
-rw-r--r--svl/source/fsstor/fsstorage.cxx18
1 files changed, 5 insertions, 13 deletions
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx
index a4bfba7d192e..c899bfe357c4 100644
--- a/svl/source/fsstor/fsstorage.cxx
+++ b/svl/source/fsstor/fsstorage.cxx
@@ -72,8 +72,8 @@ struct FSStorage_Impl
::ucbhelper::Content m_aContent;
sal_Int32 m_nMode;
- ::comphelper::OInterfaceContainerHelper2* m_pListenersContainer; // list of listeners
- ::cppu::OTypeCollection* m_pTypeCollection;
+ std::unique_ptr<::comphelper::OInterfaceContainerHelper2> m_pListenersContainer; // list of listeners
+ std::unique_ptr<::cppu::OTypeCollection> m_pTypeCollection;
uno::Reference< uno::XComponentContext > m_xContext;
@@ -89,19 +89,11 @@ struct FSStorage_Impl
OSL_ENSURE( !m_aURL.isEmpty(), "The URL must not be empty" );
}
- ~FSStorage_Impl();
-
// Copy assignment is forbidden and not implemented.
FSStorage_Impl (const FSStorage_Impl &) = delete;
FSStorage_Impl & operator= (const FSStorage_Impl &) = delete;
};
-FSStorage_Impl::~FSStorage_Impl()
-{
- delete m_pListenersContainer;
- delete m_pTypeCollection;
-}
-
FSStorage::FSStorage( const ::ucbhelper::Content& aContent,
sal_Int32 nMode,
uno::Reference< uno::XComponentContext > const & xContext )
@@ -276,11 +268,11 @@ uno::Sequence< uno::Type > SAL_CALL FSStorage::getTypes()
if ( m_pImpl->m_pTypeCollection == nullptr )
{
- m_pImpl->m_pTypeCollection = new ::cppu::OTypeCollection
+ m_pImpl->m_pTypeCollection.reset(new ::cppu::OTypeCollection
( cppu::UnoType<lang::XTypeProvider>::get()
, cppu::UnoType<embed::XStorage>::get()
, cppu::UnoType<embed::XHierarchicalStorageAccess>::get()
- , cppu::UnoType<beans::XPropertySet>::get());
+ , cppu::UnoType<beans::XPropertySet>::get()) );
}
}
@@ -1056,7 +1048,7 @@ void SAL_CALL FSStorage::addEventListener(
throw lang::DisposedException();
if ( !m_pImpl->m_pListenersContainer )
- m_pImpl->m_pListenersContainer = new ::comphelper::OInterfaceContainerHelper2( m_aMutex );
+ m_pImpl->m_pListenersContainer.reset(new ::comphelper::OInterfaceContainerHelper2( m_aMutex ));
m_pImpl->m_pListenersContainer->addInterface( xListener );
}