summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-06 09:00:50 +0200
committerNoel Grandin <noel@peralex.com>2015-05-06 09:01:31 +0200
commit662fc8eaa94d766104bced33c18b4718722c6692 (patch)
treebdf3c702a3e1991e6e20cfd2d10615bf844930df /include
parentb13fbd19b7282a1210a2e14bb5ede9ecdf944c1c (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 'include')
-rw-r--r--include/svtools/grfmgr.hxx8
-rw-r--r--include/svx/xoutbmp.hxx2
-rw-r--r--include/vcl/animate.hxx2
-rw-r--r--include/vcl/bitmap.hxx16
-rw-r--r--include/vcl/bitmapex.hxx2
-rw-r--r--include/vcl/gdimtf.hxx5
-rw-r--r--include/vcl/outdev.hxx2
7 files changed, 21 insertions, 16 deletions
diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index 35d63bc34776..089b69d08ba9 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -82,7 +82,7 @@ class SVT_DLLPUBLIC GraphicAttr
private:
double mfGamma;
- sal_uInt32 mnMirrFlags;
+ BmpMirrorFlags mnMirrFlags;
long mnLeftCrop;
long mnTopCrop;
long mnRightCrop;
@@ -108,8 +108,8 @@ public:
void SetDrawMode( GraphicDrawMode eDrawMode ) { meDrawMode = eDrawMode; }
GraphicDrawMode GetDrawMode() const { return meDrawMode; }
- void SetMirrorFlags( sal_uLong nMirrFlags ) { mnMirrFlags = nMirrFlags; }
- sal_uLong GetMirrorFlags() const { return mnMirrFlags; }
+ void SetMirrorFlags( BmpMirrorFlags nMirrFlags ) { mnMirrFlags = nMirrFlags; }
+ BmpMirrorFlags GetMirrorFlags() const { return mnMirrFlags; }
void SetCrop( long nLeft_100TH_MM, long nTop_100TH_MM, long nRight_100TH_MM, long nBottom_100TH_MM )
{
@@ -149,7 +149,7 @@ public:
sal_uInt8 GetTransparency() const { return mcTransparency; }
bool IsSpecialDrawMode() const { return( meDrawMode != GRAPHICDRAWMODE_STANDARD ); }
- bool IsMirrored() const { return( mnMirrFlags != 0UL ); }
+ bool IsMirrored() const { return mnMirrFlags != BmpMirrorFlags::NONE; }
bool IsCropped() const
{
return( mnLeftCrop != 0 || mnTopCrop != 0 ||
diff --git a/include/svx/xoutbmp.hxx b/include/svx/xoutbmp.hxx
index 0f802210ace2..25ba5e48c90d 100644
--- a/include/svx/xoutbmp.hxx
+++ b/include/svx/xoutbmp.hxx
@@ -49,7 +49,7 @@ public:
static GraphicFilter* pGrfFilter;
- static Graphic MirrorGraphic( const Graphic& rGraphic, const sal_uIntPtr nMirrorFlags );
+ static Graphic MirrorGraphic( const Graphic& rGraphic, const BmpMirrorFlags nMirrorFlags );
static Animation MirrorAnimation( const Animation& rAnimation, bool bHMirr, bool bVMirr );
static sal_uInt16 WriteGraphic( const Graphic& rGraphic, OUString& rFileName,
const OUString& rFilterName, const sal_uIntPtr nFlags = 0L,
diff --git a/include/vcl/animate.hxx b/include/vcl/animate.hxx
index 74a527fc5c84..1f2a6b8b3920 100644
--- a/include/vcl/animate.hxx
+++ b/include/vcl/animate.hxx
@@ -183,7 +183,7 @@ public:
BmpReduce eReduce = BMP_REDUCE_SIMPLE );
bool Invert();
- bool Mirror( sal_uLong nMirrorFlags );
+ bool Mirror( BmpMirrorFlags nMirrorFlags );
bool Adjust(
short nLuminancePercent = 0,
short nContrastPercent = 0,
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index be7d4eb293d7..5e75b69626d9 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -28,10 +28,18 @@
#include <vcl/mapmod.hxx>
#include <vcl/region.hxx>
#include <vcl/scopedbitmapaccess.hxx>
+#include <o3tl/typed_flags_set.hxx>
-#define BMP_MIRROR_NONE 0x00000000UL
-#define BMP_MIRROR_HORZ 0x00000001UL
-#define BMP_MIRROR_VERT 0x00000002UL
+enum class BmpMirrorFlags
+{
+ NONE = 0x00,
+ Horizontal = 0x01,
+ Vertical = 0x02,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<BmpMirrorFlags> : is_typed_flags<BmpMirrorFlags, 0x03> {};
+}
enum class BmpScaleFlag
@@ -534,7 +542,7 @@ public:
@return true, if the operation was completed successfully.
*/
- bool Mirror( sal_uLong nMirrorFlags );
+ bool Mirror( BmpMirrorFlags nMirrorFlags );
/** Scale the bitmap
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index d7b08e087779..13afdcd46153 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -223,7 +223,7 @@ public:
@return true, if the operation was completed successfully.
*/
- bool Mirror( sal_uLong nMirrorFlags );
+ bool Mirror( BmpMirrorFlags nMirrorFlags );
/** Scale the bitmap
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index bc8da88cdd9e..8baa116eea95 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -53,9 +53,6 @@ class Gradient;
#define METAFILE_LABEL_NOTFOUND GDI_METAFILE_LABEL_NOTFOUND
#endif
-#define MTF_MIRROR_HORZ 0x00000001UL
-#define MTF_MIRROR_VERT 0x00000002UL
-
enum MtfConversion
{
MTF_CONVERSION_NONE = 0,
@@ -132,7 +129,7 @@ public:
bool operator!=( const GDIMetaFile& rMtf ) const { return !( *this == rMtf ); }
void Clear();
- bool Mirror( sal_uLong nMirrorFlags );
+ bool Mirror( BmpMirrorFlags nMirrorFlags );
void Move( long nX, long nY );
// additional Move method getting specifics how to handle MapMode( MAP_PIXEL )
void Move( long nX, long nY, long nDPIX, long nDPIY );
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index ea284f2764cf..66bcccb8febc 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -245,7 +245,7 @@ namespace vcl {
class FontInfo;
}
-sal_uLong AdjustTwoRect( SalTwoRect& rTwoRect, const Size& rSizePix );
+BmpMirrorFlags AdjustTwoRect( SalTwoRect& rTwoRect, const Size& rSizePix );
void AdjustTwoRect( SalTwoRect& rTwoRect, const Rectangle& rValidSrcRect );
extern const sal_uLong nVCLRLut[ 6 ];