From 476394e65b70902b72e4261dc211e22cf188f361 Mon Sep 17 00:00:00 2001
From: Elton Chung <elton@layerjet.com>
Date: Sun, 19 Feb 2012 15:41:32 +0800
Subject: [PATCH] Remove unused code

---
 basegfx/inc/basegfx/polygon/b2dpolygontools.hxx    |   10 -----
 .../inc/basegfx/polygon/b2dpolypolygontools.hxx    |   27 --------------
 basegfx/source/polygon/b2dpolygontools.cxx         |   37 --------------------
 basegfx/source/polygon/b2dpolypolygontools.cxx     |   26 --------------
 unusedcode.easy                                    |    4 --
 5 files changed, 0 insertions(+), 104 deletions(-)

diff --git a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
index d86abb3..1bee9b3 100644
--- a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
+++ b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
@@ -130,12 +130,6 @@ namespace basegfx
         // if 0.0 it is calculated using getLength(...)
         BASEGFX_DLLPUBLIC B2DPolygon getSnippetAbsolute(const B2DPolygon& rCandidate, double fFrom, double fTo, double fLength = 0.0);
 
-        // get a snippet from given polygon for relative distances. The polygon is assumed
-        // to be opened (not closed). fFrom and fTo need to be in range [0.0 .. 1.0], where
-        // fTo >= fFrom. If length is given, it is assumed the correct polygon length,
-        // if 0.0 it is calculated using getLength(...)
-        BASEGFX_DLLPUBLIC B2DPolygon getSnippetRelative(const B2DPolygon& rCandidate, double fFrom = 0.0, double fTo = 1.0, double fLength = 0.0);
-
         // Continuity check for point with given index
         BASEGFX_DLLPUBLIC B2VectorContinuity getContinuityInPoint(const B2DPolygon& rCandidate, sal_uInt32 nIndex);
 
@@ -351,10 +345,6 @@ namespace basegfx
         // by several trivial sub-segments
         BASEGFX_DLLPUBLIC B2DPolygon createSimplifiedPolygon(const B2DPolygon&);
 
-        // calculate the distance to the given endless ray and return. The relative position on the edge is returned in Cut.
-        // That position may be less than 0.0 or more than 1.0
-        BASEGFX_DLLPUBLIC double getDistancePointToEndlessRay(const B2DPoint& rPointA, const B2DPoint& rPointB, const B2DPoint& rTestPoint, double& rCut);
-
         // calculate the smallest distance to given edge and return. The relative position on the edge is returned in Cut.
         // That position is in the range [0.0 .. 1.0] and the returned distance is adapted accordingly to the start or end
         // point of the edge
diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx
index 37d2cb5..6962596 100644
--- a/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx
+++ b/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx
@@ -78,19 +78,6 @@ namespace basegfx
         // in bWithBorder flag. It is assumed that the orientations of the given polygon are correct.
         BASEGFX_DLLPUBLIC bool isInside(const B2DPolyPolygon& rCandidate, const B2DPoint& rPoint, bool bWithBorder = false);
 
-        /** get range of PolyPolygon. Control points are included.
-
-            For detailed description look at getRangeWithControlPoints(const B2DPolygon&).
-            This method just expands by the range of every sub-Polygon.
-
-            @param rCandidate
-            The B2DPolyPolygon eventually containing bezier segments
-
-            @return
-            The outer range including control points
-        */
-        BASEGFX_DLLPUBLIC B2DRange getRangeWithControlPoints(const B2DPolyPolygon& rCandidate);
-
         /** Get the range of a polyPolygon
 
             For detailed description look at getRange(const B2DPolygon&).
@@ -241,20 +228,6 @@ namespace basegfx
         // #i76891# Try to remove existing curve segments if they are simply edges
         BASEGFX_DLLPUBLIC B2DPolyPolygon simplifyCurveSegments(const B2DPolyPolygon& rCandidate);
 
-        /** split each edge of a polyPolygon in exactly nSubEdges equidistant edges
-
-            @param rCandidate
-            The source polyPolygon. If too small (no edges), nSubEdges too small (<2)
-            or neither bHandleCurvedEdgesnor bHandleStraightEdges it will just be returned.
-            Else for each edge nSubEdges will be created. Closed state is preserved.
-
-            @param nSubEdges
-            @param bHandleCurvedEdges
-            @param bHandleStraightEdges
-            Please take a look at reSegmentPolygonEdges description, these are the same.
-        */
-        BASEGFX_DLLPUBLIC B2DPolyPolygon reSegmentPolyPolygonEdges(const B2DPolyPolygon& rCandidate, sal_uInt32 nSubEdges, bool bHandleCurvedEdges, bool bHandleStraightEdges);
-
         //////////////////////////////////////////////////////////////////////
         // comparators with tolerance for 2D PolyPolygons
         BASEGFX_DLLPUBLIC bool equal(const B2DPolyPolygon& rCandidateA, const B2DPolyPolygon& rCandidateB, const double& rfSmallValue);
diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx
index c8d2b37..2104a53 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -978,19 +978,6 @@ namespace basegfx
             }
         }
 
-        B2DPolygon getSnippetRelative(const B2DPolygon& rCandidate, double fFrom, double fTo, double fLength)
-        {
-            // get length if not given
-            if(fTools::equalZero(fLength))
-            {
-                fLength = getLength(rCandidate);
-            }
-
-            // multiply distances with real length to get absolute position and
-            // use getSnippetAbsolute
-            return getSnippetAbsolute(rCandidate, fFrom * fLength, fTo * fLength, fLength);
-        }
-
         CutFlagValue findCut(
             const B2DPolygon& rCandidate,
             sal_uInt32 nIndex1, sal_uInt32 nIndex2,
@@ -2499,30 +2486,6 @@ namespace basegfx
             return aRetval;
         }
 
