diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-03-12 18:29:02 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-03-12 20:22:13 +0100 |
commit | c3e45f10e003e540710c18967ef9b29210a795e4 (patch) | |
tree | 159eee110e6cc59e735c305528fd49b1157522ee /package | |
parent | e43d5f26de3c5a366bdb3c5ed83d30e725870855 (diff) |
package: convert OStorage::m_pData to std::unique_ptr
Change-Id: I875432aeb98072882df1f228d9fcf43c6027e8d5
Diffstat (limited to 'package')
-rw-r--r-- | package/source/xstor/xstorage.cxx | 8 | ||||
-rw-r--r-- | package/source/xstor/xstorage.hxx | 3 |
2 files changed, 5 insertions, 6 deletions
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 254c2b2b0489..80dc555457f2 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -1887,7 +1887,7 @@ OStorage::OStorage( uno::Reference< io::XInputStream > xInputStream, : m_pImpl( new OStorage_Impl( xInputStream, nMode, xProperties, xContext, nStorageType ) ) { m_pImpl->m_pAntiImpl = this; - m_pData = new StorInternalData_Impl( m_pImpl->m_rMutexRef, m_pImpl->m_bIsRoot, m_pImpl->m_nStorageType, false ); + m_pData.reset(new StorInternalData_Impl( m_pImpl->m_rMutexRef, m_pImpl->m_bIsRoot, m_pImpl->m_nStorageType, false)); } OStorage::OStorage( uno::Reference< io::XStream > xStream, @@ -1898,7 +1898,7 @@ OStorage::OStorage( uno::Reference< io::XStream > xStream, : m_pImpl( new OStorage_Impl( xStream, nMode, xProperties, xContext, nStorageType ) ) { m_pImpl->m_pAntiImpl = this; - m_pData = new StorInternalData_Impl( m_pImpl->m_rMutexRef, m_pImpl->m_bIsRoot, m_pImpl->m_nStorageType, false ); + m_pData.reset(new StorInternalData_Impl( m_pImpl->m_rMutexRef, m_pImpl->m_bIsRoot, m_pImpl->m_nStorageType, false)); } OStorage::OStorage( OStorage_Impl* pImpl, bool bReadOnlyWrap ) @@ -1907,7 +1907,7 @@ OStorage::OStorage( OStorage_Impl* pImpl, bool bReadOnlyWrap ) // this call can be done only from OStorage_Impl implementation to create child storage OSL_ENSURE( m_pImpl && m_pImpl->m_rMutexRef.Is(), "The provided pointer & mutex MUST NOT be empty!\n" ); - m_pData = new StorInternalData_Impl( m_pImpl->m_rMutexRef, m_pImpl->m_bIsRoot, m_pImpl->m_nStorageType, bReadOnlyWrap ); + m_pData.reset(new StorInternalData_Impl( m_pImpl->m_rMutexRef, m_pImpl->m_bIsRoot, m_pImpl->m_nStorageType, bReadOnlyWrap)); OSL_ENSURE( ( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) == embed::ElementModes::WRITE || m_pData->m_bReadOnlyWrap, @@ -1948,8 +1948,6 @@ OStorage::~OStorage() delete m_pData->m_pTypeCollection; m_pData->m_pTypeCollection = NULL; } - - delete m_pData; } } diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx index d15b39bd86a8..c8688ecf9faf 100644 --- a/package/source/xstor/xstorage.hxx +++ b/package/source/xstor/xstorage.hxx @@ -51,6 +51,7 @@ #include "mutexholder.hxx" #include <list> +#include <memory> namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; @@ -293,7 +294,7 @@ class OStorage : public ::com::sun::star::lang::XTypeProvider , public ::cppu::OWeakObject { OStorage_Impl* m_pImpl; - StorInternalData_Impl* m_pData; + std::unique_ptr<StorInternalData_Impl> m_pData; protected: |