diff options
Diffstat (limited to 'package')
-rw-r--r-- | package/source/xstor/switchpersistencestream.cxx | 18 | ||||
-rw-r--r-- | package/source/xstor/switchpersistencestream.hxx | 2 |
2 files changed, 8 insertions, 12 deletions
diff --git a/package/source/xstor/switchpersistencestream.cxx b/package/source/xstor/switchpersistencestream.cxx index 5d96d626d9d3..b85be26f7eb6 100644 --- a/package/source/xstor/switchpersistencestream.cxx +++ b/package/source/xstor/switchpersistencestream.cxx @@ -112,9 +112,9 @@ void SwitchablePersistenceStream::SwitchPersistenceTo( const uno::Reference< io: CloseAll_Impl(); - m_pStreamData = new SPStreamData_Impl( false, + m_pStreamData.reset( new SPStreamData_Impl( false, xNewTruncate, xNewSeekable, xNewInStream, xNewOutStream, - bInOpen, bOutOpen ); + bInOpen, bOutOpen ) ); } void SwitchablePersistenceStream::SwitchPersistenceTo( const uno::Reference< io::XInputStream >& xInputStream ) @@ -145,9 +145,9 @@ void SwitchablePersistenceStream::SwitchPersistenceTo( const uno::Reference< io: CloseAll_Impl(); - m_pStreamData = new SPStreamData_Impl( true, + m_pStreamData.reset( new SPStreamData_Impl( true, xNewTruncate, xNewSeekable, xInputStream, xNewOutStream, - bInOpen, bOutOpen ); + bInOpen, bOutOpen ) ); } @@ -189,18 +189,14 @@ void SwitchablePersistenceStream::CopyAndSwitchPersistenceTo( const uno::Referen CloseAll_Impl(); - m_pStreamData = new SPStreamData_Impl( false, + m_pStreamData.reset( new SPStreamData_Impl( false, xTargetTruncate, xTargetSeek, xTargetInStream, xTargetOutStream, - bInOpen, bOutOpen ); + bInOpen, bOutOpen ) ); } void SwitchablePersistenceStream::CloseAll_Impl() { - if ( m_pStreamData ) - { - delete m_pStreamData; - m_pStreamData = nullptr; - } + m_pStreamData.reset(); } // css::io::XStream diff --git a/package/source/xstor/switchpersistencestream.hxx b/package/source/xstor/switchpersistencestream.hxx index a42ca023e227..f52d9bd4415e 100644 --- a/package/source/xstor/switchpersistencestream.hxx +++ b/package/source/xstor/switchpersistencestream.hxx @@ -54,7 +54,7 @@ class SwitchablePersistenceStream const css::uno::Reference< css::uno::XComponentContext > m_xContext; - SPStreamData_Impl* m_pStreamData; + std::unique_ptr<SPStreamData_Impl> m_pStreamData; void CloseAll_Impl(); |