diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-06 09:00:50 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-05-06 09:01:31 +0200 |
commit | 662fc8eaa94d766104bced33c18b4718722c6692 (patch) | |
tree | bdf3c702a3e1991e6e20cfd2d10615bf844930df /vcl | |
parent | b13fbd19b7282a1210a2e14bb5ede9ecdf944c1c (diff) |
convert BMP_MIRROR constants to scoped enum
and fix bug in svx/source/xoutdev/_xoutbmp.cxx,XOutBitmap::MirrorGraphic
where it was not correctly translating between different flags types.
Change-Id: I78b4965544da2aa54b67ec18307fa54c8ffc3aee
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/animate.cxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap.cxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap3.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl2.cxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/print.cxx | 8 | ||||
-rw-r--r-- | vcl/source/outdev/bitmap.cxx | 8 | ||||
-rw-r--r-- | vcl/source/outdev/mask.cxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/rect.cxx | 8 | ||||
-rw-r--r-- | vcl/source/outdev/transparent.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/toolbox2.cxx | 2 |
13 files changed, 39 insertions, 39 deletions
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index 6371d660ce08..4dd37f8381e2 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -600,7 +600,7 @@ bool Animation::Invert() return bRet; } -bool Animation::Mirror( sal_uLong nMirrorFlags ) +bool Animation::Mirror( BmpMirrorFlags nMirrorFlags ) { DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" ); @@ -610,17 +610,17 @@ bool Animation::Mirror( sal_uLong nMirrorFlags ) { bRet = true; - if( nMirrorFlags ) + if( nMirrorFlags != BmpMirrorFlags::NONE ) { for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) { AnimationBitmap* pStepBmp = maList[ i ]; if( ( bRet = pStepBmp->aBmpEx.Mirror( nMirrorFlags ) ) ) { - if( nMirrorFlags & BMP_MIRROR_HORZ ) + if( nMirrorFlags & BmpMirrorFlags::Horizontal ) pStepBmp->aPosPix.X() = maGlobalSize.Width() - pStepBmp->aPosPix.X() - pStepBmp->aSizePix.Width(); - if( nMirrorFlags & BMP_MIRROR_VERT ) + if( nMirrorFlags & BmpMirrorFlags::Vertical ) pStepBmp->aPosPix.Y() = maGlobalSize.Height() - pStepBmp->aPosPix.Y() - pStepBmp->aSizePix.Height(); } } diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index b5209f84fad3..51e5db80924f 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -556,10 +556,10 @@ bool Bitmap::Invert() return bRet; } -bool Bitmap::Mirror( sal_uLong nMirrorFlags ) +bool Bitmap::Mirror( BmpMirrorFlags nMirrorFlags ) { - bool bHorz = ( ( nMirrorFlags & BMP_MIRROR_HORZ ) == BMP_MIRROR_HORZ ); - bool bVert = ( ( nMirrorFlags & BMP_MIRROR_VERT ) == BMP_MIRROR_VERT ); + bool bHorz( nMirrorFlags & BmpMirrorFlags::Horizontal ); + bool bVert( nMirrorFlags & BmpMirrorFlags::Vertical ); bool bRet = false; if( bHorz && !bVert ) @@ -664,7 +664,7 @@ bool Bitmap::Rotate( long nAngle10, const Color& rFillColor ) if( !nAngle10 ) bRet = true; else if( 1800L == nAngle10 ) - bRet = Mirror( BMP_MIRROR_HORZ | BMP_MIRROR_VERT ); + bRet = Mirror( BmpMirrorFlags::Horizontal | BmpMirrorFlags::Vertical ); else { BitmapReadAccess* pReadAcc = AcquireReadAccess(); diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index f3dc33e89565..3ad2c18fd01c 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -1582,19 +1582,19 @@ bool Bitmap::ImplScaleConvolution( } bool bResult(true); - sal_uInt32 nMirrorFlags(BMP_MIRROR_NONE); + BmpMirrorFlags nMirrorFlags(BmpMirrorFlags::NONE); bool bMirrorAfter(false); if(bMirror) { if(bMirrorHor) { - nMirrorFlags |= BMP_MIRROR_HORZ; + nMirrorFlags |= BmpMirrorFlags::Horizontal; } if(bMirrorVer) { - nMirrorFlags |= BMP_MIRROR_VERT; + nMirrorFlags |= BmpMirrorFlags::Vertical; } const sal_uInt32 nStartSize(nWidth * nHeight); diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 38a770d47138..537c7dc8feff 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -359,7 +359,7 @@ bool BitmapEx::Invert() return bRet; } -bool BitmapEx::Mirror( sal_uLong nMirrorFlags ) +bool BitmapEx::Mirror( BmpMirrorFlags nMirrorFlags ) { bool bRet = false; diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index f3a44928be90..2701046a37eb 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -689,19 +689,19 @@ void GDIMetaFile::RemoveAction( size_t nPos ) pPrev->RemoveAction( nPos ); } -bool GDIMetaFile::Mirror( sal_uLong nMirrorFlags ) +bool GDIMetaFile::Mirror( BmpMirrorFlags nMirrorFlags ) { const Size aOldPrefSize( GetPrefSize() ); long nMoveX, nMoveY; double fScaleX, fScaleY; bool bRet; - if( nMirrorFlags & MTF_MIRROR_HORZ ) + if( nMirrorFlags & BmpMirrorFlags::Horizontal ) nMoveX = SAL_ABS( aOldPrefSize.Width() ) - 1, fScaleX = -1.0; else nMoveX = 0, fScaleX = 1.0; - if( nMirrorFlags & MTF_MIRROR_VERT ) + if( nMirrorFlags & BmpMirrorFlags::Vertical ) nMoveY = SAL_ABS( aOldPrefSize.Height() ) - 1, fScaleY = -1.0; else nMoveY = 0, fScaleY = 1.0; diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 837d69f9aa19..05d4e25083af 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -76,21 +76,21 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz // #i19065# Negative sizes have mirror semantics on // OutputDevice. BitmapEx and co. have no idea about that, so // perform that _before_ doing anything with aBitmapEx. - sal_uLong nMirrorFlags(BMP_MIRROR_NONE); + BmpMirrorFlags nMirrorFlags(BmpMirrorFlags::NONE); if( aSize.Width() < 0 ) { aSize.Width() *= -1; aPoint.X() -= aSize.Width(); - nMirrorFlags |= BMP_MIRROR_HORZ; + nMirrorFlags |= BmpMirrorFlags::Horizontal; } if( aSize.Height() < 0 ) { aSize.Height() *= -1; aPoint.Y() -= aSize.Height(); - nMirrorFlags |= BMP_MIRROR_VERT; + nMirrorFlags |= BmpMirrorFlags::Vertical; } - if( nMirrorFlags != BMP_MIRROR_NONE ) + if( nMirrorFlags != BmpMirrorFlags::NONE ) { aBitmapEx.Mirror( nMirrorFlags ); } diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 10d27223d22e..590d6968c17b 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -815,7 +815,7 @@ void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor, if( !rMask.IsEmpty() && aSrcRect.GetWidth() && aSrcRect.GetHeight() && aDestSz.Width() && aDestSz.Height() ) { Bitmap aMask( rMask ); - sal_uLong nMirrFlags = 0UL; + BmpMirrorFlags nMirrFlags = BmpMirrorFlags::NONE; if( aMask.GetBitCount() > 1 ) aMask.Convert( BMP_CONVERSION_1BIT_THRESHOLD ); @@ -825,7 +825,7 @@ void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor, { aDestSz.Width() = -aDestSz.Width(); aDestPt.X() -= ( aDestSz.Width() - 1L ); - nMirrFlags |= BMP_MIRROR_HORZ; + nMirrFlags |= BmpMirrorFlags::Horizontal; } // mirrored vertically @@ -833,7 +833,7 @@ void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor, { aDestSz.Height() = -aDestSz.Height(); aDestPt.Y() -= ( aDestSz.Height() - 1L ); - nMirrFlags |= BMP_MIRROR_VERT; + nMirrFlags |= BmpMirrorFlags::Vertical; } // source cropped? @@ -841,7 +841,7 @@ void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor, aMask.Crop( aSrcRect ); // destination mirrored - if( nMirrFlags ) + if( nMirrFlags != BmpMirrorFlags::NONE) aMask.Mirror( nMirrFlags ); // do painting diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 03938508643f..01c279fb181f 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -135,9 +135,9 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize, if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight ) { - const sal_uLong nMirrFlags = AdjustTwoRect( aPosAry, aBmp.GetSizePixel() ); + const BmpMirrorFlags nMirrFlags = AdjustTwoRect( aPosAry, aBmp.GetSizePixel() ); - if ( nMirrFlags ) + if ( nMirrFlags != BmpMirrorFlags::NONE ) aBmp.Mirror( nMirrFlags ); if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight ) @@ -487,12 +487,12 @@ void OutputDevice::DrawDeviceBitmap( const Point& rDestPt, const Size& rDestSize ImplLogicWidthToDevicePixel(rDestSize.Width()), ImplLogicHeightToDevicePixel(rDestSize.Height())); - const sal_uLong nMirrFlags = AdjustTwoRect(aPosAry, rBitmapEx.GetSizePixel()); + const BmpMirrorFlags nMirrFlags = AdjustTwoRect(aPosAry, rBitmapEx.GetSizePixel()); if (aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight) { - if (nMirrFlags) + if (nMirrFlags != BmpMirrorFlags::NONE) rBitmapEx.Mirror(nMirrFlags); const SalBitmap* pSalSrcBmp = rBitmapEx.ImplGetBitmapImpBitmap()->ImplGetSalBitmap(); diff --git a/vcl/source/outdev/mask.cxx b/vcl/source/outdev/mask.cxx index f8ef47457b2f..9f6b55f9d14b 100644 --- a/vcl/source/outdev/mask.cxx +++ b/vcl/source/outdev/mask.cxx @@ -108,13 +108,13 @@ void OutputDevice::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor, ImplLogicHeightToDevicePixel(rDestSize.Height())); // we don't want to mirror via cooridates - const sal_uLong nMirrFlags = AdjustTwoRect( aPosAry, pImpBmp->ImplGetSize() ); + const BmpMirrorFlags nMirrFlags = AdjustTwoRect( aPosAry, pImpBmp->ImplGetSize() ); // check if output is necessary if( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight ) { - if( nMirrFlags ) + if( nMirrFlags != BmpMirrorFlags::NONE ) { Bitmap aTmp( rMask ); aTmp.Mirror( nMirrFlags ); diff --git a/vcl/source/outdev/rect.cxx b/vcl/source/outdev/rect.cxx index 4606e7be28f6..463152be1753 100644 --- a/vcl/source/outdev/rect.cxx +++ b/vcl/source/outdev/rect.cxx @@ -244,16 +244,16 @@ void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLon mpAlphaVDev->DrawGrid( rRect, rDist, nFlags ); } -sal_uLong AdjustTwoRect( SalTwoRect& rTwoRect, const Size& rSizePix ) +BmpMirrorFlags AdjustTwoRect( SalTwoRect& rTwoRect, const Size& rSizePix ) { - sal_uLong nMirrFlags = 0; + BmpMirrorFlags nMirrFlags = BmpMirrorFlags::NONE; if ( rTwoRect.mnDestWidth < 0 ) { rTwoRect.mnSrcX = rSizePix.Width() - rTwoRect.mnSrcX - rTwoRect.mnSrcWidth; rTwoRect.mnDestWidth = -rTwoRect.mnDestWidth; rTwoRect.mnDestX -= rTwoRect.mnDestWidth-1; - nMirrFlags |= BMP_MIRROR_HORZ; + nMirrFlags |= BmpMirrorFlags::Horizontal; } if ( rTwoRect.mnDestHeight < 0 ) @@ -261,7 +261,7 @@ sal_uLong AdjustTwoRect( SalTwoRect& rTwoRect, const Size& rSizePix ) rTwoRect.mnSrcY = rSizePix.Height() - rTwoRect.mnSrcY - rTwoRect.mnSrcHeight; rTwoRect.mnDestHeight = -rTwoRect.mnDestHeight; rTwoRect.mnDestY -= rTwoRect.mnDestHeight-1; - nMirrFlags |= BMP_MIRROR_VERT; + nMirrFlags |= BmpMirrorFlags::Vertical; } if( ( rTwoRect.mnSrcX < 0 ) || ( rTwoRect.mnSrcX >= rSizePix.Width() ) || diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index 425a56ab7514..69236f8146e9 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -133,7 +133,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask if( !rBmp.IsEmpty() && aSrcRect.GetWidth() && aSrcRect.GetHeight() && aDestSz.Width() && aDestSz.Height() ) { Bitmap aPaint( rBmp ), aMask( rMask ); - sal_uLong nMirrFlags = 0UL; + BmpMirrorFlags nMirrFlags = BmpMirrorFlags::NONE; if( aMask.GetBitCount() > 1 ) aMask.Convert( BMP_CONVERSION_1BIT_THRESHOLD ); @@ -143,7 +143,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask { aDestSz.Width() = -aDestSz.Width(); aDestPt.X() -= ( aDestSz.Width() - 1L ); - nMirrFlags |= BMP_MIRROR_HORZ; + nMirrFlags |= BmpMirrorFlags::Horizontal; } // mirrored vertically @@ -151,7 +151,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask { aDestSz.Height() = -aDestSz.Height(); aDestPt.Y() -= ( aDestSz.Height() - 1L ); - nMirrFlags |= BMP_MIRROR_VERT; + nMirrFlags |= BmpMirrorFlags::Vertical; } // source cropped? @@ -162,7 +162,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask } // destination mirrored - if( nMirrFlags ) + if( nMirrFlags != BmpMirrorFlags::NONE ) { aPaint.Mirror( nMirrFlags ); aMask.Mirror( nMirrFlags ); diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 5571d03ad70f..3560c6c48dd6 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1099,7 +1099,7 @@ static inline Image ImplMirrorImage( const Image& rImage ) Image aRet; BitmapEx aBmpEx( rImage.GetBitmapEx() ); - aBmpEx.Mirror( BMP_MIRROR_HORZ ); + aBmpEx.Mirror( BmpMirrorFlags::Horizontal ); return Image( aBmpEx ); } diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index cedf3bd1b184..e209fd22a0c7 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -1202,7 +1202,7 @@ static Image ImplMirrorImage( const Image& rImage ) Image aRet; BitmapEx aMirrBitmapEx( rImage.GetBitmapEx() ); - aMirrBitmapEx.Mirror( BMP_MIRROR_HORZ ); + aMirrBitmapEx.Mirror( BmpMirrorFlags::Horizontal ); return Image( aMirrBitmapEx ); } |