[Libreoffice] [PATCH] Removing unused code

Alexander Bergmann myaddons at gmx.de
Thu Jan 19 04:13:19 PST 2012


---
 .../inc/basegfx/polygon/b2dpolygoncutandtouch.hxx  |   10 --
 basegfx/source/polygon/b2dpolygoncutandtouch.cxx   |  112 --------------------
 unusedcode.easy                                    |    4 -
 3 files changed, 0 insertions(+), 126 deletions(-)

diff --git a/basegfx/inc/basegfx/polygon/b2dpolygoncutandtouch.hxx b/basegfx/inc/basegfx/polygon/b2dpolygoncutandtouch.hxx
index 0c6296d..8997c54 100644
--- a/basegfx/inc/basegfx/polygon/b2dpolygoncutandtouch.hxx
+++ b/basegfx/inc/basegfx/polygon/b2dpolygoncutandtouch.hxx
@@ -53,28 +53,18 @@ namespace basegfx
         // not change or add points to rMask.
         BASEGFX_DLLPUBLIC B2DPolygon addPointsAtCutsAndTouches(const B2DPolyPolygon& rMask, const B2DPolygon& rCandidate);
 
-        // look for intersections of rCandidate with all polygons from rMask and add extra points there. Do
-        // not change or add points to rMask.
-        BASEGFX_DLLPUBLIC B2DPolyPolygon addPointsAtCutsAndTouches(const B2DPolyPolygon& rMask, const B2DPolyPolygon& rCandidate);
-
         // look for intersections of rCandidate with the edge from rStart to rEnd and add extra points there.
         // Points are only added in the range of the edge, not on the endless vector.
         BASEGFX_DLLPUBLIC B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate, const B2DPoint& rStart, const B2DPoint& rEnd);
-        BASEGFX_DLLPUBLIC B2DPolyPolygon addPointsAtCuts(const B2DPolyPolygon& rCandidate, const B2DPoint& rStart, const B2DPoint& rEnd);
 
         // look for intersections of rCandidate with the mask Polygon and add extra points there.
         // The mask polygon is assumed to be closed, even when it's not explicitly.
         BASEGFX_DLLPUBLIC B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate, const B2DPolyPolygon& rMask);
-        BASEGFX_DLLPUBLIC B2DPolyPolygon addPointsAtCuts(const B2DPolyPolygon& rCandidate, const B2DPolyPolygon& rMask);
 
         // look for self-intersections in given polygon and add extra points there. Result will have no
         // intersections on an edge
         BASEGFX_DLLPUBLIC B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate);
 
-        // add points at all self-intersections of single polygons (depends on bSelfIntersections)
-        // and at polygon-polygon intersections
-        BASEGFX_DLLPUBLIC B2DPolyPolygon addPointsAtCuts(const B2DPolyPolygon& rCandidate, bool bSelfIntersections = true);
-
     } // end of namespace tools
 } // end of namespace basegfx
 
diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
index 011ecff..9ff9fe1 100644
--- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
+++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
@@ -1033,20 +1033,6 @@ namespace basegfx
 
         ////////////////////////////////////////////////////////////////////////////////
 
-        B2DPolyPolygon addPointsAtCutsAndTouches(const B2DPolyPolygon& rMask, const B2DPolyPolygon& rCandidate)
-        {
-            B2DPolyPolygon aRetval;
-
-            for(sal_uInt32 a(0L); a < rCandidate.count(); a++)
-            {
-                aRetval.append(addPointsAtCutsAndTouches(rMask, rCandidate.getB2DPolygon(a)));
-            }
-
-            return aRetval;
-        }
-
-        ////////////////////////////////////////////////////////////////////////////////
-
         B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate, const B2DPoint& rStart, const B2DPoint& rEnd)
         {
             const sal_uInt32 nCount(rCandidate.count());
@@ -1094,18 +1080,6 @@ namespace basegfx
             return rCandidate;
         }
 
-        B2DPolyPolygon addPointsAtCuts(const B2DPolyPolygon& rCandidate, const B2DPoint& rStart, const B2DPoint& rEnd)
-        {
-            B2DPolyPolygon aRetval;
-
-            for(sal_uInt32 a(0); a < rCandidate.count(); a++)
-            {
-                aRetval.append(addPointsAtCuts(rCandidate.getB2DPolygon(a), rStart, rEnd));
-            }
-
-            return aRetval;
-        }
-
         ////////////////////////////////////////////////////////////////////////////////
 
         B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate, const B2DPolyPolygon& rPolyMask)
@@ -1189,18 +1163,6 @@ namespace basegfx
             return rCandidate;
         }
 
