diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-05 14:03:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-05 14:45:08 +0100 |
commit | 8a7a93b3f24b95bfcffc25e58f9e43c7be4cc1f1 (patch) | |
tree | 651da01917f615025542de018b6c6c92f37a770d /sot/source/unoolestorage/xolesimplestorage.cxx | |
parent | 5509d639d0b245415f647690619de5a5163ca620 (diff) |
loplugin:flatten in sot
Change-Id: I66ca5113054862f1549a3d7c27da70cf4f5fc308
Reviewed-on: https://gerrit.libreoffice.org/67403
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sot/source/unoolestorage/xolesimplestorage.cxx')
-rw-r--r-- | sot/source/unoolestorage/xolesimplestorage.cxx | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx b/sot/source/unoolestorage/xolesimplestorage.cxx index c61b643811f0..1725a990f3d3 100644 --- a/sot/source/unoolestorage/xolesimplestorage.cxx +++ b/sot/source/unoolestorage/xolesimplestorage.cxx @@ -154,27 +154,27 @@ OLESimpleStorage::~OLESimpleStorage() void OLESimpleStorage::UpdateOriginal_Impl() { - if ( !m_bNoTemporaryCopy ) - { - uno::Reference< io::XSeekable > xSeek( m_xStream, uno::UNO_QUERY_THROW ); - xSeek->seek( 0 ); + if ( m_bNoTemporaryCopy ) + return; - uno::Reference< io::XSeekable > xTempSeek( m_xTempStream, uno::UNO_QUERY_THROW ); - sal_Int64 nPos = xTempSeek->getPosition(); - xTempSeek->seek( 0 ); + uno::Reference< io::XSeekable > xSeek( m_xStream, uno::UNO_QUERY_THROW ); + xSeek->seek( 0 ); - uno::Reference< io::XInputStream > xTempInp = m_xTempStream->getInputStream(); - uno::Reference< io::XOutputStream > xOutputStream = m_xStream->getOutputStream(); - if ( !xTempInp.is() || !xOutputStream.is() ) - throw uno::RuntimeException(); + uno::Reference< io::XSeekable > xTempSeek( m_xTempStream, uno::UNO_QUERY_THROW ); + sal_Int64 nPos = xTempSeek->getPosition(); + xTempSeek->seek( 0 ); - uno::Reference< io::XTruncate > xTrunc( xOutputStream, uno::UNO_QUERY_THROW ); - xTrunc->truncate(); + uno::Reference< io::XInputStream > xTempInp = m_xTempStream->getInputStream(); + uno::Reference< io::XOutputStream > xOutputStream = m_xStream->getOutputStream(); + if ( !xTempInp.is() || !xOutputStream.is() ) + throw uno::RuntimeException(); - ::comphelper::OStorageHelper::CopyInputToOutput( xTempInp, xOutputStream ); - xOutputStream->flush(); - xTempSeek->seek( nPos ); - } + uno::Reference< io::XTruncate > xTrunc( xOutputStream, uno::UNO_QUERY_THROW ); + xTrunc->truncate(); + + ::comphelper::OStorageHelper::CopyInputToOutput( xTempInp, xOutputStream ); + xOutputStream->flush(); + xTempSeek->seek( nPos ); } |