[Libreoffice-commits] core.git: compilerplugins/clang include/tools tools/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Nov 27 09:17:49 UTC 2018


 compilerplugins/clang/unusedenumconstants.readonly.results |    4 ---
 include/tools/poly.hxx                                     |   10 +++-----
 tools/source/generic/poly.cxx                              |   16 +------------
 3 files changed, 6 insertions(+), 24 deletions(-)

New commits:
commit ce6ac77816005b380700118d0b1de0f145503024
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Nov 26 10:29:40 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Nov 27 10:17:25 2018 +0100

    remove unused PolyOptimizeFlags enum values
    
    Change-Id: I3a2145277212b7b45c25bea2e33aae3f6f4a7776
    Reviewed-on: https://gerrit.libreoffice.org/64066
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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 );
-            }
         }
     }
 }


More information about the Libreoffice-commits mailing list