summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-08-17 15:49:11 +0200
committerNoel Grandin <noel@peralex.com>2016-08-18 08:49:02 +0200
commit1cd85a60e3e24aa37015e57581bc2f1e20950f30 (patch)
tree4a5343a8febe66669c610c147360c1a714fec094 /svx
parentb6471fa5150fca08db9f770aaa7a32c0ae5a5c46 (diff)
convert SdrEdgeKind to scoped enum
Change-Id: Icadffb10750f8792ebd88c4f33f272fe565a3c7a
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdattr.cxx20
-rw-r--r--svx/source/svdraw/svdhdl.cxx4
-rw-r--r--svx/source/svdraw/svdibrow.cxx4
-rw-r--r--svx/source/svdraw/svdoedge.cxx22
4 files changed, 25 insertions, 25 deletions
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 31d09dd06516..56b9408d694d 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -1587,11 +1587,11 @@ bool SdrEdgeKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
switch( GetValue() )
{
- case SDREDGE_ORTHOLINES : eCT = drawing::ConnectorType_STANDARD; break;
- case SDREDGE_THREELINES : eCT = drawing::ConnectorType_LINES; break;
- case SDREDGE_ONELINE : eCT = drawing::ConnectorType_LINE; break;
- case SDREDGE_BEZIER : eCT = drawing::ConnectorType_CURVE; break;
- case SDREDGE_ARC : eCT = drawing::ConnectorType_CURVE; break;
+ case SdrEdgeKind::OrthoLines : eCT = drawing::ConnectorType_STANDARD; break;
+ case SdrEdgeKind::ThreeLines : eCT = drawing::ConnectorType_LINES; break;
+ case SdrEdgeKind::OneLine : eCT = drawing::ConnectorType_LINE; break;
+ case SdrEdgeKind::Bezier : eCT = drawing::ConnectorType_CURVE; break;
+ case SdrEdgeKind::Arc : eCT = drawing::ConnectorType_CURVE; break;
default:
OSL_FAIL( "SdrEdgeKindItem::QueryValue : unknown enum" );
}
@@ -1613,13 +1613,13 @@ bool SdrEdgeKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
eCT = (drawing::ConnectorType)nEnum;
}
- SdrEdgeKind eEK = SDREDGE_ORTHOLINES;
+ SdrEdgeKind eEK = SdrEdgeKind::OrthoLines;
switch( eCT )
{
- case drawing::ConnectorType_STANDARD : eEK = SDREDGE_ORTHOLINES; break;
- case drawing::ConnectorType_CURVE : eEK = SDREDGE_BEZIER; break;
- case drawing::ConnectorType_LINE : eEK = SDREDGE_ONELINE; break;
- case drawing::ConnectorType_LINES : eEK = SDREDGE_THREELINES; break;
+ case drawing::ConnectorType_STANDARD : eEK = SdrEdgeKind::OrthoLines; break;
+ case drawing::ConnectorType_CURVE : eEK = SdrEdgeKind::Bezier; break;
+ case drawing::ConnectorType_LINE : eEK = SdrEdgeKind::OneLine; break;
+ case drawing::ConnectorType_LINES : eEK = SdrEdgeKind::ThreeLines; break;
default:
OSL_FAIL( "SdrEdgeKindItem::PuValue : unknown enum" );
}
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index ba066456883b..8ae34b454980 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1571,11 +1571,11 @@ bool ImpEdgeHdl::IsHorzDrag() const
SdrEdgeKind eEdgeKind = static_cast<const SdrEdgeKindItem&>(pEdge->GetObjectItem(SDRATTR_EDGEKIND)).GetValue();
const SdrEdgeInfoRec& rInfo=pEdge->aEdgeInfo;
- if (eEdgeKind==SDREDGE_ORTHOLINES || eEdgeKind==SDREDGE_BEZIER)
+ if (eEdgeKind==SdrEdgeKind::OrthoLines || eEdgeKind==SdrEdgeKind::Bezier)
{
return !rInfo.ImpIsHorzLine(eLineCode,*pEdge->pEdgeTrack);
}
- else if (eEdgeKind==SDREDGE_THREELINES)
+ else if (eEdgeKind==SdrEdgeKind::ThreeLines)
{
long nAngle=nObjHdlNum==2 ? rInfo.nAngle1 : rInfo.nAngle2;
if (nAngle==0 || nAngle==18000)
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index 37d8fe192c1d..679b40dfe5b2 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -824,11 +824,11 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI
case SDRATTR_EDGELINE3DELTA: {
if (ImpGetItem(*pSet,SDRATTR_EDGEKIND,pItem)) {
SdrEdgeKind eKind=static_cast<const SdrEdgeKindItem*>(pItem)->GetValue();
- if (eKind==SDREDGE_THREELINES) {
+ if (eKind==SdrEdgeKind::ThreeLines) {
if (nWhich>SDRATTR_EDGELINE2DELTA) return true;
else return false;
}
- if (eKind!=SDREDGE_ORTHOLINES && eKind!=SDREDGE_BEZIER) return true;
+ if (eKind!=SdrEdgeKind::OrthoLines && eKind!=SdrEdgeKind::Bezier) return true;
}
if (ImpGetItem(*pSet,SDRATTR_EDGELINEDELTAANZ,pItem)) {
sal_uInt16 nCount=static_cast<const SdrEdgeLineDeltaCountItem*>(pItem)->GetValue();
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index f71180ccb912..14b57e3f3172 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -190,7 +190,7 @@ void SdrEdgeObj::ImpSetAttrToEdgeInfo()
sal_Int32 nVal2 = static_cast<const SdrMetricItem&>(rSet.Get(SDRATTR_EDGELINE2DELTA)).GetValue();
sal_Int32 nVal3 = static_cast<const SdrMetricItem&>(rSet.Get(SDRATTR_EDGELINE3DELTA)).GetValue();
- if(eKind == SDREDGE_ORTHOLINES || eKind == SDREDGE_BEZIER)
+ if(eKind == SdrEdgeKind::OrthoLines || eKind == SdrEdgeKind::Bezier)
{
sal_Int32 nVals[3] = { nVal1, nVal2, nVal3 };
sal_uInt16 n = 0;
@@ -225,7 +225,7 @@ void SdrEdgeObj::ImpSetAttrToEdgeInfo()
n++;
}
}
- else if(eKind == SDREDGE_THREELINES)
+ else if(eKind == SdrEdgeKind::ThreeLines)
{
bool bHor1 = aEdgeInfo.nAngle1 == 0 || aEdgeInfo.nAngle1 == 18000;
bool bHor2 = aEdgeInfo.nAngle2 == 0 || aEdgeInfo.nAngle2 == 18000;
@@ -263,7 +263,7 @@ void SdrEdgeObj::ImpSetEdgeInfoToAttr()
sal_Int32 nVals[3] = { nVal1, nVal2, nVal3 };
sal_uInt16 n = 0;
- if(eKind == SDREDGE_ORTHOLINES || eKind == SDREDGE_BEZIER)
+ if(eKind == SdrEdgeKind::OrthoLines || eKind == SdrEdgeKind::Bezier)
{
if(aEdgeInfo.nObj1Lines >= 2 && n < 3)
{
@@ -295,7 +295,7 @@ void SdrEdgeObj::ImpSetEdgeInfoToAttr()
n++;
}
}
- else if(eKind == SDREDGE_THREELINES)
+ else if(eKind == SdrEdgeKind::ThreeLines)
{
bool bHor1 = aEdgeInfo.nAngle1 == 0 || aEdgeInfo.nAngle1 == 18000;
bool bHor2 = aEdgeInfo.nAngle2 == 0 || aEdgeInfo.nAngle2 == 18000;
@@ -845,7 +845,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
Rectangle aBewareRect1(rBewareRect1);
Rectangle aBewareRect2(rBewareRect2);
Point aMeeting((aPt1.X()+aPt2.X()+1)/2,(aPt1.Y()+aPt2.Y()+1)/2);
- if (eKind==SDREDGE_ONELINE) {
+ if (eKind==SdrEdgeKind::OneLine) {
XPolygon aXP(2);
aXP[0]=rPt1;
aXP[1]=rPt2;
@@ -853,7 +853,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
*pnQuality=std::abs(rPt1.X()-rPt2.X())+std::abs(rPt1.Y()-rPt2.Y());
}
return aXP;
- } else if (eKind==SDREDGE_THREELINES) {
+ } else if (eKind==SdrEdgeKind::ThreeLines) {
XPolygon aXP(4);
aXP[0]=rPt1;
aXP[1]=rPt1;
@@ -1448,7 +1448,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
}
}
// make the connector a bezier curve, if appropriate
- if (eKind==SDREDGE_BEZIER && nPointCount>2) {
+ if (eKind==SdrEdgeKind::Bezier && nPointCount>2) {
Point* pPt1=&aXP1[0];
Point* pPt2=&aXP1[1];
Point* pPt3=&aXP1[nPointCount-2];
@@ -1718,14 +1718,14 @@ sal_uInt32 SdrEdgeObj::GetHdlCount() const
{
nHdlAnz = 2;
- if ((eKind==SDREDGE_ORTHOLINES || eKind==SDREDGE_BEZIER) && nPointCount >= 4)
+ if ((eKind==SdrEdgeKind::OrthoLines || eKind==SdrEdgeKind::Bezier) && nPointCount >= 4)
{
sal_uInt32 nO1(aEdgeInfo.nObj1Lines > 0 ? aEdgeInfo.nObj1Lines - 1 : 0);
sal_uInt32 nO2(aEdgeInfo.nObj2Lines > 0 ? aEdgeInfo.nObj2Lines - 1 : 0);
sal_uInt32 nM(aEdgeInfo.nMiddleLine != 0xFFFF ? 1 : 0);
nHdlAnz += nO1 + nO2 + nM;
}
- else if (eKind==SDREDGE_THREELINES && nPointCount == 4)
+ else if (eKind==SdrEdgeKind::ThreeLines && nPointCount == 4)
{
if(GetConnectedNode(true))
nHdlAnz++;
@@ -1751,7 +1751,7 @@ SdrHdl* SdrEdgeObj::GetHdl(sal_uInt32 nHdlNum) const
if (aCon2.pObj!=nullptr && aCon2.bBestVertex) pHdl->Set1PixMore();
} else {
SdrEdgeKind eKind=static_cast<const SdrEdgeKindItem&>(GetObjectItem(SDRATTR_EDGEKIND)).GetValue();
- if (eKind==SDREDGE_ORTHOLINES || eKind==SDREDGE_BEZIER) {
+ if (eKind==SdrEdgeKind::OrthoLines || eKind==SdrEdgeKind::Bezier) {
sal_uInt32 nO1(aEdgeInfo.nObj1Lines > 0 ? aEdgeInfo.nObj1Lines - 1 : 0);
sal_uInt32 nO2(aEdgeInfo.nObj2Lines > 0 ? aEdgeInfo.nObj2Lines - 1 : 0);
sal_uInt32 nM(aEdgeInfo.nMiddleLine != 0xFFFF ? 1 : 0);
@@ -1786,7 +1786,7 @@ SdrHdl* SdrEdgeObj::GetHdl(sal_uInt32 nHdlNum) const
delete pHdl;
pHdl=nullptr;
}
- } else if (eKind==SDREDGE_THREELINES) {
+ } else if (eKind==SdrEdgeKind::ThreeLines) {
sal_uInt32 nNum(nHdlNum);
if (GetConnectedNode(true)==nullptr) nNum++;
Point aPos((*pEdgeTrack)[(sal_uInt16)nNum-1]);