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 /svx/source/xoutdev | |
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 'svx/source/xoutdev')
-rw-r--r-- | svx/source/xoutdev/_xoutbmp.cxx | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index d03b43b19af3..6a477489a776 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -47,13 +47,13 @@ Animation XOutBitmap::MirrorAnimation( const Animation& rAnimation, bool bHMirr, if( bHMirr || bVMirr ) { const Size& rGlobalSize = aNewAnim.GetDisplaySizePixel(); - sal_uIntPtr nMirrorFlags = 0L; + BmpMirrorFlags nMirrorFlags = BmpMirrorFlags::NONE; if( bHMirr ) - nMirrorFlags |= BMP_MIRROR_HORZ; + nMirrorFlags |= BmpMirrorFlags::Horizontal; if( bVMirr ) - nMirrorFlags |= BMP_MIRROR_VERT; + nMirrorFlags |= BmpMirrorFlags::Vertical; for( sal_uInt16 i = 0, nCount = aNewAnim.Count(); i < nCount; i++ ) { @@ -78,17 +78,17 @@ Animation XOutBitmap::MirrorAnimation( const Animation& rAnimation, bool bHMirr, return aNewAnim; } -Graphic XOutBitmap::MirrorGraphic( const Graphic& rGraphic, const sal_uIntPtr nMirrorFlags ) +Graphic XOutBitmap::MirrorGraphic( const Graphic& rGraphic, const BmpMirrorFlags nMirrorFlags ) { Graphic aRetGraphic; - if( nMirrorFlags ) + if( nMirrorFlags != BmpMirrorFlags::NONE ) { if( rGraphic.IsAnimated() ) { aRetGraphic = MirrorAnimation( rGraphic.GetAnimation(), - ( nMirrorFlags & BMP_MIRROR_HORZ ) == BMP_MIRROR_HORZ, - ( nMirrorFlags & BMP_MIRROR_VERT ) == BMP_MIRROR_VERT ); + bool( nMirrorFlags & BmpMirrorFlags::Horizontal ), + bool( nMirrorFlags & BmpMirrorFlags::Vertical ) ); } else { @@ -300,7 +300,14 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam // mirror? if( ( nFlags & XOUTBMP_MIRROR_HORZ ) || ( nFlags & XOUTBMP_MIRROR_VERT ) ) - aGraphic = MirrorGraphic( aGraphic, nFlags ); + { + BmpMirrorFlags nBmpMirrorFlags = BmpMirrorFlags::NONE; + if( nFlags & XOUTBMP_MIRROR_HORZ ) + nBmpMirrorFlags |= BmpMirrorFlags::Horizontal; + if( nFlags & XOUTBMP_MIRROR_VERT ) + nBmpMirrorFlags |= BmpMirrorFlags::Vertical; + aGraphic = MirrorGraphic( aGraphic, nBmpMirrorFlags ); + } if( ( GRFILTER_FORMAT_NOTFOUND != nFilter ) && ( aGraphic.GetType() != GRAPHIC_NONE ) ) { |