[Libreoffice-commits] .: basegfx/inc basegfx/source unusedcode.easy

Michael Meeks michael at kemper.freedesktop.org
Mon Feb 20 04:10:47 PST 2012


 basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx    |    2 
 basegfx/inc/basegfx/polygon/b2dpolygontools.hxx     |   58 ---
 basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx |    4 
 basegfx/inc/basegfx/polygon/b3dpolygontools.hxx     |    5 
 basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx |    1 
 basegfx/inc/basegfx/tools/tools.hxx                 |   24 -
 basegfx/source/matrix/b2dhommatrixtools.cxx         |   24 -
 basegfx/source/polygon/b2dpolygontools.cxx          |  302 --------------------
 basegfx/source/polygon/b2dpolypolygontools.cxx      |   22 -
 basegfx/source/polygon/b3dpolygontools.cxx          |   99 ------
 basegfx/source/polygon/b3dpolypolygontools.cxx      |    7 
 basegfx/source/tools/liangbarsky.cxx                |   57 ---
 unusedcode.easy                                     |   14 
 13 files changed, 619 deletions(-)

New commits:
commit dbff99a60ec5268c92f1404cb01754de9186c2e8
Author: Elton Chung <elton at layerjet.com>
Date:   Mon Feb 20 00:30:16 2012 +0800

    Remove unused code

diff --git a/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx b/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx
index e53a598..cf49df0 100644
--- a/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx
+++ b/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx
@@ -56,8 +56,6 @@ namespace basegfx
             multiplications
          */
         BASEGFX_DLLPUBLIC B2DHomMatrix createScaleB2DHomMatrix(double fScaleX, double fScaleY);
-        BASEGFX_DLLPUBLIC B2DHomMatrix createShearXB2DHomMatrix(double fShearX);
-        BASEGFX_DLLPUBLIC B2DHomMatrix createShearYB2DHomMatrix(double fShearY);
         BASEGFX_DLLPUBLIC B2DHomMatrix createRotateB2DHomMatrix(double fRadiant);
         BASEGFX_DLLPUBLIC B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY);
 
diff --git a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
index 1bee9b3..86c31f3 100644
--- a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
+++ b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
@@ -154,23 +154,6 @@ namespace basegfx
         #define CUTFLAG_ALL         (CUTFLAG_LINE|CUTFLAG_START1|CUTFLAG_START2|CUTFLAG_END1|CUTFLAG_END2)
         #define CUTFLAG_DEFAULT     (CUTFLAG_LINE|CUTFLAG_START2|CUTFLAG_END2)
 
