diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-05 12:47:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-07 10:34:17 +0000 |
commit | a08cb3b52ea4a071ce8eb5a1786ea45fd211ab78 (patch) | |
tree | 0667c60e438b660211a3df83c1b411e055b1de61 /svx/source | |
parent | 62283fed204e05e3f30a8ae703762d7f96c4e88a (diff) |
convert PolyFlags to scoped enum
and remove the XPolyFlags enum, which has the same values and was being
converted to PolyFlags anyhow
Change-Id: Iaead84933c79a7603698a4e50257dd944df89c41
Reviewed-on: https://gerrit.libreoffice.org/31627
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source')
-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 | 48 |
3 files changed, 73 insertions, 73 deletions
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index ff76043a7b66..5b7c594e5730 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -630,7 +630,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,XPolyFlags::Normal); + aXP.Insert(XPOLY_APPEND,rStPt,PolyFlags::Normal); bool bRts=nEscAngle==0; bool bObn=nEscAngle==9000; bool bLks=nEscAngle==18000; @@ -647,7 +647,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,XPolyFlags::Normal); + aXP.Insert(XPOLY_APPEND,aP2,PolyFlags::Normal); Point aP3(aP2); if ((bLks && rMeeting.X()>aP2.X()) || (bRts && rMeeting.X()<aP2.X())) { // around @@ -658,10 +658,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,XPolyFlags::Normal); + aXP.Insert(XPOLY_APPEND,aP3,PolyFlags::Normal); if (aP3.Y()!=rMeeting.Y()) { aP3.X()=rMeeting.X(); - aXP.Insert(XPOLY_APPEND,aP3,XPolyFlags::Normal); + aXP.Insert(XPOLY_APPEND,aP3,PolyFlags::Normal); } } if ((bObn && rMeeting.Y()>aP2.Y()) || (bUnt && rMeeting.Y()<aP2.Y())) { // around @@ -672,10 +672,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,XPolyFlags::Normal); + aXP.Insert(XPOLY_APPEND,aP3,PolyFlags::Normal); if (aP3.X()!=rMeeting.X()) { aP3.Y()=rMeeting.Y(); - aXP.Insert(XPOLY_APPEND,aP3,XPolyFlags::Normal); + aXP.Insert(XPOLY_APPEND,aP3,PolyFlags::Normal); } } #ifdef DBG_UTIL @@ -1229,7 +1229,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec nXP2Anz--; aXP2.Remove(nXP2Anz,1); } if (bInsMeetingPoint) { - aXP1.Insert(XPOLY_APPEND,aMeeting,XPolyFlags::Normal); + aXP1.Insert(XPOLY_APPEND,aMeeting,PolyFlags::Normal); if (bInfo) { // Inserting a MeetingPoint adds 2 new lines, // either might become the center line. @@ -1254,7 +1254,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],XPolyFlags::Normal); + aXP1.Insert(XPOLY_APPEND,aXP2[nNum],PolyFlags::Normal); } sal_uInt16 nPointCount=aXP1.GetPointCount(); char cForm; @@ -1460,9 +1460,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,XPolyFlags::Control); + aXP1.SetFlags(1,PolyFlags::Control); Point aPt3(*pPt2); - aXP1.Insert(2,aPt3,XPolyFlags::Control); + aXP1.Insert(2,aPt3,PolyFlags::Control); nPointCount=aXP1.GetPointCount(); pPt2=&aXP1[1]; pPt3=&aXP1[nPointCount-2]; @@ -1473,8 +1473,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,XPolyFlags::Control); - aXP1.SetFlags(nPointCount-2,XPolyFlags::Control); + aXP1.SetFlags(1,PolyFlags::Control); + aXP1.SetFlags(nPointCount-2,PolyFlags::Control); // distance x1.5 pPt2->X()+=dx1/2; pPt2->Y()+=dy1/2; @@ -1487,9 +1487,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,XPolyFlags::Control); - aXP1.SetFlags(3,XPolyFlags::Symmetric); - aXP1.Insert(4,aCenter,XPolyFlags::Control); + aXP1.Insert(2,aCenter,PolyFlags::Control); + aXP1.SetFlags(3,PolyFlags::Symmetric); + aXP1.Insert(4,aCenter,PolyFlags::Control); aXP1[2].X()-=dx1b/2; aXP1[2].Y()-=dy1b/2; aXP1[3].X()-=(dx1b+dx2b)/4; @@ -1500,13 +1500,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,XPolyFlags::Control); - aXP1.Insert(5,aPt2b,XPolyFlags::Control); + aXP1.Insert(2,aPt1b,PolyFlags::Control); + aXP1.Insert(5,aPt2b,PolyFlags::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,XPolyFlags::Symmetric); + aXP1.SetFlags(3,PolyFlags::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 1ba7ff83f623..0d8429396e3b 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)==XPolyFlags::Control; - bNextIsControl=!bEndPnt && !bNextIsEndPnt && aTmpXP.GetFlags(nNextPnt)==XPolyFlags::Control; + bPrevIsControl=!bBegPnt && !bPrevIsBegPnt && aTmpXP.GetFlags(nPrevPnt)==PolyFlags::Control; + bNextIsControl=!bEndPnt && !bNextIsEndPnt && aTmpXP.GetFlags(nNextPnt)==PolyFlags::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,XPolyFlags::Smooth); - aXP[1]=aBezCtrl1; aXP.SetFlags(1,XPolyFlags::Control); - aXP[2]=aBezCtrl2; aXP.SetFlags(2,XPolyFlags::Control); + aXP[0]=aBezStart; aXP.SetFlags(0,PolyFlags::Smooth); + aXP[1]=aBezCtrl1; aXP.SetFlags(1,PolyFlags::Control); + aXP[2]=aBezCtrl2; aXP.SetFlags(2,PolyFlags::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,XPolyFlags::Smooth); + aXP[0]=aCircStart; aXP.SetFlags(0,PolyFlags::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,XPolyFlags::Smooth); + aXP[0]=aCircStart; aXP.SetFlags(0,PolyFlags::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,XPolyFlags::Smooth); + aXP[0]=aLineStart; if (!bLine90) aXP.SetFlags(0,PolyFlags::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,XPolyFlags::Smooth); + aXP[0]=aRectP1; aXP.SetFlags(0,PolyFlags::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],XPolyFlags::Control); - aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-2],XPolyFlags::Normal); + aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],PolyFlags::Control); + aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-2],PolyFlags::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],XPolyFlags::Control); - aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+2],XPolyFlags::Normal); + aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],PolyFlags::Control); + aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+2],PolyFlags::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],XPolyFlags::Normal); + if (bPrevIsControl) aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],PolyFlags::Normal); else if (!bBegPnt && !bPrevIsBegPnt && mpSdrPathDragData->aXP.IsControl(nPrevPrevPnt)) { - aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPolyFlags::Control); - aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-2],XPolyFlags::Normal); + aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],PolyFlags::Control); + aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-2],PolyFlags::Normal); } else { aXPoly.Remove(0,1); if (bBegPnt) aXPoly.Remove(0,1); } - if (bNextIsControl) aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPolyFlags::Normal); + if (bNextIsControl) aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],PolyFlags::Normal); else if (!bEndPnt && !bNextIsEndPnt && mpSdrPathDragData->aXP.IsControl(nNextNextPnt)) { - aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPolyFlags::Control); - aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+2],XPolyFlags::Normal); + aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],PolyFlags::Control); + aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+2],PolyFlags::Normal); } else { aXPoly.Remove(aXPoly.GetPointCount()-1,1); if (bEndPnt) aXPoly.Remove(aXPoly.GetPointCount()-1,1); @@ -1366,12 +1366,12 @@ bool ImpPathForDragAndCreate::MovCreate(SdrDragStat& rStat) if (nActPoint-pU->nBezierStartPoint>=3 && ((nActPoint-pU->nBezierStartPoint)%3)==0) { rXPoly.PointsToBezier(nActPoint-3); - rXPoly.SetFlags(nActPoint-1,XPolyFlags::Control); - rXPoly.SetFlags(nActPoint-2,XPolyFlags::Control); + rXPoly.SetFlags(nActPoint-1,PolyFlags::Control); + rXPoly.SetFlags(nActPoint-2,PolyFlags::Control); if (nActPoint>=6 && rXPoly.IsControl(nActPoint-4)) { rXPoly.CalcTangent(nActPoint-3,nActPoint-4,nActPoint-2); - rXPoly.SetFlags(nActPoint-3,XPolyFlags::Smooth); + rXPoly.SetFlags(nActPoint-3,PolyFlags::Smooth); } } rXPoly[nActPoint+1]=rStat.Now(); @@ -1439,12 +1439,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,XPolyFlags::Control); - rXPoly.SetFlags(nActPoint-2,XPolyFlags::Control); + rXPoly.SetFlags(nActPoint-1,PolyFlags::Control); + rXPoly.SetFlags(nActPoint-2,PolyFlags::Control); if (nActPoint>=6 && rXPoly.IsControl(nActPoint-4)) { rXPoly.CalcTangent(nActPoint-3,nActPoint-4,nActPoint-2); - rXPoly.SetFlags(nActPoint-3,XPolyFlags::Smooth); + rXPoly.SetFlags(nActPoint-3,PolyFlags::Smooth); } } } else { @@ -2061,7 +2061,7 @@ void SdrPathObj::AddToHdlList(SdrHdlList& rHdlList) const if (bClosed && nPntCnt>1) nPntCnt--; for (sal_uInt16 j=0; j<nPntCnt; j++) { - if (rXPoly.GetFlags(j)!=XPolyFlags::Control) { + if (rXPoly.GetFlags(j)!=PolyFlags::Control) { const Point& rPnt=rXPoly[j]; SdrHdl* pHdl=new SdrHdl(rPnt,SdrHdlKind::Poly); pHdl->SetPolyNum(i); @@ -2092,12 +2092,12 @@ sal_uInt32 SdrPathObj::GetPlusHdlCount(const SdrHdl& rHdl) const nPntMax--; if (nPnt<=nPntMax) { - if (rXPoly.GetFlags(nPnt)!=XPolyFlags::Control) + if (rXPoly.GetFlags(nPnt)!=PolyFlags::Control) { if (nPnt==0 && IsClosed()) nPnt=nPntMax; - if (nPnt>0 && rXPoly.GetFlags(nPnt-1)==XPolyFlags::Control) nCnt++; + if (nPnt>0 && rXPoly.GetFlags(nPnt-1)==PolyFlags::Control) nCnt++; if (nPnt==nPntMax && IsClosed()) nPnt=0; - if (nPnt<nPntMax && rXPoly.GetFlags(nPnt+1)==XPolyFlags::Control) nCnt++; + if (nPnt<nPntMax && rXPoly.GetFlags(nPnt+1)==PolyFlags::Control) nCnt++; } } } @@ -2128,7 +2128,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)==XPolyFlags::Control && nPlusNum==0) + if (nPnt>0 && rXPoly.GetFlags(nPnt-1)==PolyFlags::Control && nPlusNum==0) { pHdl->SetPos(rXPoly[nPnt-1]); pHdl->SetPointNum(nPnt-1); @@ -2136,7 +2136,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)==XPolyFlags::Control) + if (nPnt<rXPoly.GetPointCount()-1 && rXPoly.GetFlags(nPnt+1)==PolyFlags::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 711a57c8724b..e289a45627d6 100644 --- a/svx/source/xoutdev/_xpoly.cxx +++ b/svx/source/xoutdev/_xpoly.cxx @@ -97,7 +97,7 @@ void ImpXPolygon::Resize( sal_uInt16 nNewSize, bool bDeletePoints ) if( nNewSize == nSize ) return; - sal_uInt8* pOldFlagAry = pFlagAry; + PolyFlags* pOldFlagAry = pFlagAry; sal_uInt16 nOldSize = nSize; CheckPointDelete(); @@ -116,7 +116,7 @@ void ImpXPolygon::Resize( sal_uInt16 nNewSize, bool bDeletePoints ) memset( pPointAry, 0, nSize*sizeof( Point ) ); // create flag array - pFlagAry = new sal_uInt8[ nSize ]; + pFlagAry = new PolyFlags[ nSize ]; memset( pFlagAry, 0, nSize ); // copy if needed @@ -227,7 +227,7 @@ XPolygon::XPolygon( const tools::Polygon& rPoly ) for( sal_uInt16 i = 0; i < nSize; i++ ) { pImpXPolygon->pPointAry[i] = rPoly[i]; - pImpXPolygon->pFlagAry[i] = (sal_uInt8) rPoly.GetFlags( i ); + pImpXPolygon->pFlagAry[i] = rPoly.GetFlags( i ); } } @@ -275,8 +275,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) XPolyFlags::Smooth; - pImpXPolygon->pFlagAry[nPos+3] = (sal_uInt8) XPolyFlags::Smooth; + pImpXPolygon->pFlagAry[nPos ] = PolyFlags::Smooth; + pImpXPolygon->pFlagAry[nPos+3] = PolyFlags::Smooth; nPos += 4; } } @@ -315,7 +315,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) XPolyFlags::Smooth; + pImpXPolygon->pFlagAry[nPos] = PolyFlags::Smooth; } while ( !bLoopEnd ); @@ -325,8 +325,8 @@ XPolygon::XPolygon(const Point& rCenter, long nRx, long nRy, if ( bFull ) { - pImpXPolygon->pFlagAry[0 ] = (sal_uInt8) XPolyFlags::Smooth; - pImpXPolygon->pFlagAry[nPos] = (sal_uInt8) XPolyFlags::Smooth; + pImpXPolygon->pFlagAry[0 ] = PolyFlags::Smooth; + pImpXPolygon->pFlagAry[nPos] = PolyFlags::Smooth; } pImpXPolygon->nPoints = nPos + 1; } @@ -363,12 +363,12 @@ sal_uInt16 XPolygon::GetPointCount() const return pImpXPolygon->nPoints; } -void XPolygon::Insert( sal_uInt16 nPos, const Point& rPt, XPolyFlags eFlags ) +void XPolygon::Insert( sal_uInt16 nPos, const Point& rPt, PolyFlags eFlags ) { if (nPos>pImpXPolygon->nPoints) nPos=pImpXPolygon->nPoints; pImpXPolygon->InsertSpace( nPos, 1 ); pImpXPolygon->pPointAry[nPos] = rPt; - pImpXPolygon->pFlagAry[nPos] = (sal_uInt8)eFlags; + pImpXPolygon->pFlagAry[nPos] = eFlags; } void XPolygon::Insert( sal_uInt16 nPos, const XPolygon& rXPoly ) @@ -471,30 +471,30 @@ bool XPolygon::operator==( const XPolygon& rXPoly ) const } /// get the flags for the point at the given position -XPolyFlags XPolygon::GetFlags( sal_uInt16 nPos ) const +PolyFlags XPolygon::GetFlags( sal_uInt16 nPos ) const { pImpXPolygon->CheckPointDelete(); - return (XPolyFlags) pImpXPolygon->pFlagAry[nPos]; + return (PolyFlags) pImpXPolygon->pFlagAry[nPos]; } /// set the flags for the point at the given position -void XPolygon::SetFlags( sal_uInt16 nPos, XPolyFlags eFlags ) +void XPolygon::SetFlags( sal_uInt16 nPos, PolyFlags eFlags ) { pImpXPolygon->CheckPointDelete(); - pImpXPolygon->pFlagAry[nPos] = (sal_uInt8) eFlags; + pImpXPolygon->pFlagAry[nPos] = 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] == XPolyFlags::Control ); + return ( (PolyFlags) pImpXPolygon->pFlagAry[nPos] == PolyFlags::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 == XPolyFlags::Smooth || eFlag == XPolyFlags::Symmetric ); + PolyFlags eFlag = (PolyFlags) pImpXPolygon->pFlagAry[nPos]; + return ( eFlag == PolyFlags::Smooth || eFlag == PolyFlags::Symmetric ); } /** calculate the euclidean distance between two points @@ -598,8 +598,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, XPolyFlags::Control); - SetFlags(nFirst+2, XPolyFlags::Control); + SetFlags(nFirst+1, PolyFlags::Control); + SetFlags(nFirst+2, PolyFlags::Control); } bool XPolygon::CheckAngles(sal_uInt16& nStart, sal_uInt16 nEnd, sal_uInt16& nA1, sal_uInt16& nA2) @@ -648,7 +648,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) == XPolyFlags::Smooth || !IsControl(nDrag) ) + if ( GetFlags(nCenter) == PolyFlags::Smooth || !IsControl(nDrag) ) { aDiff.X() = (long) (fRatio * aDiff.X()); aDiff.Y() = (long) (fRatio * aDiff.Y()); @@ -677,7 +677,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) == XPolyFlags::Symmetric ) + if ( GetFlags(nCenter) == PolyFlags::Symmetric ) { fPrevLen = (fNextLen + fPrevLen) / 2; fNextLen = fPrevLen; @@ -752,8 +752,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, XPolyFlags::Control); - SetFlags(nFirst+2, XPolyFlags::Control); + SetFlags(nFirst+1, PolyFlags::Control); + SetFlags(nFirst+2, PolyFlags::Control); } /// scale in X- and/or Y-direction @@ -854,7 +854,7 @@ XPolygon::XPolygon(const basegfx::B2DPolygon& rPolygon) for( sal_uInt16 i = 0; i < nSize; i++ ) { pImpXPolygon->pPointAry[i] = aSource[i]; - pImpXPolygon->pFlagAry[i] = (sal_uInt8) aSource.GetFlags( i ); + pImpXPolygon->pFlagAry[i] = aSource.GetFlags( i ); } } |