-        B2DPolyPolygon addPointsAtCuts(const B2DPolyPolygon& rCandidate, const B2DPolyPolygon& rMask)
-        {
-            B2DPolyPolygon aRetval;
-
-            for(sal_uInt32 a(0); a < rCandidate.count(); a++)
-            {
-                aRetval.append(addPointsAtCuts(rCandidate.getB2DPolygon(a), rMask));
-            }
-
-            return aRetval;
-        }
-
         B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate)
         {
             if(rCandidate.count())
@@ -1217,80 +1179,6 @@ namespace basegfx
             }
         }
 
-        B2DPolyPolygon addPointsAtCuts(const B2DPolyPolygon& rCandidate, bool bSelfIntersections)
-        {
-            const sal_uInt32 nCount(rCandidate.count());
-
-            if(nCount)
-            {
-                B2DPolyPolygon aRetval;
-
-                if(1 == nCount)
-                {
-                    if(bSelfIntersections)
-                    {
-                        // remove self intersections
-                        aRetval.append(addPointsAtCuts(rCandidate.getB2DPolygon(0)));
-                    }
-                    else
-                    {
-                        // copy source
-                        aRetval = rCandidate;
-                    }
-                }
-                else
-                {
-                    // first solve self cuts for all contained single polygons
-                    temporaryPolygonData *pTempData = new temporaryPolygonData[nCount];
-                    sal_uInt32 a, b;
-
-                    for(a = 0; a < nCount; a++)
-                    {
-                        if(bSelfIntersections)
-                        {
-                            // use polygons with solved self intersections
-                            pTempData[a].setPolygon(addPointsAtCuts(rCandidate.getB2DPolygon(a)));
-                        }
-                        else
-                        {
-                            // copy given polygons
-                            pTempData[a].setPolygon(rCandidate.getB2DPolygon(a));
-                        }
-                    }
-
-                    // now cuts and touches between the polygons
-                    for(a = 0; a < nCount; a++)
-                    {
-                        for(b = 0; b < nCount; b++)
-                        {
-                            if(a < b)
-                            {
-                                // look for cuts, compare each edge polygon to following ones
-                                if(pTempData[a].getRange().overlaps(pTempData[b].getRange()))
-                                {
-                                    findCuts(pTempData[a].getPolygon(), pTempData[b].getPolygon(), pTempData[a].getTemporaryPointVector(), pTempData[b].getTemporaryPointVector());
-                                }
-                            }
-                        }
-                    }
-
-                    // consolidate the result
-                    for(a = 0L; a < nCount; a++)
-                    {
-                        aRetval.append(mergeTemporaryPointsAndPolygon(pTempData[a].getPolygon(), pTempData[a].getTemporaryPointVector()));
-                    }
-
-                    delete[] pTempData;
-                }
-
-                return aRetval;
-            }
-            else
-            {
-                return rCandidate;
-            }
-        }
-
         ////////////////////////////////////////////////////////////////////////////////
 
     } // end of namespace tools
diff --git a/unusedcode.easy b/unusedcode.easy
index c472c72..4f56a82 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -950,10 +950,6 @@ basegfx::maximum(basegfx::B2DHomPoint const&, basegfx::B2DHomPoint const&)
 basegfx::maximum(basegfx::B2ITuple const&, basegfx::B2ITuple const&)
 basegfx::minimum(basegfx::B2DHomPoint const&, basegfx::B2DHomPoint const&)
 basegfx::minimum(basegfx::B2ITuple const&, basegfx::B2ITuple const&)
-basegfx::tools::addPointsAtCuts(basegfx::B2DPolyPolygon const&, basegfx::B2DPoint const&, basegfx::B2DPoint const&)
-basegfx::tools::addPointsAtCuts(basegfx::B2DPolyPolygon const&, basegfx::B2DPolyPolygon const&)
-basegfx::tools::addPointsAtCuts(basegfx::B2DPolyPolygon const&, bool)
-basegfx::tools::addPointsAtCutsAndTouches(basegfx::B2DPolyPolygon const&, basegfx::B2DPolyPolygon const&)
 basegfx::tools::applyLineDashing(basegfx::B3DPolyPolygon const&, std::__debug::vector<double, std::allocator<double> > const&, basegfx::B3DPolyPolygon*, basegfx::B3DPolyPolygon*, double)
 basegfx::tools::ciexyz2rgb(basegfx::BColor const&)
 basegfx::tools::clipPolyPolygonOnEdge(basegfx::B2DPolyPolygon const&, basegfx::B2DPoint const&, basegfx::B2DPoint const&, bool, bool)
-- 
1.7.8.3



More information about the LibreOffice mailing list