summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-16 08:54:15 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-03-16 08:54:43 +0000
commit6cba562d96a29a72d88f094f5258a1f9979df9b6 (patch)
tree2c0f8bda7c02658402c8901c2bcf3aa18b6d7e93 /vcl
parent78b195c484f8b10eb356a6f9079942e709fd8cda (diff)
reinstate utl::TempFile change
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/jpeg/jpegc.cxx6
-rw-r--r--vcl/source/gdi/gfxlink.cxx12
2 files changed, 10 insertions, 8 deletions
diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx
index 134459284195..1eb290f3d2ff 100644
--- a/vcl/source/filter/jpeg/jpegc.cxx
+++ b/vcl/source/filter/jpeg/jpegc.cxx
@@ -93,6 +93,8 @@ 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 )
@@ -171,7 +173,7 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines,
{
JSAMPLE* aRangeLimit = cinfo.sample_range_limit;
- std::vector<sal_uInt8> pScanLineBuffer(nWidth * (bGray ? 1 : 3));
+ std::vector<sal_uInt8> pScanLineBuffer(nWidth * (bGray ? 1 : nPixelSize));
std::vector<sal_uInt8> pCYMKBuffer;
if (cinfo.out_color_space == JCS_CMYK)
@@ -230,7 +232,7 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines,
}
else
{
- pAccess->CopyScanline(yIndex, pScanLineBuffer.data(), ScanlineFormat::N24BitTcRgb, nWidth * 3);
+ pAccess->CopyScanline(yIndex, pScanLineBuffer.data(), eScanlineFormat, pScanLineBuffer.size());
}
/* PENDING ??? */
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 )
{