diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-09-16 15:03:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-09-16 15:34:23 +0100 |
commit | 42468f9f979d0d21ad406af8ddc4135380fff63d (patch) | |
tree | 6d94145cf28033b336ffa7b2fc502d4c22448ab2 | |
parent | 31ebd9f475f94fb4f05bbeaa8077122a2635d528 (diff) |
pointer->reference
Change-Id: I9d76750d907968d54d5ab99304080a75452c0420
-rw-r--r-- | vcl/source/filter/jpeg/JpegReader.cxx | 31 | ||||
-rw-r--r-- | vcl/source/filter/jpeg/JpegReader.hxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/jpeg/jpegc.cxx | 2 |
3 files changed, 17 insertions, 18 deletions
diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx index 6ada56b8738c..66c94576c30d 100644 --- a/vcl/source/filter/jpeg/JpegReader.cxx +++ b/vcl/source/filter/jpeg/JpegReader.cxx @@ -191,8 +191,7 @@ JPEGReader::JPEGReader( SvStream& rStream, void* /*pCallData*/, bool bSetLogSize JPEGReader::~JPEGReader() { - if( mpBuffer ) - delete[] mpBuffer; + delete[] mpBuffer; if( mpAcc ) Bitmap::ReleaseAccess( mpAcc ); @@ -201,16 +200,16 @@ JPEGReader::~JPEGReader() Bitmap::ReleaseAccess( mpAcc1 ); } -unsigned char * JPEGReader::CreateBitmap( JPEGCreateBitmapParam * pParam ) +unsigned char * JPEGReader::CreateBitmap(JPEGCreateBitmapParam& rParam) { - if (pParam->nWidth > SAL_MAX_INT32 / 8 || pParam->nHeight > SAL_MAX_INT32 / 8) + if (rParam.nWidth > SAL_MAX_INT32 / 8 || rParam.nHeight > SAL_MAX_INT32 / 8) return NULL; // avoid overflows later - if (pParam->nWidth == 0 || pParam->nHeight == 0) + if (rParam.nWidth == 0 || rParam.nHeight == 0) return NULL; - Size aSize( pParam->nWidth, pParam->nHeight ); - bool bGray = pParam->bGray != 0; + Size aSize(rParam.nWidth, rParam.nHeight ); + bool bGray = rParam.bGray != 0; unsigned char * pBmpBuf = NULL; @@ -253,13 +252,13 @@ unsigned char * JPEGReader::CreateBitmap( JPEGCreateBitmapParam * pParam ) if ( mbSetLogSize ) { - unsigned long nUnit = pParam->density_unit; + unsigned long nUnit = rParam.density_unit; - if( ( ( 1 == nUnit ) || ( 2 == nUnit ) ) && pParam->X_density && pParam->Y_density ) + if( ( ( 1 == nUnit ) || ( 2 == nUnit ) ) && rParam.X_density && rParam.Y_density ) { Point aEmptyPoint; - Fraction aFractX( 1, pParam->X_density ); - Fraction aFractY( 1, pParam->Y_density ); + Fraction aFractX( 1, rParam.X_density ); + Fraction aFractY( 1, rParam.Y_density ); MapMode aMapMode( nUnit == 1 ? MAP_INCH : MAP_CM, aEmptyPoint, aFractX, aFractY ); Size aPrefSize = OutputDevice::LogicToLogic( aSize, aMapMode, MAP_100TH_MM ); @@ -280,14 +279,14 @@ unsigned char * JPEGReader::CreateBitmap( JPEGCreateBitmapParam * pParam ) ) { pBmpBuf = mpAcc->GetBuffer(); - pParam->nAlignedWidth = mpAcc->GetScanlineSize(); - pParam->bTopDown = mpAcc->IsTopDown(); + rParam.nAlignedWidth = mpAcc->GetScanlineSize(); + rParam.bTopDown = mpAcc->IsTopDown(); } else { - pParam->nAlignedWidth = AlignedWidth4Bytes( aSize.Width() * ( bGray ? 8 : 24 ) ); - pParam->bTopDown = true; - pBmpBuf = mpBuffer = new unsigned char[pParam->nAlignedWidth * aSize.Height()]; + rParam.nAlignedWidth = AlignedWidth4Bytes( aSize.Width() * ( bGray ? 8 : 24 ) ); + rParam.bTopDown = true; + pBmpBuf = mpBuffer = new unsigned char[rParam.nAlignedWidth * aSize.Height()]; } } diff --git a/vcl/source/filter/jpeg/JpegReader.hxx b/vcl/source/filter/jpeg/JpegReader.hxx index 978317a59c9d..c45b697fb617 100644 --- a/vcl/source/filter/jpeg/JpegReader.hxx +++ b/vcl/source/filter/jpeg/JpegReader.hxx @@ -67,7 +67,7 @@ public: virtual ~JPEGReader(); ReadState Read( Graphic& rGraphic ); - unsigned char * CreateBitmap( JPEGCreateBitmapParam* param ); + unsigned char * CreateBitmap( JPEGCreateBitmapParam& param ); }; #endif // INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEGREADER_HXX diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx index 4945e75f7b80..8ced5ab28ca6 100644 --- a/vcl/source/filter/jpeg/jpegc.cxx +++ b/vcl/source/filter/jpeg/jpegc.cxx @@ -154,7 +154,7 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines, aCreateBitmapParam.X_density = cinfo.X_density; aCreateBitmapParam.Y_density = cinfo.Y_density; aCreateBitmapParam.bGray = long(cinfo.output_components == 1); - pDIB = pJPEGReader->CreateBitmap( &aCreateBitmapParam ); + pDIB = pJPEGReader->CreateBitmap(aCreateBitmapParam); nAlignedWidth = aCreateBitmapParam.nAlignedWidth; aRangeLimit = cinfo.sample_range_limit; |