summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-15 11:28:15 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-03-15 13:44:14 +0000
commit4af16b2f00c3d7d5c48f65aeff2c34fff3942ada (patch)
treed80b22acb5dc6672f42b53d346fd20a055da4590 /vcl/source/gdi
parent6082cd7e64b498301ed638afb3a7a743f6ab3f8a (diff)
utl::TempFile can give a stream directly without bringing ucb into it
Change-Id: Ic6eb0934fdb63492d831b9dad07e93c968ee9bf2
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/gfxlink.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index abe94b0db289..60d6493e2c71 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -141,15 +141,15 @@ void GfxLink::SwapOut()
OUString aURL = aTempFile.GetURL();
- if( !aURL.isEmpty() )
+ if (!aURL.isEmpty())
{
std::shared_ptr<GfxLink::SwapOutData> pSwapOut = std::make_shared<SwapOutData>(aURL); // aURL is removed in the destructor
- std::unique_ptr<SvStream> xOStm(::utl::UcbStreamHelper::CreateStream( aURL, StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE ));
- if( xOStm )
+ SvStream* pOStm = aTempFile.GetStream(StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE);
+ if (pOStm)
{
- xOStm->WriteBytes( mpSwapInData.get(), mnSwapInDataSize );
- bool bError = ( ERRCODE_NONE != xOStm->GetError() );
- xOStm.reset();
+ pOStm->WriteBytes(mpSwapInData.get(), mnSwapInDataSize);
+ bool bError = (ERRCODE_NONE != pOStm->GetError());
+ aTempFile.CloseStream();
if( !bError )
{