diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx index 60d6493e2c71..8921aaf081f3 100644 --- a/vcl/source/gdi/gfxlink.cxx +++ b/vcl/source/gdi/gfxlink.cxx @@ -21,13 +21,10 @@ #include #include #include -#include #include -#include #include #include #include -#include #include #include @@ -269,22 +266,15 @@ std::shared_ptr GfxLink::GetSwapInData() const std::shared_ptr pData; - std::unique_ptr xIStm(::utl::UcbStreamHelper::CreateStream( mpSwapOutData->maURL, StreamMode::READWRITE )); - if( xIStm ) - { - pData = o3tl::make_shared_array(mnSwapInDataSize); - xIStm->ReadBytes( pData.get(), mnSwapInDataSize ); - bool bError = ( ERRCODE_NONE != xIStm->GetError() ); - sal_uInt64 const nActReadSize = xIStm->Tell(); - if (nActReadSize != mnSwapInDataSize) - { - bError = true; - } - xIStm.reset(); - - if( bError ) - pData.reset(); - } + SvFileStream aFileStream(mpSwapOutData->maURL, StreamMode::READWRITE); + pData = o3tl::make_shared_array(mnSwapInDataSize); + aFileStream.ReadBytes(pData.get(), mnSwapInDataSize); + bool bError = (ERRCODE_NONE != aFileStream.GetError()); + sal_uInt64 const nActReadSize = aFileStream.Tell(); + if (nActReadSize != mnSwapInDataSize) + bError = true; + if (bError) + pData.reset(); return pData; }