diff options
-rw-r--r-- | compilerplugins/clang/unusedenumconstants.readonly.results | 4 | ||||
-rw-r--r-- | include/tools/poly.hxx | 10 | ||||
-rw-r--r-- | tools/source/generic/poly.cxx | 16 |
3 files changed, 6 insertions, 24 deletions
diff --git a/compilerplugins/clang/unusedenumconstants.readonly.results b/compilerplugins/clang/unusedenumconstants.readonly.results index 821492b5cde6..4ec3ea394ce4 100644 --- a/compilerplugins/clang/unusedenumconstants.readonly.results +++ b/compilerplugins/clang/unusedenumconstants.readonly.results @@ -556,10 +556,6 @@ include/svx/xoutbmp.hxx:36 enum XOutFlags ContourVert include/tools/inetmsg.hxx:70 enum InetMessageMime NUMHDR -include/tools/poly.hxx:34 - enum PolyOptimizeFlags OPEN -include/tools/poly.hxx:37 - enum PolyOptimizeFlags REDUCE include/unotools/fontcfg.hxx:51 enum ImplFontAttrs Default include/unotools/fontcfg.hxx:52 diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx index 17503b02bb09..94d06856e428 100644 --- a/include/tools/poly.hxx +++ b/include/tools/poly.hxx @@ -31,15 +31,13 @@ enum class PolyOptimizeFlags { NONE = 0x0000, - OPEN = 0x0001, - CLOSE = 0x0002, - NO_SAME = 0x0004, - REDUCE = 0x0008, - EDGES = 0x0010, + CLOSE = 0x0001, + NO_SAME = 0x0002, + EDGES = 0x0004, }; namespace o3tl { - template<> struct typed_flags<PolyOptimizeFlags> : is_typed_flags<PolyOptimizeFlags, 0x001f> {}; + template<> struct typed_flags<PolyOptimizeFlags> : is_typed_flags<PolyOptimizeFlags, 0x0007> {}; } enum class PolyStyle diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 4217531800b5..6f2d3115dfcf 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -1033,11 +1033,10 @@ void Polygon::Optimize( PolyOptimizeFlags nOptimizeFlags ) Optimize( PolyOptimizeFlags::NO_SAME ); ImplReduceEdges( *this, fArea, nPercent ); } - else if( nOptimizeFlags & ( PolyOptimizeFlags::REDUCE | PolyOptimizeFlags::NO_SAME ) ) + else if( nOptimizeFlags & PolyOptimizeFlags::NO_SAME ) { tools::Polygon aNewPoly; const Point& rFirst = mpImplPolygon->mxPointAry[ 0 ]; - const int nReduce = ( nOptimizeFlags & PolyOptimizeFlags::REDUCE ) ? 4 : 0; while( nSize && ( mpImplPolygon->mxPointAry[ nSize - 1 ] == rFirst ) ) nSize--; @@ -1051,8 +1050,7 @@ void Polygon::Optimize( PolyOptimizeFlags nOptimizeFlags ) for( sal_uInt16 i = 1; i < nSize; i++ ) { - if( ( mpImplPolygon->mxPointAry[ i ] != mpImplPolygon->mxPointAry[ nLast ] ) && - ( !nReduce || ( nReduce < FRound( CalcDistance( nLast, i ) ) ) ) ) + if( mpImplPolygon->mxPointAry[ i ] != mpImplPolygon->mxPointAry[ nLast ]) { nLast = i; aNewPoly[ nNewCount++ ] = mpImplPolygon->mxPointAry[ i ]; @@ -1078,16 +1076,6 @@ void Polygon::Optimize( PolyOptimizeFlags nOptimizeFlags ) SetSize( mpImplPolygon->mnPoints + 1 ); mpImplPolygon->mxPointAry[ mpImplPolygon->mnPoints - 1 ] = mpImplPolygon->mxPointAry[ 0 ]; } - else if( ( nOptimizeFlags & PolyOptimizeFlags::OPEN ) && - ( mpImplPolygon->mxPointAry[ 0 ] == mpImplPolygon->mxPointAry[ nSize - 1 ] ) ) - { - const Point& rFirst = mpImplPolygon->mxPointAry[ 0 ]; - - while( nSize && ( mpImplPolygon->mxPointAry[ nSize - 1 ] == rFirst ) ) - nSize--; - - SetSize( nSize ); - } } } } |