[Libreoffice-commits] core.git: vcl/source

Caolán McNamara caolanm at redhat.com
Thu Mar 16 08:55:17 UTC 2017


 vcl/source/filter/jpeg/jpegc.cxx |    6 ++++--
 vcl/source/gdi/gfxlink.cxx       |   12 ++++++------
 2 files changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 6cba562d96a29a72d88f094f5258a1f9979df9b6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 16 08:54:15 2017 +0000

    reinstate utl::TempFile change
    
    This reverts commit 5411d99c0a7345e9c68ad55debcb20eecdc0b36a.

diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx
index 1344592..1eb290f 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 abe94b0..60d6493 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 )
                 {


More information about the Libreoffice-commits mailing list