From f004aa99514d385f3ee254bba735f5eaeb7d9ad8 Mon Sep 17 00:00:00 2001 From: Jacek Fraczek Date: Wed, 5 Oct 2016 22:00:51 +0200 Subject: tdf#89307: Removed SvRef::operator T*() Conditional statements are using SvRef::Is() method. Changed static_cast(svRef) occurances to svRef.get(). Added operator == and != to SvRef. SbxObject::Execute is using SbxVariableRef internally. SbxObject::FindQualified is using SbxVariableRef internally. Change-Id: I45b553e35d8fca9bf71163e6eefc60802a066395 Reviewed-on: https://gerrit.libreoffice.org/29621 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- unotools/source/ucbhelper/ucblockbytes.cxx | 4 ++-- unotools/source/ucbhelper/ucbstreamhelper.cxx | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'unotools') diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index f3a556e06be1..70dd91ff6ffb 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -1395,9 +1395,9 @@ UcbLockBytesRef UcbLockBytes::CreateLockBytes( const Reference < XContent >& xCo xLockBytes->SetSynchronMode(); Reference< XActiveDataControl > xSink; if ( eOpenMode & StreamMode::WRITE ) - xSink = static_cast(new UcbStreamer_Impl( xLockBytes )); + xSink = static_cast(new UcbStreamer_Impl( xLockBytes.get() )); else - xSink = static_cast(new UcbDataSink_Impl( xLockBytes )); + xSink = static_cast(new UcbDataSink_Impl( xLockBytes.get() )); if ( rProps.getLength() ) { diff --git a/unotools/source/ucbhelper/ucbstreamhelper.cxx b/unotools/source/ucbhelper/ucbstreamhelper.cxx index e4a399058c59..8628634d59ac 100644 --- a/unotools/source/ucbhelper/ucbstreamhelper.cxx +++ b/unotools/source/ucbhelper/ucbstreamhelper.cxx @@ -122,7 +122,7 @@ static SvStream* lcl_CreateStream( const OUString& rFileName, StreamMode eOpenMo eOpenMode, xInteractionHandler ); if ( xLockBytes.Is() ) { - pStream = new SvStream( xLockBytes ); + pStream = new SvStream( xLockBytes.get() ); pStream->SetBufferSize( 4096 ); pStream->SetError( xLockBytes->GetError() ); } @@ -164,13 +164,14 @@ SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode e return lcl_CreateStream( rFileName, eOpenMode, xIHScoped,!bFileExists ); } + SvStream* UcbStreamHelper::CreateStream( const Reference < XInputStream >& xStream ) { SvStream* pStream = nullptr; UcbLockBytesRef xLockBytes = UcbLockBytes::CreateInputLockBytes( xStream ); if ( xLockBytes.Is() ) { - pStream = new SvStream( xLockBytes ); + pStream = new SvStream( xLockBytes.get() ); pStream->SetBufferSize( 4096 ); pStream->SetError( xLockBytes->GetError() ); } @@ -186,7 +187,7 @@ SvStream* UcbStreamHelper::CreateStream( const Reference < XStream >& xStream ) UcbLockBytesRef xLockBytes = UcbLockBytes::CreateLockBytes( xStream ); if ( xLockBytes.Is() ) { - pStream = new SvStream( xLockBytes ); + pStream = new SvStream( xLockBytes.get() ); pStream->SetBufferSize( 4096 ); pStream->SetError( xLockBytes->GetError() ); } @@ -206,7 +207,7 @@ SvStream* UcbStreamHelper::CreateStream( const Reference < XInputStream >& xStre if ( !bCloseStream ) xLockBytes->setDontClose_Impl(); - pStream = new SvStream( xLockBytes ); + pStream = new SvStream( xLockBytes.get() ); pStream->SetBufferSize( 4096 ); pStream->SetError( xLockBytes->GetError() ); } @@ -225,7 +226,7 @@ SvStream* UcbStreamHelper::CreateStream( const Reference < XStream >& xStream, b if ( !bCloseStream ) xLockBytes->setDontClose_Impl(); - pStream = new SvStream( xLockBytes ); + pStream = new SvStream( xLockBytes.get() ); pStream->SetBufferSize( 4096 ); pStream->SetError( xLockBytes->GetError() ); } -- cgit