-        double getDistancePointToEndlessRay(const B2DPoint& rPointA, const B2DPoint& rPointB, const B2DPoint& rTestPoint, double& rCut)
-        {
-            if(rPointA.equal(rPointB))
-            {
-                rCut = 0.0;
-                const B2DVector aVector(rTestPoint - rPointA);
-                return aVector.getLength();
-            }
-            else
-            {
-                // get the relative cut value on line vector (Vector1) for cut with perpendicular through TestPoint
-                const B2DVector aVector1(rPointB - rPointA);
-                const B2DVector aVector2(rTestPoint - rPointA);
-                const double fDividend((aVector2.getX() * aVector1.getX()) + (aVector2.getY() * aVector1.getY()));
-                const double fDivisor((aVector1.getX() * aVector1.getX()) + (aVector1.getY() * aVector1.getY()));
-
-                rCut = fDividend / fDivisor;
-
-                const B2DPoint aCutPoint(rPointA + rCut * aVector1);
-                const B2DVector aVector(rTestPoint - aCutPoint);
-                return aVector.getLength();
-            }
-        }
-
         double getSmallestDistancePointToEdge(const B2DPoint& rPointA, const B2DPoint& rPointB, const B2DPoint& rTestPoint, double& rCut)
         {
             if(rPointA.equal(rPointB))
diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx
index e372f72..c49f6a8 100644
--- a/basegfx/source/polygon/b2dpolypolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolypolygontools.cxx
@@ -238,20 +238,6 @@ namespace basegfx
             }
         }
 
-        B2DRange getRangeWithControlPoints(const B2DPolyPolygon& rCandidate)
-        {
-            B2DRange aRetval;
-            const sal_uInt32 nPolygonCount(rCandidate.count());
-
-            for(sal_uInt32 a(0L); a < nPolygonCount; a++)
-            {
-                B2DPolygon aCandidate = rCandidate.getB2DPolygon(a);
-                aRetval.expand(tools::getRangeWithControlPoints(aCandidate));
-            }
-
-            return aRetval;
-        }
-
         B2DRange getRange(const B2DPolyPolygon& rCandidate)
         {
             B2DRange aRetval;
@@ -526,18 +512,6 @@ namespace basegfx
             }
         }
 
-        B2DPolyPolygon reSegmentPolyPolygonEdges(const B2DPolyPolygon& rCandidate, sal_uInt32 nSubEdges, bool bHandleCurvedEdges, bool bHandleStraightEdges)
-        {
-            B2DPolyPolygon aRetval;
-
-            for(sal_uInt32 a(0L); a < rCandidate.count(); a++)
-            {
-                aRetval.append(reSegmentPolygonEdges(rCandidate.getB2DPolygon(a), nSubEdges, bHandleCurvedEdges, bHandleStraightEdges));
-            }
-
-            return aRetval;
-        }
-
         //////////////////////////////////////////////////////////////////////
         // comparators with tolerance for 2D PolyPolygons
 
diff --git a/unusedcode.easy b/unusedcode.easy
index fc86475..d3c8550 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -644,17 +644,13 @@ basegfx::tools::findCut(basegfx::B2DPolygon const&, unsigned int, basegfx::B2DPo
 basegfx::tools::findCut(basegfx::B2DPolygon const&, unsigned int, unsigned int, unsigned short, double*, double*)
 basegfx::tools::getArea(basegfx::B3DPolygon const&)
 basegfx::tools::getCutBetweenLineAndPolygon(basegfx::B3DPolygon const&, basegfx::B3DPoint const&, basegfx::B3DPoint const&, double&)
-basegfx::tools::getDistancePointToEndlessRay(basegfx::B2DPoint const&, basegfx::B2DPoint const&, basegfx::B2DPoint const&, double&)
 basegfx::tools::getIndexOfPredecessor(unsigned int, basegfx::B3DPolygon const&)
 basegfx::tools::getPositionRelative(basegfx::B3DPolygon const&, double, double)
 basegfx::tools::getPositiveOrientedNormal(basegfx::B3DPolygon const&)
-basegfx::tools::getRangeWithControlPoints(basegfx::B2DPolyPolygon const&)
-basegfx::tools::getSnippetRelative(basegfx::B2DPolygon const&, double, double, double)
 basegfx::tools::isInEpsilonRange(basegfx::B3DPolygon const&, basegfx::B3DPoint const&, double)
 basegfx::tools::isInside(basegfx::B3DPolygon const&, basegfx::B3DPolygon const&, bool)
 basegfx::tools::isPolyPolygonEqualRectangle(basegfx::B2DPolyPolygon const&, basegfx::B2DRange const&)
 basegfx::tools::liangBarskyClip2D(basegfx::B2DPoint&, basegfx::B2DPoint&, basegfx::B2DRange const&)
-basegfx::tools::reSegmentPolyPolygonEdges(basegfx::B2DPolyPolygon const&, unsigned int, bool, bool)
 basegfx::tools::rotateAroundPoint(basegfx::B2DPolyPolygon const&, basegfx::B2DPoint const&, double)
 basegfx::tools::setContinuity(basegfx::B2DPolyPolygon const&, basegfx::B2VectorContinuity)
 basegfx::tools::solveCrossovers(basegfx::B2DPolygon const&)
-- 
1.7.7.msysgit.1

