diff options
author | Noel Grandin <noel@peralex.com> | 2016-08-18 13:11:03 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-08-19 08:18:37 +0200 |
commit | eba160af2149f2ec70b78ea60f63f1b49065bba3 (patch) | |
tree | 70d94cc84c859160a1a5a67be2da50dcd6edd14e /svx | |
parent | fc518ed954aa73eeeb529c21afbcfdfa55ef7fb4 (diff) |
convert SdrCreateCmd to scoped enum
Change-Id: I8772032dee25c790314384750b8c7277c4879318
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/graphctl.cxx | 2 | ||||
-rw-r--r-- | svx/source/engine3d/scene3d.cxx | 2 | ||||
-rw-r--r-- | svx/source/form/fmobj.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdcrtv.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svddrgv.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdoashp.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdocapt.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdocirc.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdoedge.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdomeas.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdopath.cxx | 18 | ||||
-rw-r--r-- | svx/source/svdraw/svdotxdr.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdview.cxx | 20 | ||||
-rw-r--r-- | svx/source/table/svdotable.cxx | 2 |
15 files changed, 35 insertions, 35 deletions
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index 05a687f88a63..b4e7a8c5df32 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -679,7 +679,7 @@ void GraphCtrl::MouseButtonUp(const MouseEvent& rMEvt) if ( bSdrMode ) { if ( pView->IsInsObjPoint() ) - pView->EndInsObjPoint( SDRCREATE_FORCEEND ); + pView->EndInsObjPoint( SdrCreateCmd::ForceEnd ); else pView->MouseButtonUp( rMEvt, this ); diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index 7942684f7451..b93ca3f01650 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -698,7 +698,7 @@ bool E3dScene::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) aRect1.Justify(); NbcSetSnapRect(aRect1); SetRectsDirty(); - return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointCount()>=2); + return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2); } bool E3dScene::BckCreate(SdrDragStat& /*rStat*/) diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index faca04060d6c..ea4e300ef4f8 100644 --- a/svx/source/form/fmobj.cxx +++ b/svx/source/form/fmobj.cxx @@ -633,7 +633,7 @@ void FmFormObj::SetUnoControlModel( const Reference< css::awt::XControlModel >& bool FmFormObj::EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd ) { bool bResult = SdrUnoObj::EndCreate(rStat, eCmd); - if ( bResult && SDRCREATE_FORCEEND == eCmd && rStat.GetView() ) + if ( bResult && SdrCreateCmd::ForceEnd == eCmd && rStat.GetView() ) { if ( pPage ) { diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index 7689ede2df81..bd68921c1643 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -232,7 +232,7 @@ void SdrCreateView::MovAction(const Point& rPnt) void SdrCreateView::EndAction() { - if (pAktCreate!=nullptr) EndCreateObj(SDRCREATE_FORCEEND); + if (pAktCreate!=nullptr) EndCreateObj(SdrCreateCmd::ForceEnd); SdrDragView::EndAction(); } @@ -595,7 +595,7 @@ bool SdrCreateView::EndCreateObj(SdrCreateCmd eCmd) { sal_uIntPtr nCount=maDragStat.GetPointCount(); - if (nCount<=1 && eCmd==SDRCREATE_FORCEEND) + if (nCount<=1 && eCmd==SdrCreateCmd::ForceEnd) { BrkCreateObj(); // objects with only a single point don't exist (at least today) return false; // sal_False = event not interpreted @@ -672,7 +672,7 @@ bool SdrCreateView::EndCreateObj(SdrCreateCmd eCmd) } else { // more points - if (eCmd==SDRCREATE_FORCEEND || // nothing there -- force ending + if (eCmd==SdrCreateCmd::ForceEnd || // nothing there -- force ending nCount==0 || // no existing points (should never happen) (nCount<=1 && !maDragStat.IsMinMoved())) { // MinMove not met BrkCreateObj(); diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx index 835caf12aa22..793bedc1fa36 100644 --- a/svx/source/svdraw/svddrgv.cxx +++ b/svx/source/svdraw/svddrgv.cxx @@ -697,10 +697,10 @@ bool SdrDragView::EndInsObjPoint(SdrCreateCmd eCmd) sal_uInt32 nNextPnt(mnInsPointNum); Point aPnt(maDragStat.GetNow()); bool bOk=EndDragObj(); - if (bOk && eCmd!=SDRCREATE_FORCEEND) + if (bOk && eCmd!=SdrCreateCmd::ForceEnd) { // Ret=True means: Action is over. - bOk=!(ImpBegInsObjPoint(true, nNextPnt, aPnt, eCmd == SDRCREATE_NEXTOBJECT, mpDragWin)); + bOk=!(ImpBegInsObjPoint(true, nNextPnt, aPnt, eCmd == SdrCreateCmd::NextObject, mpDragWin)); } return bOk; diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 799e2344a9ab..6e082257a812 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2192,7 +2192,7 @@ bool SdrObjCustomShape::EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd ) AdaptTextMinSize(); SetRectsDirty(); - return ( eCmd == SDRCREATE_FORCEEND || rStat.GetPointCount() >= 2 ); + return ( eCmd == SdrCreateCmd::ForceEnd || rStat.GetPointCount() >= 2 ); } basegfx::B2DPolyPolygon SdrObjCustomShape::TakeCreatePoly(const SdrDragStat& /*rDrag*/) const diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 830b3f4a2483..3af193cbe5fc 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1353,7 +1353,7 @@ bool SdrObject::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) rStat.TakeCreateRect(aOutRect); aOutRect.Justify(); - return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointCount()>=2); + return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2); } void SdrObject::BrkCreate(SdrDragStat& /*rStat*/) diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index 4bcb20d23692..7b717981e05d 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -572,7 +572,7 @@ bool SdrCaptionObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) maRect.SetPos(rStat.GetNow()); ImpCalcTail(aPara,aTailPoly,maRect); SetRectsDirty(); - return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointCount()>=2); + return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2); } bool SdrCaptionObj::BckCreate(SdrDragStat& /*rStat*/) diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 3862ec002aec..7555116860b0 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -712,7 +712,7 @@ bool SdrCircObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) ImpSetCreateParams(rStat); ImpCircUser* pU=static_cast<ImpCircUser*>(rStat.GetUser()); bool bRet = false; - if (eCmd==SDRCREATE_FORCEEND && rStat.GetPointCount()<4) meCircleKind=OBJ_CIRC; + if (eCmd==SdrCreateCmd::ForceEnd && rStat.GetPointCount()<4) meCircleKind=OBJ_CIRC; if (meCircleKind==OBJ_CIRC) { bRet=rStat.GetPointCount()>=2; if (bRet) { diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index 14b57e3f3172..792138a723d7 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -2048,7 +2048,7 @@ bool SdrEdgeObj::MovCreate(SdrDragStat& rDragStat) bool SdrEdgeObj::EndCreate(SdrDragStat& rDragStat, SdrCreateCmd eCmd) { - bool bOk=(eCmd==SDRCREATE_FORCEEND || rDragStat.GetPointCount()>=2); + bool bOk=(eCmd==SdrCreateCmd::ForceEnd || rDragStat.GetPointCount()>=2); if (bOk) { ConnectToNode(true,aCon1.pObj); ConnectToNode(false,aCon2.pObj); diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index 6fc79857b010..a78dbdfbe172 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -991,7 +991,7 @@ bool SdrMeasureObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) { SetTextDirty(); SetRectsDirty(); - return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointCount()>=2); + return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2); } bool SdrMeasureObj::BckCreate(SdrDragStat& /*rStat*/) diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 8029ac4b0258..4c3ba9441721 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -1403,8 +1403,8 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) sal_uInt16 nActPoint=rXPoly.GetPointCount()-1; rXPoly[nActPoint]=rStat.Now(); if (!pU->bMixedCreate && pU->eStartKind==OBJ_LINE) { - if (rStat.GetPointCount()>=2) eCmd=SDRCREATE_FORCEEND; - bRet = eCmd==SDRCREATE_FORCEEND; + if (rStat.GetPointCount()>=2) eCmd=SdrCreateCmd::ForceEnd; + bRet = eCmd==SdrCreateCmd::ForceEnd; if (bRet) { mbCreating = false; delete pU; @@ -1414,8 +1414,8 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) } if (!pU->bMixedCreate && IsFreeHand(pU->eStartKind)) { - if (rStat.GetPointCount()>=2) eCmd=SDRCREATE_FORCEEND; - bRet=eCmd==SDRCREATE_FORCEEND; + if (rStat.GetPointCount()>=2) eCmd=SdrCreateCmd::ForceEnd; + bRet=eCmd==SdrCreateCmd::ForceEnd; if (bRet) { mbCreating=false; delete pU; @@ -1423,7 +1423,7 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) } return bRet; } - if (eCmd==SDRCREATE_NEXTPOINT || eCmd==SDRCREATE_NEXTOBJECT) { + if (eCmd==SdrCreateCmd::NextPoint || eCmd==SdrCreateCmd::NextObject) { // don't allow two consecutive points to occupy the same position if (nActPoint==0 || rStat.Now()!=rXPoly[nActPoint-1]) { if (bIncomp) { @@ -1458,7 +1458,7 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) nActPoint++; rXPoly[nActPoint]=rStat.GetNow(); } - if (eCmd==SDRCREATE_NEXTOBJECT) { + if (eCmd==SdrCreateCmd::NextObject) { if (rXPoly.GetPointCount()>=2) { pU->bBezHasCtrl0=false; // only a singular polygon may be opened, so close this @@ -1473,7 +1473,7 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) sal_uInt16 nPolyCount=aPathPolygon.Count(); if (nPolyCount!=0) { // delete last point, if necessary - if (eCmd==SDRCREATE_FORCEEND) { + if (eCmd==SdrCreateCmd::ForceEnd) { XPolygon& rXP=aPathPolygon[nPolyCount-1]; sal_uInt16 nPointCount=rXP.GetPointCount(); if (nPointCount>=2) { @@ -1493,13 +1493,13 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) XPolygon& rXP=aPathPolygon[nPolyNum]; sal_uInt16 nPointCount=rXP.GetPointCount(); // delete polygons with too few points - if (nPolyNum<nPolyCount-1 || eCmd==SDRCREATE_FORCEEND) { + if (nPolyNum<nPolyCount-1 || eCmd==SdrCreateCmd::ForceEnd) { if (nPointCount<2) aPathPolygon.Remove(nPolyNum); } } } pU->ResetFormFlags(); - bRet=eCmd==SDRCREATE_FORCEEND; + bRet=eCmd==SdrCreateCmd::ForceEnd; if (bRet) { mbCreating=false; delete pU; diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx index dd99dd42ff37..0d8c54577f2a 100644 --- a/svx/source/svdraw/svdotxdr.cxx +++ b/svx/source/svdraw/svdotxdr.cxx @@ -216,7 +216,7 @@ bool SdrTextObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) if (dynamic_cast<const SdrRectObj *>(this) != nullptr) { static_cast<SdrRectObj*>(this)->SetXPolyDirty(); } - return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointCount()>=2); + return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2); } void SdrTextObj::BrkCreate(SdrDragStat& /*rStat*/) diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 75626b29ede2..447f2f5fa470 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -60,7 +60,7 @@ SdrViewEvent::SdrViewEvent() pURLField(nullptr), eHit(SDRHIT_NONE), eEvent(SdrEventKind::NONE), - eEndCreateCmd(SDRCREATE_NEXTPOINT), + eEndCreateCmd(SdrCreateCmd::NextPoint), nMouseClicks(0), nMouseMode(MouseEventModifiers::NONE), nMouseCode(0), @@ -573,9 +573,9 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co else if (IsCreateObj() || IsInsObjPoint()) { eEvent=IsCreateObj() ? SdrEventKind::EndCreate : SdrEventKind::EndInsertObjPoint; - rVEvt.eEndCreateCmd=SDRCREATE_NEXTPOINT; - if (MODKEY_PolyPoly) rVEvt.eEndCreateCmd=SDRCREATE_NEXTOBJECT; - if (rVEvt.nMouseClicks>1) rVEvt.eEndCreateCmd=SDRCREATE_FORCEEND; + rVEvt.eEndCreateCmd=SdrCreateCmd::NextPoint; + if (MODKEY_PolyPoly) rVEvt.eEndCreateCmd=SdrCreateCmd::NextObject; + if (rVEvt.nMouseClicks>1) rVEvt.eEndCreateCmd=SdrCreateCmd::ForceEnd; } else if (IsMarking()) { @@ -803,9 +803,9 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt) bRet=true; } break; case SdrEventKind::EndCreate: { // if necessary, MarkObj - SdrCreateCmd eCmd=SDRCREATE_NEXTPOINT; - if (MODKEY_PolyPoly) eCmd=SDRCREATE_NEXTOBJECT; - if (rVEvt.nMouseClicks>1) eCmd=SDRCREATE_FORCEEND; + SdrCreateCmd eCmd=SdrCreateCmd::NextPoint; + if (MODKEY_PolyPoly) eCmd=SdrCreateCmd::NextObject; + if (rVEvt.nMouseClicks>1) eCmd=SdrCreateCmd::ForceEnd; if (!EndCreateObj(eCmd)) { // Don't evaluate event for Create? -> Select if (eHit==SDRHIT_UNMARKEDOBJECT || eHit==SDRHIT_TEXTEDIT) { MarkObj(rVEvt.pRootObj,rVEvt.pPV); @@ -880,9 +880,9 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt) case SdrEventKind::BeginMark: bRet=BegMark(aLogicPos,rVEvt.bAddMark,rVEvt.bUnmark); break; case SdrEventKind::BeginInsertObjPoint: bRet = BegInsObjPoint(aLogicPos, MODKEY_PolyPoly); break; case SdrEventKind::EndInsertObjPoint: { - SdrCreateCmd eCmd=SDRCREATE_NEXTPOINT; - if (MODKEY_PolyPoly) eCmd=SDRCREATE_NEXTOBJECT; - if (rVEvt.nMouseClicks>1) eCmd=SDRCREATE_FORCEEND; + SdrCreateCmd eCmd=SdrCreateCmd::NextPoint; + if (MODKEY_PolyPoly) eCmd=SdrCreateCmd::NextObject; + if (rVEvt.nMouseClicks>1) eCmd=SdrCreateCmd::ForceEnd; EndInsObjPoint(eCmd); bRet=true; } break; diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 018ee2ed641a..768506ce09af 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -2345,7 +2345,7 @@ bool SdrTableObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) { rStat.TakeCreateRect(maRect); ImpJustifyRect(maRect); - return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointCount()>=2); + return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2); } void SdrTableObj::BrkCreate(SdrDragStat& /*rStat*/) |