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

Caolán McNamara caolanm at redhat.com
Wed Mar 15 15:38:27 UTC 2017


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

New commits:
commit 5411d99c0a7345e9c68ad55debcb20eecdc0b36a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 15 15:36:45 2017 +0000

    rollback utl::TempFile change

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


More information about the Libreoffice-commits mailing list