diff options
Diffstat (limited to 'package/source/xstor/switchpersistencestream.cxx')
-rw-r--r-- | package/source/xstor/switchpersistencestream.cxx | 18 |
1 files changed, 7 insertions, 11 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 |