diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-15 15:36:45 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-03-15 15:37:40 +0000 |
commit | 5411d99c0a7345e9c68ad55debcb20eecdc0b36a (patch) | |
tree | ae910b7a3c260a033e7a1df9bb6767698704dfcb | |
parent | 2b1f0380bee7b5ec50ad90cf24be0b87a3e78c2e (diff) |
rollback utl::TempFile change
-rw-r--r-- | vcl/source/filter/jpeg/jpegc.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/gfxlink.cxx | 12 |
2 files changed, 8 insertions, 10 deletions
diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx index 1eb290f3d2ff..134459284195 100644 --- a/vcl/source/filter/jpeg/jpegc.cxx +++ b/vcl/source/filter/jpeg/jpegc.cxx @@ -93,8 +93,6 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines, cinfo.output_gamma = 1.0; cinfo.raw_data_out = FALSE; cinfo.quantize_colors = FALSE; - ScanlineFormat eScanlineFormat = ScanlineFormat::N24BitTcRgb; - int nPixelSize = 3; if ( cinfo.jpeg_color_space == JCS_YCbCr ) cinfo.out_color_space = JCS_RGB; else if ( cinfo.jpeg_color_space == JCS_YCCK ) @@ -173,7 +171,7 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines, { JSAMPLE* aRangeLimit = cinfo.sample_range_limit; - std::vector<sal_uInt8> pScanLineBuffer(nWidth * (bGray ? 1 : nPixelSize)); + std::vector<sal_uInt8> pScanLineBuffer(nWidth * (bGray ? 1 : 3)); std::vector<sal_uInt8> pCYMKBuffer; if (cinfo.out_color_space == JCS_CMYK) @@ -232,7 +230,7 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines, } else { - pAccess->CopyScanline(yIndex, pScanLineBuffer.data(), eScanlineFormat, pScanLineBuffer.size()); + pAccess->CopyScanline(yIndex, pScanLineBuffer.data(), ScanlineFormat::N24BitTcRgb, nWidth * 3); } /* PENDING ??? */ diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx index 60d6493e2c71..abe94b0db289 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 - SvStream* pOStm = aTempFile.GetStream(StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE); - if (pOStm) + std::unique_ptr<SvStream> xOStm(::utl::UcbStreamHelper::CreateStream( aURL, StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE )); + if( xOStm ) { - pOStm->WriteBytes(mpSwapInData.get(), mnSwapInDataSize); - bool bError = (ERRCODE_NONE != pOStm->GetError()); - aTempFile.CloseStream(); + xOStm->WriteBytes( mpSwapInData.get(), mnSwapInDataSize ); + bool bError = ( ERRCODE_NONE != xOStm->GetError() ); + xOStm.reset(); if( !bError ) { |