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

Stephan Bergmann sbergman at redhat.com
Thu Feb 6 08:40:56 PST 2014


 vcl/source/filter/jpeg/JpegReader.cxx |    4 +---
 vcl/source/filter/jpeg/jpeg.h         |    3 ++-
 vcl/source/filter/jpeg/jpegc.cxx      |    7 +++----
 3 files changed, 6 insertions(+), 8 deletions(-)

New commits:
commit 2afb6528c1bc70231b00555cdaa4dd3d25faed11
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Feb 6 17:40:21 2014 +0100

    Blind fix^3
    
    Change-Id: I4124084a6ce47e96936b5cc8695af1981f9f33d4

diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx
index 61d7985..cd9611d 100644
--- a/vcl/source/filter/jpeg/JpegReader.cxx
+++ b/vcl/source/filter/jpeg/JpegReader.cxx
@@ -453,10 +453,8 @@ ReadState JPEGReader::Read( Graphic& rGraphic )
     // seek back to the original position
     mrStream.Seek( mnLastPos );
 
-    Size aPreviewSize = GetPreviewSize();
-
     // read the (partial) image
-    ReadJPEG( this, &mrStream, &nLines, aPreviewSize.Width(), aPreviewSize.Height() );
+    ReadJPEG( this, &mrStream, &nLines, GetPreviewSize() );
 
     if( mpAcc )
     {
diff --git a/vcl/source/filter/jpeg/jpeg.h b/vcl/source/filter/jpeg/jpeg.h
index 9701170..01209ba 100644
--- a/vcl/source/filter/jpeg/jpeg.h
+++ b/vcl/source/filter/jpeg/jpeg.h
@@ -32,6 +32,7 @@ namespace com { namespace sun { namespace star { namespace task {
 } } } }
 class JPEGReader;
 class JPEGWriter;
+class Size;
 
 void jpeg_svstream_src (j_decompress_ptr cinfo, void* infile);
 
@@ -42,7 +43,7 @@ long    WriteJPEG( JPEGWriter* pJPEGWriter, void* pOutputStream, long nWidth, lo
                    css::uno::Reference<css::task::XStatusIndicator> const & status);
 
 void    ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines,
-                  int nPreviewWidth, int nPreviewHeight );
+                  Size const & previewSize );
 
 long    Transform( void* pInputStream, void* pOutputStream, long nAngle );
 
diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx
index 23fa73f..3f52a2f 100644
--- a/vcl/source/filter/jpeg/jpegc.cxx
+++ b/vcl/source/filter/jpeg/jpegc.cxx
@@ -56,7 +56,7 @@ extern "C" void outputMessage (j_common_ptr cinfo)
 }
 
 void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines,
-               int thePreviewWidth, int thePreviewHeight )
+               Size const & previewSize )
 {
     jpeg_decompress_struct          cinfo;
     ErrorManagerStruct              jerr;
@@ -70,9 +70,6 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines,
     unsigned char *                 pScanLineBuffer = NULL;
     long                            nScanLineBufferComponents = 0;
 
-    int nPreviewWidth = thePreviewWidth;
-    int nPreviewHeight = thePreviewHeight;
-
     if ( setjmp( jerr.setjmp_buffer ) )
     {
         jpeg_destroy_decompress( &cinfo );
@@ -100,6 +97,8 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines,
     OSL_ASSERT(cinfo.out_color_space == JCS_CMYK || cinfo.out_color_space == JCS_GRAYSCALE || cinfo.out_color_space == JCS_RGB);
 
     /* change scale for preview import */
+    long nPreviewWidth = previewSize.Width();
+    long nPreviewHeight = previewSize.Height();
     if( nPreviewWidth || nPreviewHeight )
     {
         if( nPreviewWidth == 0 )


More information about the Libreoffice-commits mailing list