From 9af0abebfd61641c9d028505caa864cdf898e35b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 26 May 2014 15:26:03 +0200 Subject: remove unnecessary use of Reference constructor in throw Convert code like this: throw IOException("xx", Reference< XInterface >(static_cast(this)) ); to this: throw IOException("xx", static_cast(this) ); Change-Id: Ife9f645f0f1810a8e80219126193015502c43dbb --- comphelper/source/streaming/memorystream.cxx | 4 ++-- comphelper/source/streaming/seqinputstreamserv.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'comphelper/source/streaming') diff --git a/comphelper/source/streaming/memorystream.cxx b/comphelper/source/streaming/memorystream.cxx index c4379cdb46ba..b8b3f4c113ca 100644 --- a/comphelper/source/streaming/memorystream.cxx +++ b/comphelper/source/streaming/memorystream.cxx @@ -148,7 +148,7 @@ void SAL_CALL UNOMemoryStream::closeInput() throw (NotConnectedException, IOExce void SAL_CALL UNOMemoryStream::seek( sal_Int64 location ) throw (IllegalArgumentException, IOException, RuntimeException, std::exception) { if( (location < 0) || (location > SAL_MAX_INT32) ) - throw IllegalArgumentException("this implementation does not support more than 2GB!", Reference< XInterface >(static_cast(this)), 0 ); + throw IllegalArgumentException("this implementation does not support more than 2GB!", static_cast(this), 0 ); // seek operation should be able to resize the stream if ( location > static_cast< sal_Int64 >( maData.size() ) ) @@ -180,7 +180,7 @@ void SAL_CALL UNOMemoryStream::writeBytes( const Sequence< sal_Int8 >& aData ) t if( nNewSize > SAL_MAX_INT32 ) { OSL_ASSERT(false); - throw IOException("this implementation does not support more than 2GB!", Reference< XInterface >(static_cast(this)) ); + throw IOException("this implementation does not support more than 2GB!", static_cast(this) ); } if( static_cast< sal_Int32 >( nNewSize ) > static_cast< sal_Int32 >( maData.size() ) ) diff --git a/comphelper/source/streaming/seqinputstreamserv.cxx b/comphelper/source/streaming/seqinputstreamserv.cxx index b5750d454b8f..1ea60fa5a63f 100644 --- a/comphelper/source/streaming/seqinputstreamserv.cxx +++ b/comphelper/source/streaming/seqinputstreamserv.cxx @@ -208,7 +208,7 @@ void SAL_CALL SequenceInputStreamService::initialize( const uno::Sequence< ::com if ( aArguments.getLength() != 1 ) throw lang::IllegalArgumentException( "Wrong number of arguments!", - uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), + static_cast< ::cppu::OWeakObject* >(this), 1 ); uno::Sequence< sal_Int8 > aSeq; @@ -224,7 +224,7 @@ void SAL_CALL SequenceInputStreamService::initialize( const uno::Sequence< ::com } else throw lang::IllegalArgumentException( "Unexpected type of argument!", - uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), + static_cast< ::cppu::OWeakObject* >(this), 1 ); } -- cgit v1.2.3