diff options
author | Noel Grandin <noel@peralex.com> | 2016-08-16 16:20:48 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-08-17 08:45:15 +0200 |
commit | 36d02d78061889ac20f9484672100e92cf1cc0c1 (patch) | |
tree | 212ef1045da71b297648780c827dcda665874d60 /svx | |
parent | 48cb92cb1671bfdef3fcf43978455f19b26ca7bd (diff) |
convert XPolyFlags to scoped enum
Change-Id: Ic2a6fad90a0f8c8516469db240ec9910824c1286
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdoedge.cxx | 36 | ||||
-rw-r--r-- | svx/source/svdraw/svdopath.cxx | 62 | ||||
-rw-r--r-- | svx/source/xoutdev/_xpoly.cxx | 26 |
3 files changed, 62 insertions, 62 deletions
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index a1f15f63796a..f71180ccb912 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -628,7 +628,7 @@ SdrEscapeDirection SdrEdgeObj::ImpCalcEscAngle(SdrObject* pObj, const Point& rPt XPolygon SdrEdgeObj::ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, const Rectangle& rRect, const Point& rMeeting) { XPolygon aXP; - aXP.Insert(XPOLY_APPEND,rStPt,XPOLY_NORMAL); + aXP.Insert(XPOLY_APPEND,rStPt,XPolyFlags::Normal); bool bRts=nEscAngle==0; bool bObn=nEscAngle==9000; bool bLks=nEscAngle==18000; @@ -645,7 +645,7 @@ XPolygon SdrEdgeObj::ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, cons if (bRts && rMeeting.X()>=aP2.X()) aP2.X()=rMeeting.X(); if (bObn && rMeeting.Y()<=aP2.Y()) aP2.Y()=rMeeting.Y(); if (bUnt && rMeeting.Y()>=aP2.Y()) aP2.Y()=rMeeting.Y(); - aXP.Insert(XPOLY_APPEND,aP2,XPOLY_NORMAL); + aXP.Insert(XPOLY_APPEND,aP2,XPolyFlags::Normal); Point aP3(aP2); if ((bLks && rMeeting.X()>aP2.X()) || (bRts && rMeeting.X()<aP2.X())) { // around @@ -656,10 +656,10 @@ XPolygon SdrEdgeObj::ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, cons aP3.Y()=rRect.Bottom(); if (rMeeting.Y()>aP3.Y()) aP3.Y()=rMeeting.Y(); } - aXP.Insert(XPOLY_APPEND,aP3,XPOLY_NORMAL); + aXP.Insert(XPOLY_APPEND,aP3,XPolyFlags::Normal); if (aP3.Y()!=rMeeting.Y()) { aP3.X()=rMeeting.X(); - aXP.Insert(XPOLY_APPEND,aP3,XPOLY_NORMAL); + aXP.Insert(XPOLY_APPEND,aP3,XPolyFlags::Normal); } } if ((bObn && rMeeting.Y()>aP2.Y()) || (bUnt && rMeeting.Y()<aP2.Y())) { // around @@ -670,10 +670,10 @@ XPolygon SdrEdgeObj::ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, cons aP3.X()=rRect.Right(); if (rMeeting.X()>aP3.X()) aP3.X()=rMeeting.X(); } - aXP.Insert(XPOLY_APPEND,aP3,XPOLY_NORMAL); + aXP.Insert(XPOLY_APPEND,aP3,XPolyFlags::Normal); if (aP3.X()!=rMeeting.X()) { aP3.Y()=rMeeting.Y(); - aXP.Insert(XPOLY_APPEND,aP3,XPOLY_NORMAL); + aXP.Insert(XPOLY_APPEND,aP3,XPolyFlags::Normal); } } #ifdef DBG_UTIL @@ -1227,7 +1227,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec nXP2Anz--; aXP2.Remove(nXP2Anz,1); } if (bInsMeetingPoint) { - aXP1.Insert(XPOLY_APPEND,aMeeting,XPOLY_NORMAL); + aXP1.Insert(XPOLY_APPEND,aMeeting,XPolyFlags::Normal); if (bInfo) { // Inserting a MeetingPoint adds 2 new lines, // either might become the center line. @@ -1252,7 +1252,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec if (aXP1[nXP1Anz-1]==aXP2[nXP2Anz-1] && nXP1Anz>1 && nXP2Anz>1) nNum--; while (nNum>0) { nNum--; - aXP1.Insert(XPOLY_APPEND,aXP2[nNum],XPOLY_NORMAL); + aXP1.Insert(XPOLY_APPEND,aXP2[nNum],XPolyFlags::Normal); } sal_uInt16 nPointCount=aXP1.GetPointCount(); char cForm; @@ -1458,9 +1458,9 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec long dx2=pPt3->X()-pPt4->X(); long dy2=pPt3->Y()-pPt4->Y(); if (cForm=='L') { // nPointCount==3 - aXP1.SetFlags(1,XPOLY_CONTROL); + aXP1.SetFlags(1,XPolyFlags::Control); Point aPt3(*pPt2); - aXP1.Insert(2,aPt3,XPOLY_CONTROL); + aXP1.Insert(2,aPt3,XPolyFlags::Control); nPointCount=aXP1.GetPointCount(); pPt2=&aXP1[1]; pPt3=&aXP1[nPointCount-2]; @@ -1471,8 +1471,8 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec } else if (nPointCount>=4 && nPointCount<=6) { // Z or U or ... // To all others, the end points of the original lines become control // points for now. Thus, we need to do some more work for nPointCount>4! - aXP1.SetFlags(1,XPOLY_CONTROL); - aXP1.SetFlags(nPointCount-2,XPOLY_CONTROL); + aXP1.SetFlags(1,XPolyFlags::Control); + aXP1.SetFlags(nPointCount-2,XPolyFlags::Control); // distance x1.5 pPt2->X()+=dx1/2; pPt2->Y()+=dy1/2; @@ -1485,9 +1485,9 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec long dy1b=aCenter.Y()-aXP1[1].Y(); long dx2b=aCenter.X()-aXP1[3].X(); long dy2b=aCenter.Y()-aXP1[3].Y(); - aXP1.Insert(2,aCenter,XPOLY_CONTROL); - aXP1.SetFlags(3,XPOLY_SYMMTR); - aXP1.Insert(4,aCenter,XPOLY_CONTROL); + aXP1.Insert(2,aCenter,XPolyFlags::Control); + aXP1.SetFlags(3,XPolyFlags::Symmetric); + aXP1.Insert(4,aCenter,XPolyFlags::Control); aXP1[2].X()-=dx1b/2; aXP1[2].Y()-=dy1b/2; aXP1[3].X()-=(dx1b+dx2b)/4; @@ -1498,13 +1498,13 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec if (nPointCount==6) { Point aPt1b(aXP1[2]); Point aPt2b(aXP1[3]); - aXP1.Insert(2,aPt1b,XPOLY_CONTROL); - aXP1.Insert(5,aPt2b,XPOLY_CONTROL); + aXP1.Insert(2,aPt1b,XPolyFlags::Control); + aXP1.Insert(5,aPt2b,XPolyFlags::Control); long dx=aPt1b.X()-aPt2b.X(); long dy=aPt1b.Y()-aPt2b.Y(); aXP1[3].X()-=dx/2; aXP1[3].Y()-=dy/2; - aXP1.SetFlags(3,XPOLY_SYMMTR); + aXP1.SetFlags(3,XPolyFlags::Symmetric); aXP1.Remove(4,1); // because it's identical with aXP1[3] } } diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index d7b134392df7..8029ac4b0258 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -199,8 +199,8 @@ ImpSdrPathDragData::ImpSdrPathDragData(const SdrPathObj& rPO, const SdrHdl& rHdl bIsPrevControl=aTmpXP.IsControl(nPrevPnt); bIsNextControl=!bIsPrevControl; } else { - bPrevIsControl=!bBegPnt && !bPrevIsBegPnt && aTmpXP.GetFlags(nPrevPnt)==XPOLY_CONTROL; - bNextIsControl=!bEndPnt && !bNextIsEndPnt && aTmpXP.GetFlags(nNextPnt)==XPOLY_CONTROL; + bPrevIsControl=!bBegPnt && !bPrevIsBegPnt && aTmpXP.GetFlags(nPrevPnt)==XPolyFlags::Control; + bNextIsControl=!bEndPnt && !bNextIsEndPnt && aTmpXP.GetFlags(nNextPnt)==XPolyFlags::Control; } nPrevPrevPnt0=nPrevPrevPnt; nPrevPnt0 =nPrevPnt; @@ -303,9 +303,9 @@ void ImpPathCreateUser::CalcBezier(const Point& rP1, const Point& rP2, const Poi XPolygon ImpPathCreateUser::GetBezierPoly() const { XPolygon aXP(4); - aXP[0]=aBezStart; aXP.SetFlags(0,XPOLY_SMOOTH); - aXP[1]=aBezCtrl1; aXP.SetFlags(1,XPOLY_CONTROL); - aXP[2]=aBezCtrl2; aXP.SetFlags(2,XPOLY_CONTROL); + aXP[0]=aBezStart; aXP.SetFlags(0,XPolyFlags::Smooth); + aXP[1]=aBezCtrl1; aXP.SetFlags(1,XPolyFlags::Control); + aXP[2]=aBezCtrl2; aXP.SetFlags(2,XPolyFlags::Control); aXP[3]=aBezEnd; return aXP; } @@ -362,7 +362,7 @@ XPolygon ImpPathCreateUser::GetCirclePoly() const if (nCircRelAngle>=0) { XPolygon aXP(aCircCenter,nCircRadius,nCircRadius, sal_uInt16((nCircStAngle+5)/10),sal_uInt16((nCircStAngle+nCircRelAngle+5)/10),false); - aXP[0]=aCircStart; aXP.SetFlags(0,XPOLY_SMOOTH); + aXP[0]=aCircStart; aXP.SetFlags(0,XPolyFlags::Smooth); if (!bAngleSnap) aXP[aXP.GetPointCount()-1]=aCircEnd; return aXP; } else { @@ -376,7 +376,7 @@ XPolygon ImpPathCreateUser::GetCirclePoly() const aXP[nNum]=aXP[n2]; aXP[n2]=aPt; } - aXP[0]=aCircStart; aXP.SetFlags(0,XPOLY_SMOOTH); + aXP[0]=aCircStart; aXP.SetFlags(0,XPolyFlags::Smooth); if (!bAngleSnap) aXP[aXP.GetPointCount()-1]=aCircEnd; return aXP; } @@ -430,7 +430,7 @@ void ImpPathCreateUser::CalcLine(const Point& rP1, const Point& rP2, const Point XPolygon ImpPathCreateUser::GetLinePoly() const { XPolygon aXP(2); - aXP[0]=aLineStart; if (!bLine90) aXP.SetFlags(0,XPOLY_SMOOTH); + aXP[0]=aLineStart; if (!bLine90) aXP.SetFlags(0,XPolyFlags::Smooth); aXP[1]=aLineEnd; return aXP; } @@ -490,7 +490,7 @@ void ImpPathCreateUser::CalcRect(const Point& rP1, const Point& rP2, const Point XPolygon ImpPathCreateUser::GetRectPoly() const { XPolygon aXP(3); - aXP[0]=aRectP1; aXP.SetFlags(0,XPOLY_SMOOTH); + aXP[0]=aRectP1; aXP.SetFlags(0,XPolyFlags::Smooth); aXP[1]=aRectP2; if (aRectP3!=aRectP2) aXP[2]=aRectP3; return aXP; @@ -1196,8 +1196,8 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::getSpecialDragPoly(const SdrDra aLine2[0]=mpSdrPathDragData->aXP[nNextNextPnt]; aLine2[1]=mpSdrPathDragData->aXP[nNextPnt]; if (mpSdrPathDragData->aXP.IsSmooth(nPrevPnt) && !bPrevIsBegPnt && mpSdrPathDragData->aXP.IsControl(nPrevPrevPnt)) { - aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPOLY_CONTROL); - aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-2],XPOLY_NORMAL); + aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPolyFlags::Control); + aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-2],XPolyFlags::Normal); // leverage lines for the opposing curve segment aLine3[0]=mpSdrPathDragData->aXP[nPrevPnt]; aLine3[1]=mpSdrPathDragData->aXP[nPrevPrevPnt]; @@ -1211,8 +1211,8 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::getSpecialDragPoly(const SdrDra aLine2[0]=mpSdrPathDragData->aXP[nPrevPrevPnt]; aLine2[1]=mpSdrPathDragData->aXP[nPrevPnt]; if (mpSdrPathDragData->aXP.IsSmooth(nNextPnt) && !bNextIsEndPnt && mpSdrPathDragData->aXP.IsControl(nNextNextPnt)) { - aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPOLY_CONTROL); - aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+2],XPOLY_NORMAL); + aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPolyFlags::Control); + aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+2],XPolyFlags::Normal); // leverage lines for the opposing curve segment aLine3[0]=mpSdrPathDragData->aXP[nNextPnt]; aLine3[1]=mpSdrPathDragData->aXP[nNextNextPnt]; @@ -1226,18 +1226,18 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::getSpecialDragPoly(const SdrDra if (mpSdrPathDragData->bEliminate) { aXPoly.Remove(2,1); } - if (bPrevIsControl) aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPOLY_NORMAL); + if (bPrevIsControl) aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPolyFlags::Normal); else if (!bBegPnt && !bPrevIsBegPnt && mpSdrPathDragData->aXP.IsControl(nPrevPrevPnt)) { - aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPOLY_CONTROL); - aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-2],XPOLY_NORMAL); + aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPolyFlags::Control); + aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-2],XPolyFlags::Normal); } else { aXPoly.Remove(0,1); if (bBegPnt) aXPoly.Remove(0,1); } - if (bNextIsControl) aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPOLY_NORMAL); + if (bNextIsControl) aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPolyFlags::Normal); else if (!bEndPnt && !bNextIsEndPnt && mpSdrPathDragData->aXP.IsControl(nNextNextPnt)) { - aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPOLY_CONTROL); - aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+2],XPOLY_NORMAL); + aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPolyFlags::Control); + aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+2],XPolyFlags::Normal); } else { aXPoly.Remove(aXPoly.GetPointCount()-1,1); if (bEndPnt) aXPoly.Remove(aXPoly.GetPointCount()-1,1); @@ -1357,12 +1357,12 @@ bool ImpPathForDragAndCreate::MovCreate(SdrDragStat& rStat) if (nActPoint-pU->nBezierStartPoint>=3 && ((nActPoint-pU->nBezierStartPoint)%3)==0) { rXPoly.PointsToBezier(nActPoint-3); - rXPoly.SetFlags(nActPoint-1,XPOLY_CONTROL); - rXPoly.SetFlags(nActPoint-2,XPOLY_CONTROL); + rXPoly.SetFlags(nActPoint-1,XPolyFlags::Control); + rXPoly.SetFlags(nActPoint-2,XPolyFlags::Control); if (nActPoint>=6 && rXPoly.IsControl(nActPoint-4)) { rXPoly.CalcTangent(nActPoint-3,nActPoint-4,nActPoint-2); - rXPoly.SetFlags(nActPoint-3,XPOLY_SMOOTH); + rXPoly.SetFlags(nActPoint-3,XPolyFlags::Smooth); } } rXPoly[nActPoint+1]=rStat.Now(); @@ -1430,12 +1430,12 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) if (pU->nBezierStartPoint>nActPoint) pU->nBezierStartPoint=nActPoint; if (IsBezier(pU->eAktKind) && nActPoint-pU->nBezierStartPoint>=3 && ((nActPoint-pU->nBezierStartPoint)%3)==0) { rXPoly.PointsToBezier(nActPoint-3); - rXPoly.SetFlags(nActPoint-1,XPOLY_CONTROL); - rXPoly.SetFlags(nActPoint-2,XPOLY_CONTROL); + rXPoly.SetFlags(nActPoint-1,XPolyFlags::Control); + rXPoly.SetFlags(nActPoint-2,XPolyFlags::Control); if (nActPoint>=6 && rXPoly.IsControl(nActPoint-4)) { rXPoly.CalcTangent(nActPoint-3,nActPoint-4,nActPoint-2); - rXPoly.SetFlags(nActPoint-3,XPOLY_SMOOTH); + rXPoly.SetFlags(nActPoint-3,XPolyFlags::Smooth); } } } else { @@ -2052,7 +2052,7 @@ void SdrPathObj::AddToHdlList(SdrHdlList& rHdlList) const if (bClosed && nPntCnt>1) nPntCnt--; for (sal_uInt16 j=0; j<nPntCnt; j++) { - if (rXPoly.GetFlags(j)!=XPOLY_CONTROL) { + if (rXPoly.GetFlags(j)!=XPolyFlags::Control) { const Point& rPnt=rXPoly[j]; SdrHdl* pHdl=new SdrHdl(rPnt,HDL_POLY); pHdl->SetPolyNum(i); @@ -2083,12 +2083,12 @@ sal_uInt32 SdrPathObj::GetPlusHdlCount(const SdrHdl& rHdl) const nPntMax--; if (nPnt<=nPntMax) { - if (rXPoly.GetFlags(nPnt)!=XPOLY_CONTROL) + if (rXPoly.GetFlags(nPnt)!=XPolyFlags::Control) { if (nPnt==0 && IsClosed()) nPnt=nPntMax; - if (nPnt>0 && rXPoly.GetFlags(nPnt-1)==XPOLY_CONTROL) nCnt++; + if (nPnt>0 && rXPoly.GetFlags(nPnt-1)==XPolyFlags::Control) nCnt++; if (nPnt==nPntMax && IsClosed()) nPnt=0; - if (nPnt<nPntMax && rXPoly.GetFlags(nPnt+1)==XPOLY_CONTROL) nCnt++; + if (nPnt<nPntMax && rXPoly.GetFlags(nPnt+1)==XPolyFlags::Control) nCnt++; } } } @@ -2119,7 +2119,7 @@ SdrHdl* SdrPathObj::GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlusNum) const pHdl->SetPolyNum(rHdl.GetPolyNum()); if (nPnt==0 && IsClosed()) nPnt=nPntMax; - if (nPnt>0 && rXPoly.GetFlags(nPnt-1)==XPOLY_CONTROL && nPlusNum==0) + if (nPnt>0 && rXPoly.GetFlags(nPnt-1)==XPolyFlags::Control && nPlusNum==0) { pHdl->SetPos(rXPoly[nPnt-1]); pHdl->SetPointNum(nPnt-1); @@ -2127,7 +2127,7 @@ SdrHdl* SdrPathObj::GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlusNum) const else { if (nPnt==nPntMax && IsClosed()) nPnt=0; - if (nPnt<rXPoly.GetPointCount()-1 && rXPoly.GetFlags(nPnt+1)==XPOLY_CONTROL) + if (nPnt<rXPoly.GetPointCount()-1 && rXPoly.GetFlags(nPnt+1)==XPolyFlags::Control) { pHdl->SetPos(rXPoly[nPnt+1]); pHdl->SetPointNum(nPnt+1); 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 |