diff options
author | Noel Grandin <noel@peralex.com> | 2015-01-04 19:34:19 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-01-09 09:08:35 +0200 |
commit | 278b400511a76a9be5e0afc0377a9c69823cc230 (patch) | |
tree | faf2573bf0f0e57817dcd8cac9f9b36989402710 /include/tools/poly.hxx | |
parent | 5c5edaef89e953d260501678c3d62c47ad9763ac (diff) |
fdo#84938: convert POLY_OPTIMIZE_ #defines to 'enum class'
Change-Id: I163bd3f521473c5357c23c3ce4978f984be7b6fe
Diffstat (limited to 'include/tools/poly.hxx')
-rw-r--r-- | include/tools/poly.hxx | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx index bfc14ea1ea92..af157b2137f7 100644 --- a/include/tools/poly.hxx +++ b/include/tools/poly.hxx @@ -22,17 +22,25 @@ #include <tools/toolsdllapi.h> #include <tools/gen.hxx> #include <tools/debug.hxx> +#include <o3tl/typed_flags_set.hxx> #include <vector> #define POLY_APPEND (0xFFFF) #define POLYPOLY_APPEND (0xFFFF) -#define POLY_OPTIMIZE_OPEN 0x00000001UL -#define POLY_OPTIMIZE_CLOSE 0x00000002UL -#define POLY_OPTIMIZE_NO_SAME 0x00000004UL -#define POLY_OPTIMIZE_REDUCE 0x00000008UL -#define POLY_OPTIMIZE_EDGES 0x00000010UL +enum class PolyOptimizeFlags { + NONE = 0x0000, + OPEN = 0x0001, + CLOSE = 0x0002, + NO_SAME = 0x0004, + REDUCE = 0x0008, + EDGES = 0x0010, +}; +namespace o3tl +{ + template<> struct typed_flags<PolyOptimizeFlags> : is_typed_flags<PolyOptimizeFlags, 0x001f> {}; +} enum PolyStyle { @@ -134,7 +142,7 @@ public: bool IsRightOrientated() const; double CalcDistance( sal_uInt16 nPt1, sal_uInt16 nPt2 ); void Clip( const Rectangle& rRect, bool bPolygon = true ); - void Optimize( sal_uIntPtr nOptimizeFlags, const PolyOptimizeData* pData = NULL ); + void Optimize( PolyOptimizeFlags nOptimizeFlags, const PolyOptimizeData* pData = NULL ); /** Adaptive subdivision of polygons with curves @@ -223,7 +231,7 @@ public: sal_uInt16 Count() const; Rectangle GetBoundRect() const; void Clip( const Rectangle& rRect ); - void Optimize( sal_uIntPtr nOptimizeFlags, const PolyOptimizeData* pData = NULL ); + void Optimize( PolyOptimizeFlags nOptimizeFlags, const PolyOptimizeData* pData = NULL ); /** Adaptive subdivision of polygons with curves |