summaryrefslogtreecommitdiff
path: root/svx/source/xoutdev/_xpoly.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-08-16 16:20:48 +0200
committerNoel Grandin <noel@peralex.com>2016-08-17 08:45:15 +0200
commit36d02d78061889ac20f9484672100e92cf1cc0c1 (patch)
tree212ef1045da71b297648780c827dcda665874d60 /svx/source/xoutdev/_xpoly.cxx
parent48cb92cb1671bfdef3fcf43978455f19b26ca7bd (diff)
convert XPolyFlags to scoped enum
Change-Id: Ic2a6fad90a0f8c8516469db240ec9910824c1286
Diffstat (limited to 'svx/source/xoutdev/_xpoly.cxx')
-rw-r--r--svx/source/xoutdev/_xpoly.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/svx/source/xoutdev/_xpoly.cxx b/svx/source/xoutdev/_xpoly.cxx
index 8c3bce5411c1..a51233db7473 100644
--- a/svx/source/xoutdev/_xpoly.cxx
+++ b/svx/source/xoutdev/_xpoly.cxx
@@ -270,8 +270,8 @@ XPolygon::XPolygon(const Rectangle& rRect, long nRx, long nRy)
break;
}
GenBezArc(aCenter, nRx, nRy, nXHdl, nYHdl, 0, 900, nQuad, nPos);
- pImpXPolygon->pFlagAry[nPos ] = (sal_uInt8) XPOLY_SMOOTH;
- pImpXPolygon->pFlagAry[nPos+3] = (sal_uInt8) XPOLY_SMOOTH;
+ pImpXPolygon->pFlagAry[nPos ] = (sal_uInt8) XPolyFlags::Smooth;
+ pImpXPolygon->pFlagAry[nPos+3] = (sal_uInt8) XPolyFlags::Smooth;
nPos += 4;
}
}
@@ -310,7 +310,7 @@ XPolygon::XPolygon(const Point& rCenter, long nRx, long nRy,
GenBezArc(rCenter, nRx, nRy, nXHdl, nYHdl, nA1, nA2, nQuad, nPos);
nPos += 3;
if ( !bLoopEnd )
- pImpXPolygon->pFlagAry[nPos] = (sal_uInt8) XPOLY_SMOOTH;
+ pImpXPolygon->pFlagAry[nPos] = (sal_uInt8) XPolyFlags::Smooth;
} while ( !bLoopEnd );
@@ -320,8 +320,8 @@ XPolygon::XPolygon(const Point& rCenter, long nRx, long nRy,
if ( bFull )
{
- pImpXPolygon->pFlagAry[0 ] = (sal_uInt8) XPOLY_SMOOTH;
- pImpXPolygon->pFlagAry[nPos] = (sal_uInt8) XPOLY_SMOOTH;
+ pImpXPolygon->pFlagAry[0 ] = (sal_uInt8) XPolyFlags::Smooth;
+ pImpXPolygon->pFlagAry[nPos] = (sal_uInt8) XPolyFlags::Smooth;
}
pImpXPolygon->nPoints = nPos + 1;
}
@@ -476,14 +476,14 @@ void XPolygon::SetFlags( sal_uInt16 nPos, XPolyFlags eFlags )
/// short path to read the CONTROL flag directly (TODO: better explain what the sense behind this flag is!)
bool XPolygon::IsControl(sal_uInt16 nPos) const
{
- return ( (XPolyFlags) pImpXPolygon->pFlagAry[nPos] == XPOLY_CONTROL );
+ return ( (XPolyFlags) pImpXPolygon->pFlagAry[nPos] == XPolyFlags::Control );
}
/// short path to read the SMOOTH and SYMMTR flag directly (TODO: better explain what the sense behind these flags is!)
bool XPolygon::IsSmooth(sal_uInt16 nPos) const
{
XPolyFlags eFlag = (XPolyFlags) pImpXPolygon->pFlagAry[nPos];
- return ( eFlag == XPOLY_SMOOTH || eFlag == XPOLY_SYMMTR );
+ return ( eFlag == XPolyFlags::Smooth || eFlag == XPolyFlags::Symmetric );
}
/** calculate the euclidean distance between two points
@@ -587,8 +587,8 @@ void XPolygon::GenBezArc(const Point& rCenter, long nRx, long nRy,
SubdivideBezier(nFirst, false, (double)nStart / 900);
if ( nEnd < 900 )
SubdivideBezier(nFirst, true, (double)(nEnd-nStart) / (900-nStart));
- SetFlags(nFirst+1, XPOLY_CONTROL);
- SetFlags(nFirst+2, XPOLY_CONTROL);
+ SetFlags(nFirst+1, XPolyFlags::Control);
+ SetFlags(nFirst+2, XPolyFlags::Control);
}
bool XPolygon::CheckAngles(sal_uInt16& nStart, sal_uInt16 nEnd, sal_uInt16& nA1, sal_uInt16& nA2)
@@ -637,7 +637,7 @@ void XPolygon::CalcSmoothJoin(sal_uInt16 nCenter, sal_uInt16 nDrag, sal_uInt16 n
{
double fRatio = CalcDistance(nCenter, nPnt) / fDiv;
// keep the length if SMOOTH
- if ( GetFlags(nCenter) == XPOLY_SMOOTH || !IsControl(nDrag) )
+ if ( GetFlags(nCenter) == XPolyFlags::Smooth || !IsControl(nDrag) )
{
aDiff.X() = (long) (fRatio * aDiff.X());
aDiff.Y() = (long) (fRatio * aDiff.Y());
@@ -666,7 +666,7 @@ void XPolygon::CalcTangent(sal_uInt16 nCenter, sal_uInt16 nPrev, sal_uInt16 nNex
double fPrevLen = CalcDistance(nCenter, nPrev) / fAbsLen;
// same length for both sides if SYMMTR
- if ( GetFlags(nCenter) == XPOLY_SYMMTR )
+ if ( GetFlags(nCenter) == XPolyFlags::Symmetric )
{
fPrevLen = (fNextLen + fPrevLen) / 2;
fNextLen = fPrevLen;
@@ -741,8 +741,8 @@ void XPolygon::PointsToBezier(sal_uInt16 nFirst)
pPoints[nFirst+1] = Point((long) fX1, (long) fY1);
pPoints[nFirst+2] = Point((long) fX2, (long) fY2);
- SetFlags(nFirst+1, XPOLY_CONTROL);
- SetFlags(nFirst+2, XPOLY_CONTROL);
+ SetFlags(nFirst+1, XPolyFlags::Control);
+ SetFlags(nFirst+2, XPolyFlags::Control);
}
/// scale in X- and/or Y-direction