summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-04-02 19:12:35 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-04-02 21:48:04 +0000
commitedf79cacbeaef0080588f00e90e6c1b35a70d17e (patch)
treefa51b619deb705a37d804ac5daf1971c3b01a2c7 /vcl
parentd80b0c4d9452d0f9750c12c34b76b63dee32dfb8 (diff)
SwapOutData url is always a file url
so can just use SvFileStream here and not go through ucb Change-Id: I1d70a4e39977a178afaf7eeadb552f1bd7d9fd1a Reviewed-on: https://gerrit.libreoffice.org/36024 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/gfxlink.cxx28
1 files changed, 9 insertions, 19 deletions
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 <tools/stream.hxx>
#include <tools/vcompat.hxx>
#include <tools/debug.hxx>
-#include <unotools/ucbstreamhelper.hxx>
#include <unotools/tempfile.hxx>
-#include <ucbhelper/content.hxx>
#include <vcl/graph.hxx>
#include <vcl/gfxlink.hxx>
#include <vcl/cvtgrf.hxx>
-#include <com/sun/star/ucb/CommandAbortedException.hpp>
#include <memory>
#include <o3tl/make_shared.hxx>
@@ -269,22 +266,15 @@ std::shared_ptr<sal_uInt8> GfxLink::GetSwapInData() const
std::shared_ptr<sal_uInt8> pData;
- std::unique_ptr<SvStream> xIStm(::utl::UcbStreamHelper::CreateStream( mpSwapOutData->maURL, StreamMode::READWRITE ));
- if( xIStm )
- {
- pData = o3tl::make_shared_array<sal_uInt8>(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<sal_uInt8>(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;
}