From a17b19726d723b16dacb49db7a8efd5fee9cb4cf Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 22 Jul 2019 13:07:14 +0200 Subject: loplugin:unusedmethods Change-Id: I3bde62d674f5beaa6d19dcd22e6be15dfefe4205 Reviewed-on: https://gerrit.libreoffice.org/76118 Tested-by: Jenkins Reviewed-by: Noel Grandin --- vcl/source/gdi/gfxlink.cxx | 47 +--------------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) (limited to 'vcl') diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx index 3bb236ca4a34..f76a0dd9ee16 100644 --- a/vcl/source/gdi/gfxlink.cxx +++ b/vcl/source/gdi/gfxlink.cxx @@ -79,15 +79,6 @@ bool GfxLink::IsNative() const const sal_uInt8* GfxLink::GetData() const { - if( IsSwappedOut() ) - { - auto pData = GetSwapInData(); - if (pData) - { - mpSwapInData = pData; - mpSwapOutData.reset(); - } - } return mpSwapInData.get(); } @@ -224,45 +215,9 @@ SvStream& ReadGfxLink( SvStream& rIStream, GfxLink& rGfxLink) return rIStream; } -GfxLink::SwapOutData::SwapOutData(const OUString &aURL) : maURL(aURL) -{ -} - -GfxLink::SwapOutData::~SwapOutData() -{ - if( maURL.getLength() > 0 ) - osl_removeFile( maURL.pData ); -} - std::shared_ptr GfxLink::GetSwapInData() const { - if( !IsSwappedOut() ) - return mpSwapInData; - - std::shared_ptr pData; - - SvFileStream aFileStream(mpSwapOutData->maURL, StreamMode::STD_READ); - pData = o3tl::make_shared_array(mnSwapInDataSize); - aFileStream.ReadBytes(pData.get(), mnSwapInDataSize); - bool bError = false; - auto const e = aFileStream.GetError(); - if (e != ERRCODE_NONE) { - SAL_WARN("vcl", "reading <" << mpSwapOutData->maURL << "> failed with " << e); - bError = true; - } - if (!bError) { - sal_uInt64 const nActReadSize = aFileStream.Tell(); - if (nActReadSize != mnSwapInDataSize) { - SAL_WARN( - "vcl", - "reading <" << mpSwapOutData->maURL << "> produced " << nActReadSize - << " instead of " << mnSwapInDataSize << " bytes"); - bError = true; - } - } - if (bError) - pData.reset(); - return pData; + return mpSwapInData; } bool GfxLink::IsEMF() const -- cgit