diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-05 14:09:24 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-05-06 09:01:30 +0200 |
commit | b13fbd19b7282a1210a2e14bb5ede9ecdf944c1c (patch) | |
tree | 3db528acc23250ddcc3dbdc9b1e35a817d8de9ee /vcl/source | |
parent | ba121a3269d17f87c6d09b9e46aaaf921af40ef6 (diff) |
convert BMP_SCALE constant to scoped enum
Change-Id: Ibc9f88d2588c028cd71aa86c26d970a73025ef22
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/bitmap3.cxx | 34 | ||||
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/impbmp.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl2.cxx | 2 | ||||
-rw-r--r-- | vcl/source/helper/canvasbitmap.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/toolbox2.cxx | 2 |
10 files changed, 29 insertions, 29 deletions
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 9451b160969e..f3dc33e89565 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -864,7 +864,7 @@ bool Bitmap::ImplConvertGhosted() return bRet; } -bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) +bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) { bool bRetval(false); @@ -904,7 +904,7 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nSc //fdo#33455 // //If we start with a 1 bit image, then after scaling it in any mode except - //BMP_SCALE_FAST we have a 24bit image which is perfectly correct, but we + //BmpScaleFlag::Fast we have a 24bit image which is perfectly correct, but we //are going to down-shift it to mono again and Bitmap::ImplMakeMono just //has "Bitmap aNewBmp( GetSizePixel(), 1 );" to create a 1 bit bitmap which //will default to black/white and the colors mapped to which ever is closer @@ -914,28 +914,28 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nSc //just use the fast scale rather than attempting to count unique colors in //the other converters and pass all the info down through //Bitmap::ImplMakeMono - if (nStartCount == 1 && nScaleFlag != BMP_SCALE_NONE) - nScaleFlag = BMP_SCALE_FAST; + if (nStartCount == 1 && nScaleFlag != BmpScaleFlag::NONE) + nScaleFlag = BmpScaleFlag::Fast; switch(nScaleFlag) { - case BMP_SCALE_NONE : + case BmpScaleFlag::NONE : { bRetval = false; break; } - case BMP_SCALE_FAST : + case BmpScaleFlag::Fast : { bRetval = ImplScaleFast( rScaleX, rScaleY ); break; } - case BMP_SCALE_INTERPOLATE : + case BmpScaleFlag::Interpolate : { bRetval = ImplScaleInterpolate( rScaleX, rScaleY ); break; } - case BMP_SCALE_SUPER: - case BMP_SCALE_DEFAULT: + case BmpScaleFlag::Super: + case BmpScaleFlag::Default: { if (GetSizePixel().Width() < 2 || GetSizePixel().Height() < 2) { @@ -949,29 +949,29 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nSc } break; } - case BMP_SCALE_LANCZOS : - case BMP_SCALE_BESTQUALITY: + case BmpScaleFlag::Lanczos : + case BmpScaleFlag::BestQuality: { const Lanczos3Kernel kernel; bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel ); break; } - case BMP_SCALE_BICUBIC : + case BmpScaleFlag::BiCubic : { const BicubicKernel kernel; bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel ); break; } - case BMP_SCALE_BILINEAR : + case BmpScaleFlag::BiLinear : { const BilinearKernel kernel; bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel ); break; } - case BMP_SCALE_BOX : + case BmpScaleFlag::Box : { const BoxKernel kernel; @@ -984,7 +984,7 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nSc return bRetval; } -bool Bitmap::Scale( const Size& rNewSize, sal_uInt32 nScaleFlag ) +bool Bitmap::Scale( const Size& rNewSize, BmpScaleFlag nScaleFlag ) { const Size aSize( GetSizePixel() ); bool bRet; @@ -1556,8 +1556,8 @@ namespace } } -// #i121233# Added BMP_SCALE_LANCZOS, BMP_SCALE_BICUBIC, BMP_SCALE_BILINEAR and -// BMP_SCALE_BOX derived from the original commit from Tomas Vajngerl (see +// #i121233# Added BmpScaleFlag::Lanczos, BmpScaleFlag::BiCubic, BmpScaleFlag::BiLinear and +// BmpScaleFlag::Box derived from the original commit from Tomas Vajngerl (see // bugzilla task for deitails) Thanks! bool Bitmap::ImplScaleConvolution( const double& rScaleX, diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 41f1e9254d4d..38a770d47138 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -336,7 +336,7 @@ sal_uLong BitmapEx::GetChecksum() const return nCrc; } -void BitmapEx::SetSizePixel( const Size& rNewSize, sal_uInt32 nScaleFlag ) +void BitmapEx::SetSizePixel( const Size& rNewSize, BmpScaleFlag nScaleFlag ) { if(GetSizePixel() != rNewSize) { @@ -374,7 +374,7 @@ bool BitmapEx::Mirror( sal_uLong nMirrorFlags ) return bRet; } -bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) +bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) { bool bRet = false; @@ -396,7 +396,7 @@ bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 n return bRet; } -bool BitmapEx::Scale( const Size& rNewSize, sal_uInt32 nScaleFlag ) +bool BitmapEx::Scale( const Size& rNewSize, BmpScaleFlag nScaleFlag ) { bool bRet; @@ -695,7 +695,7 @@ BitmapEx BitmapEx:: AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize } aScaledSize = Size( imgNewWidth, imgNewHeight ); - aRet.Scale( aScaledSize, BMP_SCALE_BESTQUALITY ); + aRet.Scale( aScaledSize, BmpScaleFlag::BestQuality ); } else { diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 0eafc4f67e38..f3a44928be90 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -2887,7 +2887,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm ) return rOStm; } -bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, sal_uInt32 nMaximumExtent, BmpConversion eColorConversion, long nScaleFlag) const +bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, sal_uInt32 nMaximumExtent, BmpConversion eColorConversion, BmpScaleFlag nScaleFlag) const { // initialization seems to be complicated but is used to avoid rounding errors ScopedVclPtrInstance< VirtualDevice > aVDev; diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx index 696ede09345c..298bfaa1cd0f 100644 --- a/vcl/source/gdi/impbmp.cxx +++ b/vcl/source/gdi/impbmp.cxx @@ -88,7 +88,7 @@ void ImpBitmap::ImplReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode mnChecksum = 0; } -bool ImpBitmap::ImplScale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) +bool ImpBitmap::ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) { return mpSalBitmap->Scale( rScaleX, rScaleY, nScaleFlag ); } diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 58bb314a1a10..7758c6d32161 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -568,7 +568,7 @@ BitmapEx ImpGraphic::ImplGetBitmapEx(const GraphicConversionParameters& rParamet { aRetBmpEx.Scale( rParameters.getSizePixel(), - rParameters.getScaleHighQuality() ? BMP_SCALE_INTERPOLATE : BMP_SCALE_FAST); + rParameters.getScaleHighQuality() ? BmpScaleFlag::Interpolate : BmpScaleFlag::Fast); } } else if( ( meType != GRAPHIC_DEFAULT ) && ImplIsSupportedGraphic() ) diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 09c8d1b27997..837d69f9aa19 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -128,7 +128,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz if( aNewBmpSize.Width() && aNewBmpSize.Height() ) { // #i121233# Use best quality for PDF exports - aBitmapEx.Scale( aNewBmpSize, BMP_SCALE_BESTQUALITY ); + aBitmapEx.Scale( aNewBmpSize, BmpScaleFlag::BestQuality ); } else { diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx index a1ebb5d39732..c532606b4eb8 100644 --- a/vcl/source/helper/canvasbitmap.cxx +++ b/vcl/source/helper/canvasbitmap.cxx @@ -448,7 +448,7 @@ uno::Reference< rendering::XBitmap > SAL_CALL VclCanvasBitmap::getScaledBitmap( SolarMutexGuard aGuard; BitmapEx aNewBmp( m_aBitmap ); - aNewBmp.Scale( sizeFromRealSize2D( newSize ), beFast ? BMP_SCALE_DEFAULT : BMP_SCALE_BESTQUALITY ); + aNewBmp.Scale( sizeFromRealSize2D( newSize ), beFast ? BmpScaleFlag::Default : BmpScaleFlag::BestQuality ); return uno::Reference<rendering::XBitmap>( new VclCanvasBitmap( aNewBmp ) ); } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index a70a3d0c1a17..5571d03ad70f 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1947,7 +1947,7 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI if (nScaleFactor != 1) { BitmapEx aBitmap = aImage.GetBitmapEx(); - aBitmap.Scale(nScaleFactor, nScaleFactor, BMP_SCALE_FAST); + aBitmap.Scale(nScaleFactor, nScaleFactor, BmpScaleFlag::Fast); aImage = Image(aBitmap); } aTmpPos = aOuterCheckRect.TopLeft(); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 2391f61ca8c2..ad18df4f507a 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -184,7 +184,7 @@ void PrintDialog::PrintPreviewWindow::Paint( vcl::RenderContext& /*rRenderContex else { Bitmap aPreviewBitmap(maPreviewBitmap); - aPreviewBitmap.Scale(maPreviewSize, BMP_SCALE_BESTQUALITY); + aPreviewBitmap.Scale(maPreviewSize, BmpScaleFlag::BestQuality); DrawBitmap(aOffset, aPreviewBitmap); } diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 4d3c80186d49..cedf3bd1b184 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -1124,7 +1124,7 @@ void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rImage ) // FIXME find out what that code is & fix accordingly if (aBitmap.GetSizePixel().Width() < 32) { - aBitmap.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST); + aBitmap.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast); aImage = Image(aBitmap); } } |