-        // Calculate cut between the points given by the two indices. pCut1
-        // and pCut2 will contain the cut coordinate on each edge in ]0.0, 1.0]
-        // (if given) and the return value will contain a cut description.
-        BASEGFX_DLLPUBLIC CutFlagValue findCut(
-            const B2DPolygon& rCandidate,
-            sal_uInt32 nIndex1, sal_uInt32 nIndex2,
-            CutFlagValue aCutFlags = CUTFLAG_DEFAULT,
-            double* pCut1 = 0L, double* pCut2 = 0L);
-
-        // This version is working with two indexed edges from different
-        // polygons.
-        BASEGFX_DLLPUBLIC CutFlagValue findCut(
-            const B2DPolygon& rCandidate1, sal_uInt32 nIndex1,
-            const B2DPolygon& rCandidate2, sal_uInt32 nIndex2,
-            CutFlagValue aCutFlags = CUTFLAG_DEFAULT,
-            double* pCut1 = 0L, double* pCut2 = 0L);
-
         // This version works with two points and vectors to define the
         // edges for the cut test.
         BASEGFX_DLLPUBLIC CutFlagValue findCut(
@@ -245,17 +228,6 @@ namespace basegfx
             @param rRect
             The rectangle which describes the polygon size
 
-            @param fRadius
-            Radius of the edge rounding, relative to the rectangle size. 0.0 means no
-            rounding, 1.0 will lead to an ellipse
-         */
-        BASEGFX_DLLPUBLIC B2DPolygon createPolygonFromRect( const B2DRectangle& rRect, double fRadius );
-
-        /** Create a polygon from a rectangle.
-
-            @param rRect
-            The rectangle which describes the polygon size
-
             @param fRadiusX
             @param fRadiusY
             Radius of the edge rounding, relative to the rectangle size. 0.0 means no
@@ -340,11 +312,6 @@ namespace basegfx
         // matrix and the resulting x,y is used to form the new polygon.
         BASEGFX_DLLPUBLIC B2DPolygon createB2DPolygonFromB3DPolygon(const B3DPolygon& rCandidate, const B3DHomMatrix& rMat);
 
-        // create simplified version of the original polygon by
-        // replacing segments with spikes/loops and self intersections
-        // by several trivial sub-segments
-        BASEGFX_DLLPUBLIC B2DPolygon createSimplifiedPolygon(const B2DPolygon&);
-
         // 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
@@ -422,8 +389,6 @@ namespace basegfx
         // organisation, e.g. same amount of points
         BASEGFX_DLLPUBLIC B2DPolygon interpolate(const B2DPolygon& rOld1, const B2DPolygon& rOld2, double t);
 
-        BASEGFX_DLLPUBLIC bool isPolyPolygonEqualRectangle( const B2DPolyPolygon& rPolyPoly, const B2DRange& rRect );
-
         // #i76891# Try to remove existing curve segments if they are simply edges
         BASEGFX_DLLPUBLIC B2DPolygon simplifyCurveSegments(const B2DPolygon& rCandidate);
 
@@ -479,32 +444,9 @@ namespace basegfx
         */
         BASEGFX_DLLPUBLIC B2DPolygon createWaveline(const B2DPolygon& rCandidate, double fWaveWidth, double fWaveHeight);
 
-        /** split each edge of a polygon in exactly nSubEdges equidistant edges
-
-            @param rCandidate
-            The source polygon. 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
-            How many edges shall be created as replacement for each single edge
-
-            @param bHandleCurvedEdges
-            Process curved edges or not. If to handle the curved edges will be splitted
-            into nSubEdges part curved edges of equidistant bezier distances. If not,
-            curved edges will just be copied.
-
-            @param bHandleStraightEdges
-            Process straight edges or not. If to handle the straight edges will be splitted
-            into nSubEdges part curved edges of equidistant length. If not,
-            straight edges will just be copied.
-        */
-        BASEGFX_DLLPUBLIC B2DPolygon reSegmentPolygonEdges(const B2DPolygon& rCandidate, sal_uInt32 nSubEdges, bool bHandleCurvedEdges, bool bHandleStraightEdges);
-
         //////////////////////////////////////////////////////////////////////
         // comparators with tolerance for 2D Polygons
         BASEGFX_DLLPUBLIC bool equal(const B2DPolygon& rCandidateA, const B2DPolygon& rCandidateB, const double& rfSmallValue);
-        BASEGFX_DLLPUBLIC bool equal(const B2DPolygon& rCandidateA, const B2DPolygon& rCandidateB);
 
         /** snap some polygon coordinates to discrete coordinates
 
diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx
index 6962596..d36f804 100644
--- a/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx
+++ b/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx
@@ -175,9 +175,6 @@ namespace basegfx
         // corresponding points.
         BASEGFX_DLLPUBLIC B2DPolyPolygon distort(const B2DPolyPolygon& rCandidate, const B2DRange& rOriginal, const B2DPoint& rTopLeft, const B2DPoint& rTopRight, const B2DPoint& rBottomLeft, const B2DPoint& rBottomRight);
 
-        // rotate PolyPolygon around given point with given angle.
-        BASEGFX_DLLPUBLIC B2DPolyPolygon rotateAroundPoint(const B2DPolyPolygon& rCandidate, const B2DPoint& rCenter, double fAngle);
-
         // expand all segments (which are not yet) to curve segments. This is done with setting the control
         // vectors on the 1/3 resp. 2/3 distances on each segment.
         BASEGFX_DLLPUBLIC B2DPolyPolygon expandToCurve(const B2DPolyPolygon& rCandidate);
@@ -231,7 +228,6 @@ namespace basegfx
         //////////////////////////////////////////////////////////////////////
         // comparators with tolerance for 2D PolyPolygons
         BASEGFX_DLLPUBLIC bool equal(const B2DPolyPolygon& rCandidateA, const B2DPolyPolygon& rCandidateB, const double& rfSmallValue);
-        BASEGFX_DLLPUBLIC bool equal(const B2DPolyPolygon& rCandidateA, const B2DPolyPolygon& rCandidateB);
 
         /** snap some polygon coordinates to discrete coordinates
 
diff --git a/basegfx/inc/basegfx/polygon/b3dpolygontools.hxx b/basegfx/inc/basegfx/polygon/b3dpolygontools.hxx
index defaae8..95e00fb 100644
--- a/basegfx/inc/basegfx/polygon/b3dpolygontools.hxx
+++ b/basegfx/inc/basegfx/polygon/b3dpolygontools.hxx
@@ -85,11 +85,6 @@ namespace basegfx
         // get length of polygon
         BASEGFX_DLLPUBLIC double getLength(const B3DPolygon& rCandidate);
 
-        // get position on polygon for absolute given distance. If
-        // length is given, it is assumed the correct polygon length, if 0.0 it is calculated
-        // using getLength(...)
-        BASEGFX_DLLPUBLIC B3DPoint getPositionAbsolute(const B3DPolygon& rCandidate, double fDistance, double fLength = 0.0);
-
         /** Apply given LineDashing to given polygon
 
             For a description see applyLineDashing in b2dpolygontoos.hxx
diff --git a/basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx b/basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx
index 1ff1b4b..6ccfea1 100644
--- a/basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx
+++ b/basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx
@@ -148,7 +148,6 @@ namespace basegfx
         //////////////////////////////////////////////////////////////////////
         // comparators with tolerance for 3D PolyPolygons
         BASEGFX_DLLPUBLIC bool equal(const B3DPolyPolygon& rCandidateA, const B3DPolyPolygon& rCandidateB, const double& rfSmallValue);
-        BASEGFX_DLLPUBLIC bool equal(const B3DPolyPolygon& rCandidateA, const B3DPolyPolygon& rCandidateB);
 
     } // end of namespace tools
 } // end of namespace basegfx
diff --git a/basegfx/inc/basegfx/tools/tools.hxx b/basegfx/inc/basegfx/tools/tools.hxx
index c6abc57..f4ff85d 100644
--- a/basegfx/inc/basegfx/tools/tools.hxx
+++ b/basegfx/inc/basegfx/tools/tools.hxx
@@ -39,30 +39,6 @@ namespace basegfx
 
     namespace tools
     {
-        /** Liang-Barsky 2D line clipping algorithm
-
-            This function clips a line given by two points against the
-            given rectangle. The resulting line is returned in the
-            given points.
-
-            @param io_rStart
-            Start point of the line. On return, contains the clipped
-            start point.
-
-            @param io_rEnd
-            End point of the line. On return, contains the clipped
-            end point.
-
-            @param rClipRect
-            The rectangle to clip against
-
-            @return true, when at least part of the line is visible
-            after the clip, false otherwise
-         */
-        BASEGFX_DLLPUBLIC bool liangBarskyClip2D( ::basegfx::B2DPoint&      io_rStart,
-                                ::basegfx::B2DPoint&        io_rEnd,
-                                const ::basegfx::B2DRange&  rClipRect );
-
         /** Expand given parallelogram, such that it extends beyond
             bound rect in a given direction.
 
diff --git a/basegfx/source/matrix/b2dhommatrixtools.cxx b/basegfx/source/matrix/b2dhommatrixtools.cxx
index 2612d9f..b36731d 100644
--- a/basegfx/source/matrix/b2dhommatrixtools.cxx
+++ b/basegfx/source/matrix/b2dhommatrixtools.cxx
@@ -96,30 +96,6 @@ namespace basegfx
             return aRetval;
         }
 
-        B2DHomMatrix createShearXB2DHomMatrix(double fShearX)
-        {
-            B2DHomMatrix aRetval;
-
-            if(!fTools::equalZero(fShearX))
-            {
-                aRetval.set(0, 1, fShearX);
-            }
-
-            return aRetval;
-        }
-
-        B2DHomMatrix createShearYB2DHomMatrix(double fShearY)
-        {
-            B2DHomMatrix aRetval;
-
-            if(!fTools::equalZero(fShearY))
-            {
-                aRetval.set(1, 0, fShearY);
-            }
-
-            return aRetval;
-        }
-
         B2DHomMatrix createRotateB2DHomMatrix(double fRadiant)
         {
             B2DHomMatrix aRetval;
diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx
index 2104a53..73f920f 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -979,67 +979,6 @@ namespace basegfx
         }
 
         CutFlagValue findCut(
-            const B2DPolygon& rCandidate,
-            sal_uInt32 nIndex1, sal_uInt32 nIndex2,
-            CutFlagValue aCutFlags,
-            double* pCut1, double* pCut2)
-        {
-            CutFlagValue aRetval(CUTFLAG_NONE);
-            const sal_uInt32 nPointCount(rCandidate.count());
-
-            if(nIndex1 < nPointCount && nIndex2 < nPointCount && nIndex1 != nIndex2)
-            {
-                sal_uInt32 nEnd1(getIndexOfSuccessor(nIndex1, rCandidate));
-                sal_uInt32 nEnd2(getIndexOfSuccessor(nIndex2, rCandidate));
-
-                const B2DPoint aStart1(rCandidate.getB2DPoint(nIndex1));
-                const B2DPoint aEnd1(rCandidate.getB2DPoint(nEnd1));
-                const B2DVector aVector1(aEnd1 - aStart1);
-
-                const B2DPoint aStart2(rCandidate.getB2DPoint(nIndex2));
-                const B2DPoint aEnd2(rCandidate.getB2DPoint(nEnd2));
-                const B2DVector aVector2(aEnd2 - aStart2);
-
-                aRetval = findCut(
-                    aStart1, aVector1, aStart2, aVector2,
-                    aCutFlags, pCut1, pCut2);
-            }
-
-            return aRetval;
-        }
-
-        CutFlagValue findCut(
-            const B2DPolygon& rCandidate1, sal_uInt32 nIndex1,
-            const B2DPolygon& rCandidate2, sal_uInt32 nIndex2,
-            CutFlagValue aCutFlags,
-            double* pCut1, double* pCut2)
-        {
-            CutFlagValue aRetval(CUTFLAG_NONE);
-            const sal_uInt32 nPointCount1(rCandidate1.count());
-            const sal_uInt32 nPointCount2(rCandidate2.count());
-
-            if(nIndex1 < nPointCount1 && nIndex2 < nPointCount2)
-            {
-                sal_uInt32 nEnd1(getIndexOfSuccessor(nIndex1, rCandidate1));
-                sal_uInt32 nEnd2(getIndexOfSuccessor(nIndex2, rCandidate2));
-
-                const B2DPoint aStart1(rCandidate1.getB2DPoint(nIndex1));
-                const B2DPoint aEnd1(rCandidate1.getB2DPoint(nEnd1));
-                const B2DVector aVector1(aEnd1 - aStart1);
-
-                const B2DPoint aStart2(rCandidate2.getB2DPoint(nIndex2));
-                const B2DPoint aEnd2(rCandidate2.getB2DPoint(nEnd2));
-                const B2DVector aVector2(aEnd2 - aStart2);
-
-                aRetval = findCut(
-                    aStart1, aVector1, aStart2, aVector2,
-                    aCutFlags, pCut1, pCut2);
-            }
-
-            return aRetval;
-        }
-
-        CutFlagValue findCut(
             const B2DPoint& rEdge1Start, const B2DVector& rEdge1Delta,
             const B2DPoint& rEdge2Start, const B2DVector& rEdge2Delta,
             CutFlagValue aCutFlags,
@@ -1663,32 +1602,6 @@ namespace basegfx
             return false;
         }
 
-        B2DPolygon createPolygonFromRect( const B2DRectangle& rRect, double fRadius )
-        {
-            const double fZero(0.0);
-            const double fOne(1.0);
-
-            if(fTools::lessOrEqual(fRadius, fZero))
-            {
-                // no radius, use rectangle
-                return createPolygonFromRect( rRect );
-            }
-            else if(fTools::moreOrEqual(fRadius, fOne))
-            {
-                // full radius, use ellipse
-                const B2DPoint aCenter(rRect.getCenter());
-                const double fRadiusX(rRect.getWidth() / 2.0);
-                const double fRadiusY(rRect.getHeight() / 2.0);
-
-                return createPolygonFromEllipse( aCenter, fRadiusX, fRadiusY );
-            }
-            else
-            {
-                // create rectangle with two radii between ]0.0 .. 1.0[
-                return createPolygonFromRect( rRect, fRadius, fRadius );
-            }
-        }
-
         B2DPolygon createPolygonFromRect( const B2DRectangle& rRect, double fRadiusX, double fRadiusY )
         {
             const double fZero(0.0);
@@ -2977,81 +2890,6 @@ namespace basegfx
             return aRetval;
         }
 
-        B2DPolygon reSegmentPolygonEdges(const B2DPolygon& rCandidate, sal_uInt32 nSubEdges, bool bHandleCurvedEdges, bool bHandleStraightEdges)
-        {
-            const sal_uInt32 nPointCount(rCandidate.count());
-
-            if(nPointCount < 2 || nSubEdges < 2 || (!bHandleCurvedEdges && !bHandleStraightEdges))
-            {
-                // nothing to do:
-                // - less than two points -> no edge at all
-                // - less than two nSubEdges -> no resegment necessary
-                // - neither bHandleCurvedEdges nor bHandleStraightEdges -> nothing to do
-                return rCandidate;
-            }
-            else
-            {
-                B2DPolygon aRetval;
-                const sal_uInt32 nEdgeCount(rCandidate.isClosed() ? nPointCount : nPointCount - 1);
-                B2DCubicBezier aCurrentEdge;
-
-                // prepare first edge and add start point to target
-                aCurrentEdge.setStartPoint(rCandidate.getB2DPoint(0));
-                aRetval.append(aCurrentEdge.getStartPoint());
-
-                for(sal_uInt32 a(0); a < nEdgeCount; a++)
-                {
-                    // fill edge
-                    const sal_uInt32 nNextIndex((a + 1) % nPointCount);
-                    aCurrentEdge.setControlPointA(rCandidate.getNextControlPoint(a));
-                    aCurrentEdge.setControlPointB(rCandidate.getPrevControlPoint(nNextIndex));
-                    aCurrentEdge.setEndPoint(rCandidate.getB2DPoint(nNextIndex));
-
-                    if(aCurrentEdge.isBezier())
-                    {
-                        if(bHandleCurvedEdges)
-                        {
-                            for(sal_uInt32 b(nSubEdges); b > 1; b--)
-                            {
-                                const double fSplitPoint(1.0 / b);
-                                B2DCubicBezier aLeftPart;
-
-                                aCurrentEdge.split(fSplitPoint, &aLeftPart, &aCurrentEdge);
-                                aRetval.appendBezierSegment(aLeftPart.getControlPointA(), aLeftPart.getControlPointB(), aLeftPart.getEndPoint());
-                            }
-                        }
-
-                        // copy remaining segment to target
-                        aRetval.appendBezierSegment(aCurrentEdge.getControlPointA(), aCurrentEdge.getControlPointB(), aCurrentEdge.getEndPoint());
-                    }
-                    else
-                    {
-                        if(bHandleStraightEdges)
-                        {
-                            for(sal_uInt32 b(nSubEdges); b > 1; b--)
-                            {
-                                const double fSplitPoint(1.0 / b);
-                                const B2DPoint aSplitPoint(interpolate(aCurrentEdge.getStartPoint(), aCurrentEdge.getEndPoint(), fSplitPoint));
-
-                                aRetval.append(aSplitPoint);
-                                aCurrentEdge.setStartPoint(aSplitPoint);
-                            }
-                        }
-
-                        // copy remaining segment to target
-                        aRetval.append(aCurrentEdge.getEndPoint());
-                    }
-
-                    // prepare next step
-                    aCurrentEdge.setStartPoint(aCurrentEdge.getEndPoint());
-                }
-
-                // copy closed flag and return
-                aRetval.setClosed(rCandidate.isClosed());
-                return aRetval;
-            }
-        }
-
         B2DPolygon interpolate(const B2DPolygon& rOld1, const B2DPolygon& rOld2, double t)
         {
             OSL_ENSURE(rOld1.count() == rOld2.count(), "B2DPolygon interpolate: Different geometry (!)");
@@ -3085,139 +2923,6 @@ namespace basegfx
             }
         }
 
-        bool isPolyPolygonEqualRectangle( const B2DPolyPolygon& rPolyPoly,
-                                          const B2DRange&      rRect )
-        {
-            // exclude some cheap cases first
-            if( rPolyPoly.count() != 1 )
-                return false;
-
-            // fill array with rectangle vertices
-            const B2DPoint aPoints[] =
-              {
-                  B2DPoint(rRect.getMinX(),rRect.getMinY()),
-                  B2DPoint(rRect.getMaxX(),rRect.getMinY()),
-                  B2DPoint(rRect.getMaxX(),rRect.getMaxY()),
-                  B2DPoint(rRect.getMinX(),rRect.getMaxY())
-              };
-
-            const B2DPolygon& rPoly( rPolyPoly.getB2DPolygon(0) );
-            const sal_uInt32 nCount( rPoly.count() );
-            const double epsilon = ::std::numeric_limits<double>::epsilon();
-
-            for(unsigned int j=0; j<4; ++j)
-            {
-                const B2DPoint &p1 = aPoints[j];
-                const B2DPoint &p2 = aPoints[(j+1)%4];
-                bool bPointOnBoundary = false;
-                for( sal_uInt32 i=0; i<nCount; ++i )
-                {
-                    const B2DPoint p(rPoly.getB2DPoint(i));
-
-                    //     1 | x0 y0 1 |
-                    // A = - | x1 y1 1 |
-                    //     2 | x2 y2 1 |
-                    double fDoubleArea = p2.getX()*p.getY() -
-                                         p2.getY()*p.getX() -
-                                         p1.getX()*p.getY() +
-                                         p1.getY()*p.getX() +
-                                         p1.getX()*p2.getY() -
-                                         p1.getY()*p2.getX();
-
-                    if(fDoubleArea < epsilon)
-                    {
-                        bPointOnBoundary=true;
-                        break;
-                    }
-                }
-                if(!(bPointOnBoundary))
-                    return false;
-            }
-
-            return true;
-        }
-
-
-        // create simplified version of the original polygon by
-        // replacing segments with spikes/loops and self intersections
-        // by several trivial sub-segments
-        B2DPolygon createSimplifiedPolygon( const B2DPolygon& rCandidate )
-        {
-            const sal_uInt32 nCount(rCandidate.count());
-
-            if(nCount && rCandidate.areControlPointsUsed())
-            {
-                const sal_uInt32 nEdgeCount(rCandidate.isClosed() ? nCount : nCount - 1);
-                B2DPolygon aRetval;
-                B2DCubicBezier aSegment;
-
-                aSegment.setStartPoint(rCandidate.getB2DPoint(0));
-                aRetval.append(aSegment.getStartPoint());
-
-                for(sal_uInt32 a(0); a < nEdgeCount; a++)
-                {
-                    // fill edge
-                    const sal_uInt32 nNextIndex((a + 1) % nCount);
-                    aSegment.setControlPointA(rCandidate.getNextControlPoint(a));
-                    aSegment.setControlPointB(rCandidate.getPrevControlPoint(nNextIndex));
-                    aSegment.setEndPoint(rCandidate.getB2DPoint(nNextIndex));
-
-                    if(aSegment.isBezier())
-                    {
-                        double fExtremumPos(0.0);
-                        sal_uInt32 nExtremumCounter(4);
-
-                        while(nExtremumCounter-- && aSegment.isBezier() && aSegment.getMinimumExtremumPosition(fExtremumPos))
-                        {
-                            // split off left, now extremum-free part and append
-                            B2DCubicBezier aLeft;
-
-                            aSegment.split(fExtremumPos, &aLeft, &aSegment);
-                            aLeft.testAndSolveTrivialBezier();
-                            aSegment.testAndSolveTrivialBezier();
-
-                            if(aLeft.isBezier())
-                            {
-                                aRetval.appendBezierSegment(aLeft.getControlPointA(), aLeft.getControlPointB(), aLeft.getEndPoint());
-                            }
-                            else
-                            {
-                                aRetval.append(aLeft.getEndPoint());
-                            }
-                        }
-
-                        // append (evtl. reduced) rest of Segment
-                        if(aSegment.isBezier())
-                        {
-                            aRetval.appendBezierSegment(aSegment.getControlPointA(), aSegment.getControlPointB(), aSegment.getEndPoint());
-                        }
-                        else
-                        {
-                            aRetval.append(aSegment.getEndPoint());
-                        }
-                    }
-                    else
-                    {
-                        // simple edge, append end point
-                        aRetval.append(aSegment.getEndPoint());
-                    }
-
-                    // prepare next edge
-                    aSegment.setStartPoint(aSegment.getEndPoint());
-                }
-
-                // copy closed flag and check for double points
-                aRetval.setClosed(rCandidate.isClosed());
-                aRetval.removeDoublePoints();
-
-                return aRetval;
-            }
-            else
-            {
-                return rCandidate;
-            }
-        }
-
         // #i76891#
         B2DPolygon simplifyCurveSegments(const B2DPolygon& rCandidate)
         {
@@ -3511,13 +3216,6 @@ namespace basegfx
             return true;
         }
 
-        bool equal(const B2DPolygon& rCandidateA, const B2DPolygon& rCandidateB)
-        {
-            const double fSmallValue(fTools::getSmallValue());
-
-            return equal(rCandidateA, rCandidateB, fSmallValue);
-        }
-
         // snap points of horizontal or vertical edges to discrete values
         B2DPolygon snapPointsOfHorizontalOrVerticalEdges(const B2DPolygon& rCandidate)
         {
diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx
index c49f6a8..34721d2 100644
--- a/basegfx/source/polygon/b2dpolypolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolypolygontools.cxx
@@ -382,21 +382,6 @@ namespace basegfx
             return aRetval;
         }
 
-        B2DPolyPolygon rotateAroundPoint(const B2DPolyPolygon& rCandidate, const B2DPoint& rCenter, double fAngle)
-        {
-            const sal_uInt32 nPolygonCount(rCandidate.count());
-            B2DPolyPolygon aRetval;
-
-            for(sal_uInt32 a(0L); a < nPolygonCount; a++)
-            {
-                const B2DPolygon aCandidate(rCandidate.getB2DPolygon(a));
-
-                aRetval.append(rotateAroundPoint(aCandidate, rCenter, fAngle));
-            }
-
-            return aRetval;
-        }
-
         B2DPolyPolygon expandToCurve(const B2DPolyPolygon& rCandidate)
         {
             const sal_uInt32 nPolygonCount(rCandidate.count());
@@ -533,13 +518,6 @@ namespace basegfx
             return true;
         }
 
-        bool equal(const B2DPolyPolygon& rCandidateA, const B2DPolyPolygon& rCandidateB)
-        {
-            const double fSmallValue(fTools::getSmallValue());
-
-            return equal(rCandidateA, rCandidateB, fSmallValue);
-        }
-
         B2DPolyPolygon snapPointsOfHorizontalOrVerticalEdges(const B2DPolyPolygon& rCandidate)
         {
             B2DPolyPolygon aRetval;
diff --git a/basegfx/source/polygon/b3dpolygontools.cxx b/basegfx/source/polygon/b3dpolygontools.cxx
index b31712a..65a7f6b 100644
--- a/basegfx/source/polygon/b3dpolygontools.cxx
+++ b/basegfx/source/polygon/b3dpolygontools.cxx
@@ -217,105 +217,6 @@ namespace basegfx
             return fRetval;
         }
 
-        B3DPoint getPositionAbsolute(const B3DPolygon& rCandidate, double fDistance, double fLength)
-        {
-            B3DPoint aRetval;
-            const sal_uInt32 nPointCount(rCandidate.count());
-
-            if(nPointCount > 1L)
-            {
-                sal_uInt32 nIndex(0L);
-                bool bIndexDone(false);
-                const double fZero(0.0);
-                double fEdgeLength(fZero);
-
-                // get length if not given
-                if(fTools::equalZero(fLength))
-                {
-                    fLength = getLength(rCandidate);
-                }
-
-                // handle fDistance < 0.0
-                if(fTools::less(fDistance, fZero))
-                {
-                    if(rCandidate.isClosed())
-                    {
-                        // if fDistance < 0.0 increment with multiple of fLength
-                        sal_uInt32 nCount(sal_uInt32(-fDistance / fLength));
-                        fDistance += double(nCount + 1L) * fLength;
-                    }
-                    else
-                    {
-                        // crop to polygon start
-                        fDistance = fZero;
-                        bIndexDone = true;
-                    }
-                }
-
-                // handle fDistance >= fLength
-                if(fTools::moreOrEqual(fDistance, fLength))
-                {
-                    if(rCandidate.isClosed())
-                    {
-                        // if fDistance >= fLength decrement with multiple of fLength
-                        sal_uInt32 nCount(sal_uInt32(fDistance / fLength));
-                        fDistance -= (double)(nCount) * fLength;
-                    }
-                    else
-                    {
-                        // crop to polygon end
-                        fDistance = fZero;
-                        nIndex = nPointCount - 1L;
-                        bIndexDone = true;
-                    }
-                }
-
-                // look for correct index. fDistance is now [0.0 .. fLength[
-                if(!bIndexDone)
-                {
-                    do
-                    {
-                        // get length of next edge
-                        fEdgeLength = getEdgeLength(rCandidate, nIndex);
-
-                        if(fTools::moreOrEqual(fDistance, fEdgeLength))
-                        {
-                            // go to next edge
-                            fDistance -= fEdgeLength;
-                            nIndex++;
-                        }
-                        else
-                        {
-                            // it's on this edge, stop
-                            bIndexDone = true;
-                        }
-                    } while (!bIndexDone);
-                }
-
-                // get the point using nIndex
-                aRetval = rCandidate.getB3DPoint(nIndex);
-
-                // if fDistance != 0.0, move that length on the edge. The edge
-                // length is in fEdgeLength.
-                if(!fTools::equalZero(fDistance))
-                {
-                    sal_uInt32 nNextIndex(getIndexOfSuccessor(nIndex, rCandidate));
-                    const B3DPoint aNextPoint(rCandidate.getB3DPoint(nNextIndex));
-                    double fRelative(fZero);
-
-                    if(!fTools::equalZero(fEdgeLength))
-                    {
-                        fRelative = fDistance / fEdgeLength;
-                    }
-
-                    // add calculated average value to the return value
-                    aRetval += interpolate(aRetval, aNextPoint, fRelative);
-                }
-            }
-
-            return aRetval;
-        }
-
         void applyLineDashing(const B3DPolygon& rCandidate, const ::std::vector<double>& rDotDashArray, B3DPolyPolygon* pLineTarget, B3DPolyPolygon* pGapTarget, double fDotDashLength)
         {
             const sal_uInt32 nPointCount(rCandidate.count());
diff --git a/basegfx/source/polygon/b3dpolypolygontools.cxx b/basegfx/source/polygon/b3dpolypolygontools.cxx
index 62fd440..928fb31 100644
--- a/basegfx/source/polygon/b3dpolypolygontools.cxx
+++ b/basegfx/source/polygon/b3dpolypolygontools.cxx
@@ -540,13 +540,6 @@ namespace basegfx
             return true;
         }
 
-        bool equal(const B3DPolyPolygon& rCandidateA, const B3DPolyPolygon& rCandidateB)
-        {
-            const double fSmallValue(fTools::getSmallValue());
-
-            return equal(rCandidateA, rCandidateB, fSmallValue);
-        }
-
     } // end of namespace tools
 } // end of namespace basegfx
 
diff --git a/basegfx/source/tools/liangbarsky.cxx b/basegfx/source/tools/liangbarsky.cxx
index be2d5e0..6b89e85 100644
--- a/basegfx/source/tools/liangbarsky.cxx
+++ b/basegfx/source/tools/liangbarsky.cxx
@@ -69,63 +69,6 @@ namespace basegfx
                 return true;
             }
         }
-
-        // see Foley/vanDam, pp. 122 for the Liang-Barsky line
-        // clipping algorithm
-        bool liangBarskyClip2D( ::basegfx::B2DPoint&        io_rStart,
-                                ::basegfx::B2DPoint&        io_rEnd,
-                                const ::basegfx::B2DRange&  rClipRect )
-        {
-            const double nDX( io_rEnd.getX() - io_rStart.getX() );
-            const double nDY( io_rEnd.getY() - io_rStart.getY() );
-
-            if( ::basegfx::fTools::equalZero( nDX ) &&
-                ::basegfx::fTools::equalZero( nDY ) )
-            {
-                return rClipRect.isInside( io_rStart );
-            }
-            else
-            {
-                double nTE( 0.0 );
-                double nTL( 1.0 );
-                if( liangBarskyClipT(nDX, rClipRect.getMinX() - io_rStart.getX(),
-                                     nTE, nTL ) )                   // inside wrt. left edge
-                {
-                    if( liangBarskyClipT(-nDX, io_rStart.getX() - rClipRect.getMaxX(),
-                                         nTE, nTL ) )               // inside wrt. right edge
-                    {
-                        if( liangBarskyClipT(nDY, rClipRect.getMinY() - io_rStart.getY(),
-                                             nTE, nTL ) )           // inside wrt. bottom edge
-                        {
-                            if( liangBarskyClipT(-nDY, io_rStart.getY() - rClipRect.getMaxY(),
-                                                 nTE, nTL ) )       // inside wrt. top edge
-                            {
-                                // compute actual intersection points,
-                                // if nTL has changed
-                                if( nTL < 1.0 )
-                                {
-                                    io_rEnd.setX( io_rStart.getX() + nTL*nDX );
-                                    io_rEnd.setY( io_rStart.getY() + nTL*nDY );
-                                }
-
-                                // compute actual intersection points,
-                                // if nTE has changed
-                                if( nTE > 0.0 )
-                                {
-                                    io_rStart.setX( io_rStart.getX() + nTE*nDX );
-                                    io_rStart.setY( io_rStart.getY() + nTE*nDY );
-                                }
-
-                                // line is (at least partially) visible
-                                return true;
-                            }
-                        }
-                    }
-                }
-            }
-
-            return false;
-        }
     }
 }
 
diff --git a/unusedcode.easy b/unusedcode.easy
index 5b2416e..bd26188 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -613,23 +613,9 @@ basegfx::tools::addPointsAtCutsAndTouches(basegfx::B2DPolyPolygon const&, basegf
 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::clipPolygonOnRange(basegfx::B3DPolygon const&, basegfx::B3DRange const&, bool, bool)
-basegfx::tools::createPolygonFromRect(basegfx::B2DRange const&, double)
-basegfx::tools::createShearXB2DHomMatrix(double)
-basegfx::tools::createShearYB2DHomMatrix(double)
-basegfx::tools::createSimplifiedPolygon(basegfx::B2DPolygon const&)
-basegfx::tools::equal(basegfx::B2DPolyPolygon const&, basegfx::B2DPolyPolygon const&)
-basegfx::tools::equal(basegfx::B2DPolygon const&, basegfx::B2DPolygon const&)
-basegfx::tools::equal(basegfx::B3DPolyPolygon const&, basegfx::B3DPolyPolygon const&)
-basegfx::tools::findCut(basegfx::B2DPolygon const&, unsigned int, basegfx::B2DPolygon const&, unsigned int, unsigned short, double*, double*)
-basegfx::tools::findCut(basegfx::B2DPolygon const&, unsigned int, unsigned int, unsigned short, double*, double*)
 basegfx::tools::getOrientation(basegfx::B3DPolygon const&)
-basegfx::tools::getPositionAbsolute(basegfx::B3DPolygon const&, double, double)
 basegfx::tools::getRangeWithControlPoints(basegfx::B2DPolygon const&)
 basegfx::tools::isInEpsilonRange(basegfx::B3DPoint const&, basegfx::B3DPoint const&, basegfx::B3DPoint const&, double)
-basegfx::tools::isPolyPolygonEqualRectangle(basegfx::B2DPolyPolygon const&, basegfx::B2DRange const&)
-basegfx::tools::liangBarskyClip2D(basegfx::B2DPoint&, basegfx::B2DPoint&, basegfx::B2DRange const&)
-basegfx::tools::reSegmentPolygonEdges(basegfx::B2DPolygon 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&)
 basic::ScriptExtensionIterator::implGetScriptPackageFromPackage(com::sun::star::uno::Reference<com::sun::star::deployment::XPackage>, bool&)


More information about the Libreoffice-commits mailing list