diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-05 09:30:03 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-05 09:59:30 +0200 |
commit | 3fdbf5935e0aff6350e861e868c7e0a12dd1bc8f (patch) | |
tree | c2d5a74b8aa8d51a7a3906e390ce77f7fce6ead1 /svl | |
parent | 1c3d3ffa81d1a451b5a694cff022df3c5c94ba8e (diff) |
use uno::Reference::set method instead of assignment
Change-Id: I6cb508e392d5e194c80fc6d0927c86414e4ab05b
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/fsstor/fsstorage.cxx | 11 | ||||
-rw-r--r-- | svl/source/fsstor/ostreamcontainer.cxx | 18 | ||||
-rw-r--r-- | svl/source/misc/sharecontrolfile.cxx | 10 | ||||
-rw-r--r-- | svl/source/misc/strmadpt.cxx | 3 | ||||
-rw-r--r-- | svl/source/passwordcontainer/passwordcontainer.cxx | 2 |
5 files changed, 21 insertions, 23 deletions
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx index cbe3664b9c15..86ba08f7218e 100644 --- a/svl/source/fsstor/fsstorage.cxx +++ b/svl/source/fsstor/fsstorage.cxx @@ -410,7 +410,7 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::openStreamElement( if ( pStream ) { if ( !pStream->GetError() ) - xResult = uno::Reference < io::XStream >( new ::utl::OStreamWrapper( *pStream ) ); + xResult.set( new ::utl::OStreamWrapper( *pStream ) ); else delete pStream; } @@ -540,11 +540,10 @@ uno::Reference< embed::XStorage > SAL_CALL FSStorage::openStorageElement( throw io::IOException(); // there is no such folder ::ucbhelper::Content aResultContent( aFolderURL.GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv, comphelper::getProcessComponentContext() ); - xResult = uno::Reference< embed::XStorage >( - static_cast< OWeakObject* >( new FSStorage( aResultContent, - nStorageMode, - m_pImpl->m_xContext ) ), - uno::UNO_QUERY ); + xResult.set( static_cast< OWeakObject* >( new FSStorage( aResultContent, + nStorageMode, + m_pImpl->m_xContext ) ), + uno::UNO_QUERY ); } catch( embed::InvalidStorageException& ) { diff --git a/svl/source/fsstor/ostreamcontainer.cxx b/svl/source/fsstor/ostreamcontainer.cxx index 48fafcde9460..5ed416ee3a33 100644 --- a/svl/source/fsstor/ostreamcontainer.cxx +++ b/svl/source/fsstor/ostreamcontainer.cxx @@ -37,20 +37,20 @@ OFSStreamContainer::OFSStreamContainer( const uno::Reference < io::XStream >& xS if ( !m_xStream.is() ) throw uno::RuntimeException(); - m_xSeekable = uno::Reference< io::XSeekable >( xStream, uno::UNO_QUERY ); + m_xSeekable.set( xStream, uno::UNO_QUERY ); m_xInputStream = xStream->getInputStream(); m_xOutputStream = xStream->getOutputStream(); - m_xTruncate = uno::Reference< io::XTruncate >( m_xOutputStream, uno::UNO_QUERY ); - m_xAsyncOutputMonitor = uno::Reference< io::XAsyncOutputMonitor >( m_xOutputStream, uno::UNO_QUERY ); + m_xTruncate.set( m_xOutputStream, uno::UNO_QUERY ); + m_xAsyncOutputMonitor.set( m_xOutputStream, uno::UNO_QUERY ); } catch( uno::Exception& ) { - m_xStream = uno::Reference< io::XStream >(); - m_xSeekable = uno::Reference< io::XSeekable >(); - m_xInputStream = uno::Reference< io::XInputStream >(); - m_xOutputStream = uno::Reference< io::XOutputStream >(); - m_xTruncate = uno::Reference< io::XTruncate >(); - m_xAsyncOutputMonitor = uno::Reference< io::XAsyncOutputMonitor >(); + m_xStream.clear(); + m_xSeekable.clear(); + m_xInputStream.clear(); + m_xOutputStream.clear(); + m_xTruncate.clear(); + m_xAsyncOutputMonitor.clear(); } } diff --git a/svl/source/misc/sharecontrolfile.cxx b/svl/source/misc/sharecontrolfile.cxx index 009eceac7276..aa11ebce8b49 100644 --- a/svl/source/misc/sharecontrolfile.cxx +++ b/svl/source/misc/sharecontrolfile.cxx @@ -144,11 +144,11 @@ void ShareControlFile::Close() catch( uno::Exception& ) {} - m_xStream = uno::Reference< io::XStream >(); - m_xInputStream = uno::Reference< io::XInputStream >(); - m_xOutputStream = uno::Reference< io::XOutputStream >(); - m_xSeekable = uno::Reference< io::XSeekable >(); - m_xTruncate = uno::Reference< io::XTruncate >(); + m_xStream.clear(); + m_xInputStream.clear(); + m_xOutputStream.clear(); + m_xSeekable.clear(); + m_xTruncate.clear(); m_aUsersData.clear(); } } diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index 399a4cc03efd..a661bfa32755 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.cxx @@ -222,8 +222,7 @@ bool SvInputStream::open() SetError(ERRCODE_IO_INVALIDDEVICE); return false; } - m_xSeekable - = uno::Reference< io::XSeekable >(m_xStream, uno::UNO_QUERY); + m_xSeekable.set(m_xStream, uno::UNO_QUERY); if (!m_xSeekable.is()) m_pPipe = new SvDataPipe_Impl; } diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index bd9bd61cd897..4aae066a5b82 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -395,7 +395,7 @@ PasswordContainer::PasswordContainer( const Reference<XMultiServiceFactory>& xSe // m_pStorageFile->Notify() can be called ::osl::MutexGuard aGuard( mMutex ); - mComponent = Reference< XComponent >( xServiceFactory, UNO_QUERY ); + mComponent.set( xServiceFactory, UNO_QUERY ); mComponent->addEventListener( this ); m_pStorageFile = new StorageItem( this, OUString("Office.Common/Passwords") ); |