diff options
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r-- | svx/source/svdraw/svddrgmt.cxx | 136 | ||||
-rw-r--r-- | svx/source/svdraw/svddrgv.cxx | 62 | ||||
-rw-r--r-- | svx/source/svdraw/svdhdl.cxx | 188 | ||||
-rw-r--r-- | svx/source/svdraw/svdmrkv.cxx | 40 | ||||
-rw-r--r-- | svx/source/svdraw/svdmrkv1.cxx | 10 | ||||
-rw-r--r-- | svx/source/svdraw/svdoashp.cxx | 46 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 36 | ||||
-rw-r--r-- | svx/source/svdraw/svdocapt.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdocirc.cxx | 30 | ||||
-rw-r--r-- | svx/source/svdraw/svdoedge.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 16 | ||||
-rw-r--r-- | svx/source/svdraw/svdomeas.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdopath.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdorect.cxx | 26 | ||||
-rw-r--r-- | svx/source/svdraw/svdotxdr.cxx | 32 | ||||
-rw-r--r-- | svx/source/svdraw/svdview.cxx | 10 |
16 files changed, 323 insertions, 323 deletions
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 776925df90d9..15c9a573e99a 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -967,10 +967,10 @@ bool SdrDragMovHdl::BeginSdrDrag() DragStat().Ref1()=GetDragHdl()->GetPos(); DragStat().SetShown(!DragStat().IsShown()); SdrHdlKind eKind=GetDragHdl()->GetKind(); - SdrHdl* pH1=GetHdlList().GetHdl(HDL_REF1); - SdrHdl* pH2=GetHdlList().GetHdl(HDL_REF2); + SdrHdl* pH1=GetHdlList().GetHdl(SdrHdlKind::Ref1); + SdrHdl* pH2=GetHdlList().GetHdl(SdrHdlKind::Ref2); - if (eKind==HDL_MIRX) + if (eKind==SdrHdlKind::MirrorAxis) { if (pH1==nullptr || pH2==nullptr) { @@ -995,10 +995,10 @@ void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt) if ( GetDragHdl() && DragStat().CheckMinMoved(rNoSnapPnt)) { - if (GetDragHdl()->GetKind()==HDL_MIRX) + if (GetDragHdl()->GetKind()==SdrHdlKind::MirrorAxis) { - SdrHdl* pH1=GetHdlList().GetHdl(HDL_REF1); - SdrHdl* pH2=GetHdlList().GetHdl(HDL_REF2); + SdrHdl* pH1=GetHdlList().GetHdl(SdrHdlKind::Ref1); + SdrHdl* pH2=GetHdlList().GetHdl(SdrHdlKind::Ref2); if (pH1==nullptr || pH2==nullptr) return; @@ -1024,7 +1024,7 @@ void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt) pH1->SetPos(Ref1()+aDif); pH2->SetPos(Ref2()+aDif); - SdrHdl* pHM = GetHdlList().GetHdl(HDL_MIRX); + SdrHdl* pHM = GetHdlList().GetHdl(SdrHdlKind::MirrorAxis); if(pHM) pHM->Touch(); @@ -1052,10 +1052,10 @@ void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt) if (nSA!=0) { // angle snapping - SdrHdlKind eRef=HDL_REF1; + SdrHdlKind eRef=SdrHdlKind::Ref1; - if (GetDragHdl()->GetKind()==HDL_REF1) - eRef=HDL_REF2; + if (GetDragHdl()->GetKind()==SdrHdlKind::Ref1) + eRef=SdrHdlKind::Ref2; SdrHdl* pH=GetHdlList().GetHdl(eRef); @@ -1090,7 +1090,7 @@ void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt) Hide(); DragStat().NextMove(aPnt); GetDragHdl()->SetPos(DragStat().GetNow()); - SdrHdl* pHM = GetHdlList().GetHdl(HDL_MIRX); + SdrHdl* pHM = GetHdlList().GetHdl(SdrHdlKind::MirrorAxis); if(pHM) pHM->Touch(); @@ -1108,15 +1108,15 @@ bool SdrDragMovHdl::EndSdrDrag(bool /*bCopy*/) { switch (GetDragHdl()->GetKind()) { - case HDL_REF1: + case SdrHdlKind::Ref1: Ref1()=DragStat().GetNow(); break; - case HDL_REF2: + case SdrHdlKind::Ref2: Ref2()=DragStat().GetNow(); break; - case HDL_MIRX: + case SdrHdlKind::MirrorAxis: Ref1()+=DragStat().GetNow()-DragStat().GetStart(); Ref2()+=DragStat().GetNow()-DragStat().GetStart(); break; @@ -1136,7 +1136,7 @@ void SdrDragMovHdl::CancelSdrDrag() if( pHdl ) pHdl->SetPos(DragStat().GetRef1()); - SdrHdl* pHM = GetHdlList().GetHdl(HDL_MIRX); + SdrHdl* pHM = GetHdlList().GetHdl(SdrHdlKind::MirrorAxis); if(pHM) pHM->Touch(); @@ -1802,23 +1802,23 @@ void SdrDragResize::TakeSdrDragComment(OUString& rStr) const bool SdrDragResize::BeginSdrDrag() { - SdrHdlKind eRefHdl=HDL_MOVE; + SdrHdlKind eRefHdl=SdrHdlKind::Move; SdrHdl* pRefHdl=nullptr; switch (GetDragHdlKind()) { - case HDL_UPLFT: eRefHdl=HDL_LWRGT; break; - case HDL_UPPER: eRefHdl=HDL_LOWER; DragStat().SetHorFixed(true); break; - case HDL_UPRGT: eRefHdl=HDL_LWLFT; break; - case HDL_LEFT : eRefHdl=HDL_RIGHT; DragStat().SetVerFixed(true); break; - case HDL_RIGHT: eRefHdl=HDL_LEFT ; DragStat().SetVerFixed(true); break; - case HDL_LWLFT: eRefHdl=HDL_UPRGT; break; - case HDL_LOWER: eRefHdl=HDL_UPPER; DragStat().SetHorFixed(true); break; - case HDL_LWRGT: eRefHdl=HDL_UPLFT; break; + case SdrHdlKind::UpperLeft: eRefHdl=SdrHdlKind::LowerRight; break; + case SdrHdlKind::Upper: eRefHdl=SdrHdlKind::Lower; DragStat().SetHorFixed(true); break; + case SdrHdlKind::UpperRight: eRefHdl=SdrHdlKind::LowerLeft; break; + case SdrHdlKind::Left : eRefHdl=SdrHdlKind::Right; DragStat().SetVerFixed(true); break; + case SdrHdlKind::Right: eRefHdl=SdrHdlKind::Left ; DragStat().SetVerFixed(true); break; + case SdrHdlKind::LowerLeft: eRefHdl=SdrHdlKind::UpperRight; break; + case SdrHdlKind::Lower: eRefHdl=SdrHdlKind::Upper; DragStat().SetHorFixed(true); break; + case SdrHdlKind::LowerRight: eRefHdl=SdrHdlKind::UpperLeft; break; default: break; } - if (eRefHdl!=HDL_MOVE) + if (eRefHdl!=SdrHdlKind::Move) pRefHdl=GetHdlList().GetHdl(eRefHdl); if (pRefHdl!=nullptr && !getSdrDragView().IsResizeAtCenter()) @@ -1828,8 +1828,8 @@ bool SdrDragResize::BeginSdrDrag() } else { - SdrHdl* pRef1=GetHdlList().GetHdl(HDL_UPLFT); - SdrHdl* pRef2=GetHdlList().GetHdl(HDL_LWRGT); + SdrHdl* pRef1=GetHdlList().GetHdl(SdrHdlKind::UpperLeft); + SdrHdl* pRef2=GetHdlList().GetHdl(SdrHdlKind::LowerRight); if (pRef1!=nullptr && pRef2!=nullptr) { @@ -2111,7 +2111,7 @@ void SdrDragRotate::TakeSdrDragComment(OUString& rStr) const bool SdrDragRotate::BeginSdrDrag() { - SdrHdl* pH=GetHdlList().GetHdl(HDL_REF1); + SdrHdl* pH=GetHdlList().GetHdl(SdrHdlKind::Ref1); if (pH!=nullptr) { @@ -2244,19 +2244,19 @@ void SdrDragShear::TakeSdrDragComment(OUString& rStr) const bool SdrDragShear::BeginSdrDrag() { - SdrHdlKind eRefHdl=HDL_MOVE; + SdrHdlKind eRefHdl=SdrHdlKind::Move; SdrHdl* pRefHdl=nullptr; switch (GetDragHdlKind()) { - case HDL_UPPER: eRefHdl=HDL_LOWER; break; - case HDL_LOWER: eRefHdl=HDL_UPPER; break; - case HDL_LEFT : eRefHdl=HDL_RIGHT; bVertical=true; break; - case HDL_RIGHT: eRefHdl=HDL_LEFT ; bVertical=true; break; + case SdrHdlKind::Upper: eRefHdl=SdrHdlKind::Lower; break; + case SdrHdlKind::Lower: eRefHdl=SdrHdlKind::Upper; break; + case SdrHdlKind::Left : eRefHdl=SdrHdlKind::Right; bVertical=true; break; + case SdrHdlKind::Right: eRefHdl=SdrHdlKind::Left ; bVertical=true; break; default: break; } - if (eRefHdl!=HDL_MOVE) + if (eRefHdl!=SdrHdlKind::Move) pRefHdl=GetHdlList().GetHdl(eRefHdl); if (pRefHdl!=nullptr) @@ -2530,8 +2530,8 @@ void SdrDragMirror::TakeSdrDragComment(OUString& rStr) const bool SdrDragMirror::BeginSdrDrag() { - SdrHdl* pH1=GetHdlList().GetHdl(HDL_REF1); - SdrHdl* pH2=GetHdlList().GetHdl(HDL_REF2); + SdrHdl* pH1=GetHdlList().GetHdl(SdrHdlKind::Ref1); + SdrHdl* pH2=GetHdlList().GetHdl(SdrHdlKind::Ref2); if (pH1!=nullptr && pH2!=nullptr) { @@ -2635,7 +2635,7 @@ bool SdrDragGradient::BeginSdrDrag() { bool bRetval(false); - pIAOHandle = static_cast<SdrHdlGradient*>(GetHdlList().GetHdl(IsGradient() ? HDL_GRAD : HDL_TRNS)); + pIAOHandle = static_cast<SdrHdlGradient*>(GetHdlList().GetHdl(IsGradient() ? SdrHdlKind::Gradient : SdrHdlKind::Transparence)); if(pIAOHandle) { @@ -2924,7 +2924,7 @@ bool SdrDragCrook::BeginSdrDrag() if (bContortionAllowed || bNoContortionAllowed) { - bVertical=(GetDragHdlKind()==HDL_LOWER || GetDragHdlKind()==HDL_UPPER); + bVertical=(GetDragHdlKind()==SdrHdlKind::Lower || GetDragHdlKind()==SdrHdlKind::Upper); aMarkRect=GetMarkedRect(); aMarkCenter=aMarkRect.Center(); nMarkSize=bVertical ? (aMarkRect.GetHeight()-1) : (aMarkRect.GetWidth()-1); @@ -3127,14 +3127,14 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt) { switch (GetDragHdlKind()) { - case HDL_UPLFT: aNeuCenter.X()=aMarkRect.Right(); bLft=true; break; - case HDL_UPPER: aNeuCenter.Y()=aMarkRect.Bottom(); bUpr=true; break; - case HDL_UPRGT: aNeuCenter.X()=aMarkRect.Left(); bRgt=true; break; - case HDL_LEFT : aNeuCenter.X()=aMarkRect.Right(); bLft=true; break; - case HDL_RIGHT: aNeuCenter.X()=aMarkRect.Left(); bRgt=true; break; - case HDL_LWLFT: aNeuCenter.X()=aMarkRect.Right(); bLft=true; break; - case HDL_LOWER: aNeuCenter.Y()=aMarkRect.Top(); bLwr=true; break; - case HDL_LWRGT: aNeuCenter.X()=aMarkRect.Left(); bRgt=true; break; + case SdrHdlKind::UpperLeft: aNeuCenter.X()=aMarkRect.Right(); bLft=true; break; + case SdrHdlKind::Upper: aNeuCenter.Y()=aMarkRect.Bottom(); bUpr=true; break; + case SdrHdlKind::UpperRight: aNeuCenter.X()=aMarkRect.Left(); bRgt=true; break; + case SdrHdlKind::Left : aNeuCenter.X()=aMarkRect.Right(); bLft=true; break; + case SdrHdlKind::Right: aNeuCenter.X()=aMarkRect.Left(); bRgt=true; break; + case SdrHdlKind::LowerLeft: aNeuCenter.X()=aMarkRect.Right(); bLft=true; break; + case SdrHdlKind::Lower: aNeuCenter.Y()=aMarkRect.Top(); bLwr=true; break; + case SdrHdlKind::LowerRight: aNeuCenter.X()=aMarkRect.Left(); bRgt=true; break; default: bAtCenter=true; } } @@ -3460,10 +3460,10 @@ bool SdrDragDistort::BeginSdrDrag() SdrHdlKind eKind=GetDragHdlKind(); nPolyPt=0xFFFF; - if (eKind==HDL_UPLFT) nPolyPt=0; - if (eKind==HDL_UPRGT) nPolyPt=1; - if (eKind==HDL_LWRGT) nPolyPt=2; - if (eKind==HDL_LWLFT) nPolyPt=3; + if (eKind==SdrHdlKind::UpperLeft) nPolyPt=0; + if (eKind==SdrHdlKind::UpperRight) nPolyPt=1; + if (eKind==SdrHdlKind::LowerRight) nPolyPt=2; + if (eKind==SdrHdlKind::LowerLeft) nPolyPt=3; if (nPolyPt>3) return false; aMarkRect=GetMarkedRect(); @@ -3632,8 +3632,8 @@ bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/) } // We need to produce a reference point and two (X & Y) scales - SdrHdl* pRef1=GetHdlList().GetHdl(HDL_UPLFT); - SdrHdl* pRef2=GetHdlList().GetHdl(HDL_LWRGT); + SdrHdl* pRef1=GetHdlList().GetHdl(SdrHdlKind::UpperLeft); + SdrHdl* pRef2=GetHdlList().GetHdl(SdrHdlKind::LowerRight); if (pRef1==nullptr || pRef2==nullptr) return false; @@ -3647,14 +3647,14 @@ bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/) // Reference point is the point opposed to the dragged handle switch(GetDragHdlKind()) { - case HDL_UPLFT: aRef = rect.BottomRight(); break; - case HDL_UPPER: aRef = rect.BottomCenter(); DragStat().SetHorFixed(true); break; - case HDL_UPRGT: aRef = rect.BottomLeft(); break; - case HDL_LEFT : aRef = rect.RightCenter(); DragStat().SetVerFixed(true); break; - case HDL_RIGHT: aRef = rect.LeftCenter(); DragStat().SetVerFixed(true); break; - case HDL_LWLFT: aRef = rect.TopRight(); break; - case HDL_LOWER: aRef = rect.TopCenter(); DragStat().SetHorFixed(true); break; - case HDL_LWRGT: aRef = rect.TopLeft(); break; + case SdrHdlKind::UpperLeft: aRef = rect.BottomRight(); break; + case SdrHdlKind::Upper: aRef = rect.BottomCenter(); DragStat().SetHorFixed(true); break; + case SdrHdlKind::UpperRight: aRef = rect.BottomLeft(); break; + case SdrHdlKind::Left : aRef = rect.RightCenter(); DragStat().SetVerFixed(true); break; + case SdrHdlKind::Right: aRef = rect.LeftCenter(); DragStat().SetVerFixed(true); break; + case SdrHdlKind::LowerLeft: aRef = rect.TopRight(); break; + case SdrHdlKind::Lower: aRef = rect.TopCenter(); DragStat().SetHorFixed(true); break; + case SdrHdlKind::LowerRight: aRef = rect.TopLeft(); break; default: break; } @@ -3844,14 +3844,14 @@ bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/) switch(GetDragHdlKind()) { - case HDL_UPLFT: aLocalStart.setX(1.0); aLocalStart.setY(1.0); break; - case HDL_UPPER: aLocalStart.setX(0.5); aLocalStart.setY(1.0); bOnAxis = true; break; - case HDL_UPRGT: aLocalStart.setX(0.0); aLocalStart.setY(1.0); break; - case HDL_LEFT : aLocalStart.setX(1.0); aLocalStart.setY(0.5); bOnAxis = true; break; - case HDL_RIGHT: aLocalStart.setX(0.0); aLocalStart.setY(0.5); bOnAxis = true; break; - case HDL_LWLFT: aLocalStart.setX(1.0); aLocalStart.setY(0.0); break; - case HDL_LOWER: aLocalStart.setX(0.5); aLocalStart.setY(0.0); bOnAxis = true; break; - case HDL_LWRGT: aLocalStart.setX(0.0); aLocalStart.setY(0.0); break; + case SdrHdlKind::UpperLeft: aLocalStart.setX(1.0); aLocalStart.setY(1.0); break; + case SdrHdlKind::Upper: aLocalStart.setX(0.5); aLocalStart.setY(1.0); bOnAxis = true; break; + case SdrHdlKind::UpperRight: aLocalStart.setX(0.0); aLocalStart.setY(1.0); break; + case SdrHdlKind::Left : aLocalStart.setX(1.0); aLocalStart.setY(0.5); bOnAxis = true; break; + case SdrHdlKind::Right: aLocalStart.setX(0.0); aLocalStart.setY(0.5); bOnAxis = true; break; + case SdrHdlKind::LowerLeft: aLocalStart.setX(1.0); aLocalStart.setY(0.0); break; + case SdrHdlKind::Lower: aLocalStart.setX(0.5); aLocalStart.setY(0.0); bOnAxis = true; break; + case SdrHdlKind::LowerRight: aLocalStart.setX(0.0); aLocalStart.setY(0.0); break; default: break; } diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx index 793bedc1fa36..50cead0ca780 100644 --- a/svx/source/svdraw/svddrgv.cxx +++ b/svx/source/svdraw/svddrgv.cxx @@ -53,7 +53,7 @@ void SdrDragView::ImpClearVars() meDragMode=SdrDragMode::Move; mbDragLimit=false; mbMarkedHitMovesAlways=false; - meDragHdl=HDL_MOVE; + meDragHdl=SdrHdlKind::Move; mpDragHdl=nullptr; mbDragHdl=false; mbDragSpecial=false; @@ -169,7 +169,7 @@ bool SdrDragView::TakeDragObjAnchorPos(Point& rPos, bool bTR ) const if (dynamic_cast<const SdrCaptionObj*>( pObj) != nullptr) { Point aPt(static_cast<SdrCaptionObj*>(pObj)->GetTailPos()); - bool bTail=meDragHdl==HDL_POLY; // drag tail + bool bTail=meDragHdl==SdrHdlKind::Poly; // drag tail bool bOwn=dynamic_cast<const SdrDragObjOwn*>( mpCurrentSdrDragMethod) != nullptr; // specific to object if (!bTail) { // for bTail, TakeActionRect already does the right thing @@ -209,7 +209,7 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl mbDragSpecial=false; mbDragLimit=false; SdrDragMode eTmpMode=meDragMode; - if (eTmpMode==SdrDragMode::Move && pHdl!=nullptr && pHdl->GetKind()!=HDL_MOVE) { + if (eTmpMode==SdrDragMode::Move && pHdl!=nullptr && pHdl->GetKind()!=SdrHdlKind::Move) { eTmpMode=SdrDragMode::Resize; } mbDragLimit=TakeDragLimit(eTmpMode,maDragLimit); @@ -222,10 +222,10 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl Point aPnt(rPnt); if(pHdl == nullptr - || pHdl->GetKind() == HDL_MOVE - || pHdl->GetKind() == HDL_MIRX - || pHdl->GetKind() == HDL_TRNS - || pHdl->GetKind() == HDL_GRAD) + || pHdl->GetKind() == SdrHdlKind::Move + || pHdl->GetKind() == SdrHdlKind::MirrorAxis + || pHdl->GetKind() == SdrHdlKind::Transparence + || pHdl->GetKind() == SdrHdlKind::Gradient) { maDragStat.Reset(aPnt); } @@ -241,13 +241,13 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl maDragStat.NextPoint(); mpDragWin=pOut; mpDragHdl=pHdl; - meDragHdl= pHdl==nullptr ? HDL_MOVE : pHdl->GetKind(); - mbDragHdl=meDragHdl==HDL_REF1 || meDragHdl==HDL_REF2 || meDragHdl==HDL_MIRX; + meDragHdl= pHdl==nullptr ? SdrHdlKind::Move : pHdl->GetKind(); + mbDragHdl=meDragHdl==SdrHdlKind::Ref1 || meDragHdl==SdrHdlKind::Ref2 || meDragHdl==SdrHdlKind::MirrorAxis; - // Expand test for HDL_ANCHOR_TR - bool bNotDraggable = (HDL_ANCHOR == meDragHdl || HDL_ANCHOR_TR == meDragHdl); + // Expand test for SdrHdlKind::Anchor_TR + bool bNotDraggable = (SdrHdlKind::Anchor == meDragHdl || SdrHdlKind::Anchor_TR == meDragHdl); - if(pHdl && (pHdl->GetKind() == HDL_SMARTTAG) && pForcedMeth ) + if(pHdl && (pHdl->GetKind() == SdrHdlKind::SmartTag) && pForcedMeth ) { // just use the forced method for smart tags } @@ -263,8 +263,8 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl { switch (meDragHdl) { - case HDL_LEFT: case HDL_RIGHT: - case HDL_UPPER: case HDL_LOWER: + case SdrHdlKind::Left: case SdrHdlKind::Right: + case SdrHdlKind::Upper: case SdrHdlKind::Lower: { // are 3D objects selected? bool b3DObjSelected = false; @@ -280,8 +280,8 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl return false; mpCurrentSdrDragMethod = new SdrDragShear(*this,meDragMode==SdrDragMode::Rotate); } break; - case HDL_UPLFT: case HDL_UPRGT: - case HDL_LWLFT: case HDL_LWRGT: + case SdrHdlKind::UpperLeft: case SdrHdlKind::UpperRight: + case SdrHdlKind::LowerLeft: case SdrHdlKind::LowerRight: { if (meDragMode==SdrDragMode::Shear || meDragMode==SdrDragMode::Distort) { @@ -296,8 +296,8 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl } break; default: { - if (IsMarkedHitMovesAlways() && meDragHdl==HDL_MOVE) - { // HDL_MOVE is true, even if Obj is hit directly + if (IsMarkedHitMovesAlways() && meDragHdl==SdrHdlKind::Move) + { // SdrHdlKind::Move is true, even if Obj is hit directly if (!IsMoveAllowed()) return false; mpCurrentSdrDragMethod = new SdrDragMove(*this); } @@ -311,7 +311,7 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl } break; case SdrDragMode::Mirror: { - if (meDragHdl==HDL_MOVE && IsMarkedHitMovesAlways()) + if (meDragHdl==SdrHdlKind::Move && IsMarkedHitMovesAlways()) { if (!IsMoveAllowed()) return false; mpCurrentSdrDragMethod = new SdrDragMove(*this); @@ -325,7 +325,7 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl case SdrDragMode::Crop: { - if (meDragHdl==HDL_MOVE && IsMarkedHitMovesAlways()) + if (meDragHdl==SdrHdlKind::Move && IsMarkedHitMovesAlways()) { if (!IsMoveAllowed()) return false; @@ -342,7 +342,7 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl case SdrDragMode::Transparence: { - if(meDragHdl == HDL_MOVE && IsMarkedHitMovesAlways()) + if(meDragHdl == SdrHdlKind::Move && IsMarkedHitMovesAlways()) { if(!IsMoveAllowed()) return false; @@ -359,7 +359,7 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl } case SdrDragMode::Gradient: { - if(meDragHdl == HDL_MOVE && IsMarkedHitMovesAlways()) + if(meDragHdl == SdrHdlKind::Move && IsMarkedHitMovesAlways()) { if(!IsMoveAllowed()) return false; @@ -377,7 +377,7 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl case SdrDragMode::Crook : { - if (meDragHdl==HDL_MOVE && IsMarkedHitMovesAlways()) + if (meDragHdl==SdrHdlKind::Move && IsMarkedHitMovesAlways()) { if (!IsMoveAllowed()) return false; mpCurrentSdrDragMethod = new SdrDragMove(*this); @@ -392,11 +392,11 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl default: { // SdrDragMode::Move - if((meDragHdl == HDL_MOVE) && !IsMoveAllowed()) + if((meDragHdl == SdrHdlKind::Move) && !IsMoveAllowed()) { return false; } - else if(meDragHdl == HDL_GLUE) + else if(meDragHdl == SdrHdlKind::Glue) { mpCurrentSdrDragMethod = new SdrDragMove(*this); } @@ -404,7 +404,7 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl { if(mbFramDrag) { - if(meDragHdl == HDL_MOVE) + if(meDragHdl == SdrHdlKind::Move) { mpCurrentSdrDragMethod = new SdrDragMove(*this); } @@ -432,7 +432,7 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl } else { - if(HDL_MOVE == meDragHdl) + if(SdrHdlKind::Move == meDragHdl) { const bool bCustomShapeSelected(1 == GetMarkedObjectCount() && dynamic_cast<const SdrObjCustomShape*>(GetMarkedObjectByIndex(0)) != nullptr); @@ -441,7 +441,7 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl mpCurrentSdrDragMethod = new SdrDragMove( *this ); } } - else if(HDL_POLY == meDragHdl) + else if(SdrHdlKind::Poly == meDragHdl) { const bool bConnectorSelected(1 == GetMarkedObjectCount() && dynamic_cast<const SdrEdgeObj*>(GetMarkedObjectByIndex(0)) != nullptr); @@ -568,7 +568,7 @@ bool SdrDragView::EndDragObj(bool bCopy) } } - meDragHdl=HDL_MOVE; + meDragHdl=SdrHdlKind::Move; mpDragHdl=nullptr; if (!mbSomeObjChgdFlag) @@ -617,7 +617,7 @@ void SdrDragView::BrkDragObj() SetInsertGluePoint(false); } - meDragHdl=HDL_MOVE; + meDragHdl=SdrHdlKind::Move; mpDragHdl=nullptr; } } @@ -757,7 +757,7 @@ bool SdrDragView::BegInsGluePoint(const Point& rPnt) { pHdl=GetGluePointHdl(pObj,nGlueId); } - if (pHdl!=nullptr && pHdl->GetKind()==HDL_GLUE && pHdl->GetObj()==pObj && pHdl->GetObjHdlNum()==nGlueId) + if (pHdl!=nullptr && pHdl->GetKind()==SdrHdlKind::Glue && pHdl->GetObj()==pObj && pHdl->GetObjHdlNum()==nGlueId) { SetInsertGluePoint(true); bRet=BegDragObj(rPnt,nullptr,pHdl,0); diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 6233ad58b566..b4c3beeab5ac 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -272,7 +272,7 @@ SdrHdl::SdrHdl(): pObj(nullptr), pPV(nullptr), pHdlList(nullptr), - eKind(HDL_MOVE), + eKind(SdrHdlKind::Move), nRotationAngle(0), nObjHdlNum(0), nPolyNum(0), @@ -428,15 +428,15 @@ void SdrHdl::CreateB2dIAObject() switch(eKind) { - case HDL_MOVE: + case SdrHdlKind::Move: { eKindOfMarker = (b1PixMore) ? BitmapMarkerKind::Rect_9x9 : BitmapMarkerKind::Rect_7x7; break; } - case HDL_UPLFT: - case HDL_UPRGT: - case HDL_LWLFT: - case HDL_LWRGT: + case SdrHdlKind::UpperLeft: + case SdrHdlKind::UpperRight: + case SdrHdlKind::LowerLeft: + case SdrHdlKind::LowerRight: { // corner handles if(bRot) @@ -449,8 +449,8 @@ void SdrHdl::CreateB2dIAObject() } break; } - case HDL_UPPER: - case HDL_LOWER: + case SdrHdlKind::Upper: + case SdrHdlKind::Lower: { // Upper/Lower handles if(bRot) @@ -463,8 +463,8 @@ void SdrHdl::CreateB2dIAObject() } break; } - case HDL_LEFT: - case HDL_RIGHT: + case SdrHdlKind::Left: + case SdrHdlKind::Right: { // Left/Right handles if(bRot) @@ -477,7 +477,7 @@ void SdrHdl::CreateB2dIAObject() } break; } - case HDL_POLY: + case SdrHdlKind::Poly: { if(bRot) { @@ -489,50 +489,50 @@ void SdrHdl::CreateB2dIAObject() } break; } - case HDL_BWGT: // weight at poly + case SdrHdlKind::BezierWeight: // weight at poly { eKindOfMarker = BitmapMarkerKind::Circ_7x7; break; } - case HDL_CIRC: + case SdrHdlKind::Circle: { eKindOfMarker = BitmapMarkerKind::Rect_11x11; break; } - case HDL_REF1: - case HDL_REF2: + case SdrHdlKind::Ref1: + case SdrHdlKind::Ref2: { eKindOfMarker = BitmapMarkerKind::Crosshair; break; } - case HDL_GLUE: + case SdrHdlKind::Glue: { eKindOfMarker = BitmapMarkerKind::Glue; break; } - case HDL_GLUE_DESELECTED: + case SdrHdlKind::GlueDeselected: { eKindOfMarker = BitmapMarkerKind::Glue_Deselected; break; } - case HDL_ANCHOR: + case SdrHdlKind::Anchor: { eKindOfMarker = BitmapMarkerKind::Anchor; break; } - case HDL_USER: + case SdrHdlKind::User: { break; } // top right anchor for SW - case HDL_ANCHOR_TR: + case SdrHdlKind::Anchor_TR: { eKindOfMarker = BitmapMarkerKind::AnchorTR; break; } // for SJ and the CustomShapeHandles: - case HDL_CUSTOMSHAPE1: + case SdrHdlKind::CustomShape1: { eKindOfMarker = b1PixMore ? BitmapMarkerKind::Customshape_9x9 : BitmapMarkerKind::Customshape_7x7; eColIndex = BitmapColorIndex::Yellow; @@ -562,13 +562,13 @@ void SdrHdl::CreateB2dIAObject() { Size aOffset = rOutDev.PixelToLogic(Size(4, 4)); - if(eKind == HDL_UPLFT || eKind == HDL_UPPER || eKind == HDL_UPRGT) + if(eKind == SdrHdlKind::UpperLeft || eKind == SdrHdlKind::Upper || eKind == SdrHdlKind::UpperRight) aMoveOutsideOffset.Y() -= aOffset.Width(); - if(eKind == HDL_LWLFT || eKind == HDL_LOWER || eKind == HDL_LWRGT) + if(eKind == SdrHdlKind::LowerLeft || eKind == SdrHdlKind::Lower || eKind == SdrHdlKind::LowerRight) aMoveOutsideOffset.Y() += aOffset.Height(); - if(eKind == HDL_UPLFT || eKind == HDL_LEFT || eKind == HDL_LWLFT) + if(eKind == SdrHdlKind::UpperLeft || eKind == SdrHdlKind::Left || eKind == SdrHdlKind::LowerLeft) aMoveOutsideOffset.X() -= aOffset.Width(); - if(eKind == HDL_UPRGT || eKind == HDL_RIGHT || eKind == HDL_LWRGT) + if(eKind == SdrHdlKind::UpperRight || eKind == SdrHdlKind::Right || eKind == SdrHdlKind::LowerRight) aMoveOutsideOffset.X() += aOffset.Height(); } @@ -855,15 +855,15 @@ bool SdrHdl::IsHdlHit(const Point& rPnt) const Pointer SdrHdl::GetPointer() const { PointerStyle ePtr=PointerStyle::Move; - const bool bSize=eKind>=HDL_UPLFT && eKind<=HDL_LWRGT; + const bool bSize=eKind>=SdrHdlKind::UpperLeft && eKind<=SdrHdlKind::LowerRight; const bool bRot=pHdlList!=nullptr && pHdlList->IsRotateShear(); const bool bDis=pHdlList!=nullptr && pHdlList->IsDistortShear(); if (bSize && pHdlList!=nullptr && (bRot || bDis)) { switch (eKind) { - case HDL_UPLFT: case HDL_UPRGT: - case HDL_LWLFT: case HDL_LWRGT: ePtr=bRot ? PointerStyle::Rotate : PointerStyle::RefHand; break; - case HDL_LEFT : case HDL_RIGHT: ePtr=PointerStyle::VShear; break; - case HDL_UPPER: case HDL_LOWER: ePtr=PointerStyle::HShear; break; + case SdrHdlKind::UpperLeft: case SdrHdlKind::UpperRight: + case SdrHdlKind::LowerLeft: case SdrHdlKind::LowerRight: ePtr=bRot ? PointerStyle::Rotate : PointerStyle::RefHand; break; + case SdrHdlKind::Left : case SdrHdlKind::Right: ePtr=PointerStyle::VShear; break; + case SdrHdlKind::Upper: case SdrHdlKind::Lower: ePtr=PointerStyle::HShear; break; default: break; } @@ -872,14 +872,14 @@ Pointer SdrHdl::GetPointer() const if (bSize && nRotationAngle!=0) { long nHdlAngle=0; switch (eKind) { - case HDL_LWRGT: nHdlAngle=31500; break; - case HDL_LOWER: nHdlAngle=27000; break; - case HDL_LWLFT: nHdlAngle=22500; break; - case HDL_LEFT : nHdlAngle=18000; break; - case HDL_UPLFT: nHdlAngle=13500; break; - case HDL_UPPER: nHdlAngle=9000; break; - case HDL_UPRGT: nHdlAngle=4500; break; - case HDL_RIGHT: nHdlAngle=0; break; + case SdrHdlKind::LowerRight: nHdlAngle=31500; break; + case SdrHdlKind::Lower: nHdlAngle=27000; break; + case SdrHdlKind::LowerLeft: nHdlAngle=22500; break; + case SdrHdlKind::Left : nHdlAngle=18000; break; + case SdrHdlKind::UpperLeft: nHdlAngle=13500; break; + case SdrHdlKind::Upper: nHdlAngle=9000; break; + case SdrHdlKind::UpperRight: nHdlAngle=4500; break; + case SdrHdlKind::Right: nHdlAngle=0; break; default: break; } @@ -899,22 +899,22 @@ Pointer SdrHdl::GetPointer() const } // switch } else { switch (eKind) { - case HDL_UPLFT: ePtr=PointerStyle::NWSize; break; - case HDL_UPPER: ePtr=PointerStyle::NSize; break; - case HDL_UPRGT: ePtr=PointerStyle::NESize; break; - case HDL_LEFT : ePtr=PointerStyle::WSize; break; - case HDL_RIGHT: ePtr=PointerStyle::ESize; break; - case HDL_LWLFT: ePtr=PointerStyle::SWSize; break; - case HDL_LOWER: ePtr=PointerStyle::SSize; break; - case HDL_LWRGT: ePtr=PointerStyle::SESize; break; - case HDL_POLY : ePtr=PointerStyle::MovePoint; break; - case HDL_CIRC : ePtr=PointerStyle::Hand; break; - case HDL_REF1 : ePtr=PointerStyle::RefHand; break; - case HDL_REF2 : ePtr=PointerStyle::RefHand; break; - case HDL_BWGT : ePtr=PointerStyle::MoveBezierWeight; break; - case HDL_GLUE : ePtr=PointerStyle::MovePoint; break; - case HDL_GLUE_DESELECTED : ePtr=PointerStyle::MovePoint; break; - case HDL_CUSTOMSHAPE1 : ePtr=PointerStyle::Hand; break; + case SdrHdlKind::UpperLeft: ePtr=PointerStyle::NWSize; break; + case SdrHdlKind::Upper: ePtr=PointerStyle::NSize; break; + case SdrHdlKind::UpperRight: ePtr=PointerStyle::NESize; break; + case SdrHdlKind::Left : ePtr=PointerStyle::WSize; break; + case SdrHdlKind::Right: ePtr=PointerStyle::ESize; break; + case SdrHdlKind::LowerLeft: ePtr=PointerStyle::SWSize; break; + case SdrHdlKind::Lower: ePtr=PointerStyle::SSize; break; + case SdrHdlKind::LowerRight: ePtr=PointerStyle::SESize; break; + case SdrHdlKind::Poly : ePtr=PointerStyle::MovePoint; break; + case SdrHdlKind::Circle : ePtr=PointerStyle::Hand; break; + case SdrHdlKind::Ref1 : ePtr=PointerStyle::RefHand; break; + case SdrHdlKind::Ref2 : ePtr=PointerStyle::RefHand; break; + case SdrHdlKind::BezierWeight : ePtr=PointerStyle::MoveBezierWeight; break; + case SdrHdlKind::Glue : ePtr=PointerStyle::MovePoint; break; + case SdrHdlKind::GlueDeselected : ePtr=PointerStyle::MovePoint; break; + case SdrHdlKind::CustomShape1 : ePtr=PointerStyle::Hand; break; default: break; } @@ -927,14 +927,14 @@ bool SdrHdl::IsFocusHdl() const { switch(eKind) { - case HDL_UPLFT: - case HDL_UPPER: - case HDL_UPRGT: - case HDL_LEFT: - case HDL_RIGHT: - case HDL_LWLFT: - case HDL_LOWER: - case HDL_LWRGT: + case SdrHdlKind::UpperLeft: + case SdrHdlKind::Upper: + case SdrHdlKind::UpperRight: + case SdrHdlKind::Left: + case SdrHdlKind::Right: + case SdrHdlKind::LowerLeft: + case SdrHdlKind::Lower: + case SdrHdlKind::LowerRight: { // if it's an activated TextEdit, it's moved to extended points if(pHdlList && pHdlList->IsMoveOutside()) @@ -943,19 +943,19 @@ bool SdrHdl::IsFocusHdl() const return true; } - case HDL_MOVE: // handle to move object - case HDL_POLY: // selected point of polygon or curve - case HDL_BWGT: // weight at a curve - case HDL_CIRC: // angle of circle segments, corner radius of rectangles - case HDL_REF1: // reference point 1, e. g. center of rotation - case HDL_REF2: // reference point 2, e. g. endpoint of reflection axis - case HDL_GLUE: // glue point - case HDL_GLUE_DESELECTED: // deselected glue point, used to be a little blue cross + case SdrHdlKind::Move: // handle to move object + case SdrHdlKind::Poly: // selected point of polygon or curve + case SdrHdlKind::BezierWeight: // weight at a curve + case SdrHdlKind::Circle: // angle of circle segments, corner radius of rectangles + case SdrHdlKind::Ref1: // reference point 1, e. g. center of rotation + case SdrHdlKind::Ref2: // reference point 2, e. g. endpoint of reflection axis + case SdrHdlKind::Glue: // glue point + case SdrHdlKind::GlueDeselected: // deselected glue point, used to be a little blue cross // for SJ and the CustomShapeHandles: - case HDL_CUSTOMSHAPE1: + case SdrHdlKind::CustomShape1: - case HDL_USER: + case SdrHdlKind::User: { return true; } @@ -976,7 +976,7 @@ void SdrHdl::onMouseLeave() } SdrHdlColor::SdrHdlColor(const Point& rRef, Color aCol, const Size& rSize, bool bLum) -: SdrHdl(rRef, HDL_COLR), +: SdrHdl(rRef, SdrHdlKind::Color), aMarkerSize(rSize), bUseLuminance(bLum) { @@ -1125,7 +1125,7 @@ void SdrHdlColor::SetSize(const Size& rNew) } SdrHdlGradient::SdrHdlGradient(const Point& rRef1, const Point& rRef2, bool bGrad) - : SdrHdl(rRef1, bGrad ? HDL_GRAD : HDL_TRNS) + : SdrHdl(rRef1, bGrad ? SdrHdlKind::Gradient : SdrHdlKind::Transparence) , pColHdl1(nullptr) , pColHdl2(nullptr) , a2ndPos(rRef2) @@ -1663,7 +1663,7 @@ Pointer ImpMeasureHdl::GetPointer() const ImpTextframeHdl::ImpTextframeHdl(const Rectangle& rRect) : - SdrHdl(rRect.TopLeft(),HDL_MOVE), + SdrHdl(rRect.TopLeft(),SdrHdlKind::Move), maRect(rRect) { } @@ -1731,14 +1731,14 @@ static bool ImpSdrHdlListSorter(SdrHdl* const& lhs, SdrHdl* const& rhs) unsigned n2=1; if (eKind1!=eKind2) { - if (eKind1==HDL_REF1 || eKind1==HDL_REF2 || eKind1==HDL_MIRX) n1=5; - else if (eKind1==HDL_GLUE || eKind1==HDL_GLUE_DESELECTED) n1=2; - else if (eKind1==HDL_USER) n1=3; - else if (eKind1==HDL_SMARTTAG) n1=0; - if (eKind2==HDL_REF1 || eKind2==HDL_REF2 || eKind2==HDL_MIRX) n2=5; - else if (eKind2==HDL_GLUE || eKind2==HDL_GLUE_DESELECTED) n2=2; - else if (eKind2==HDL_USER) n2=3; - else if (eKind2==HDL_SMARTTAG) n2=0; + if (eKind1==SdrHdlKind::Ref1 || eKind1==SdrHdlKind::Ref2 || eKind1==SdrHdlKind::MirrorAxis) n1=5; + else if (eKind1==SdrHdlKind::Glue || eKind1==SdrHdlKind::GlueDeselected) n1=2; + else if (eKind1==SdrHdlKind::User) n1=3; + else if (eKind1==SdrHdlKind::SmartTag) n1=0; + if (eKind2==SdrHdlKind::Ref1 || eKind2==SdrHdlKind::Ref2 || eKind2==SdrHdlKind::MirrorAxis) n2=5; + else if (eKind2==SdrHdlKind::Glue || eKind2==SdrHdlKind::GlueDeselected) n2=2; + else if (eKind2==SdrHdlKind::User) n2=3; + else if (eKind2==SdrHdlKind::SmartTag) n2=0; } if (lhs->IsPlusHdl()) n1=4; if (rhs->IsPlusHdl()) n2=4; @@ -1801,8 +1801,8 @@ extern "C" int SAL_CALL ImplSortHdlFunc( const void* pVoid1, const void* pVoid2 if(p1->mpHdl->GetObj() && dynamic_cast<const SdrPathObj*>(p1->mpHdl->GetObj()) != nullptr) { // same object and a path object - if((p1->mpHdl->GetKind() == HDL_POLY || p1->mpHdl->GetKind() == HDL_BWGT) - && (p2->mpHdl->GetKind() == HDL_POLY || p2->mpHdl->GetKind() == HDL_BWGT)) + if((p1->mpHdl->GetKind() == SdrHdlKind::Poly || p1->mpHdl->GetKind() == SdrHdlKind::BezierWeight) + && (p2->mpHdl->GetKind() == SdrHdlKind::Poly || p2->mpHdl->GetKind() == SdrHdlKind::BezierWeight)) { // both handles are point or control handles if(p1->mpHdl->GetPolyNum() == p2->mpHdl->GetPolyNum()) @@ -2247,14 +2247,14 @@ BitmapEx SdrCropHdl::GetBitmapForHandle( const BitmapEx& rBitmap, int nSize ) switch( eKind ) { - case HDL_UPLFT: nX = 0; nY = 0; break; - case HDL_UPPER: nX = 1; nY = 0; break; - case HDL_UPRGT: nX = 2; nY = 0; break; - case HDL_LEFT: nX = 0; nY = 1; break; - case HDL_RIGHT: nX = 2; nY = 1; break; - case HDL_LWLFT: nX = 0; nY = 2; break; - case HDL_LOWER: nX = 1; nY = 2; break; - case HDL_LWRGT: nX = 2; nY = 2; break; + case SdrHdlKind::UpperLeft: nX = 0; nY = 0; break; + case SdrHdlKind::Upper: nX = 1; nY = 0; break; + case SdrHdlKind::UpperRight: nX = 2; nY = 0; break; + case SdrHdlKind::Left: nX = 0; nY = 1; break; + case SdrHdlKind::Right: nX = 2; nY = 1; break; + case SdrHdlKind::LowerLeft: nX = 0; nY = 2; break; + case SdrHdlKind::Lower: nX = 1; nY = 2; break; + case SdrHdlKind::LowerRight: nX = 2; nY = 2; break; default: break; } @@ -2353,7 +2353,7 @@ SdrCropViewHdl::SdrCropViewHdl( double fCropTop, double fCropRight, double fCropBottom) -: SdrHdl(Point(), HDL_USER), +: SdrHdl(Point(), SdrHdlKind::User), maObjectTransform(rObjectTransform), maGraphic(rGraphic), mfCropLeft(fCropLeft), diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 72ec65f602ed..9e4bdd29dd7b 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -622,13 +622,13 @@ void SdrMarkView::SetMarkHandles() const SdrHdl* pSaveOldFocusHdl = maHdlList.GetFocusHdl(); bool bSaveOldFocus(false); sal_uInt32 nSavePolyNum(0L), nSavePointNum(0L); - SdrHdlKind eSaveKind(HDL_MOVE); + SdrHdlKind eSaveKind(SdrHdlKind::Move); SdrObject* pSaveObj = nullptr; if(pSaveOldFocusHdl && pSaveOldFocusHdl->GetObj() && dynamic_cast<const SdrPathObj*>(pSaveOldFocusHdl->GetObj()) != nullptr - && (pSaveOldFocusHdl->GetKind() == HDL_POLY || pSaveOldFocusHdl->GetKind() == HDL_BWGT)) + && (pSaveOldFocusHdl->GetKind() == SdrHdlKind::Poly || pSaveOldFocusHdl->GetKind() == SdrHdlKind::BezierWeight)) { bSaveOldFocus = true; nSavePolyNum = pSaveOldFocusHdl->GetPolyNum(); @@ -796,23 +796,23 @@ void SdrMarkView::SetMarkHandles() bool bHgt0=aRect.Top()==aRect.Bottom(); if (bWdt0 && bHgt0) { - maHdlList.AddHdl(new SdrHdl(aRect.TopLeft(),HDL_UPLFT)); + maHdlList.AddHdl(new SdrHdl(aRect.TopLeft(),SdrHdlKind::UpperLeft)); } else if (!bStdDrag && (bWdt0 || bHgt0)) { - maHdlList.AddHdl(new SdrHdl(aRect.TopLeft() ,HDL_UPLFT)); - maHdlList.AddHdl(new SdrHdl(aRect.BottomRight(),HDL_LWRGT)); + maHdlList.AddHdl(new SdrHdl(aRect.TopLeft() ,SdrHdlKind::UpperLeft)); + maHdlList.AddHdl(new SdrHdl(aRect.BottomRight(),SdrHdlKind::LowerRight)); } else { - if (!bWdt0 && !bHgt0) maHdlList.AddHdl(new SdrHdl(aRect.TopLeft() ,HDL_UPLFT)); - if ( !bHgt0) maHdlList.AddHdl(new SdrHdl(aRect.TopCenter() ,HDL_UPPER)); - if (!bWdt0 && !bHgt0) maHdlList.AddHdl(new SdrHdl(aRect.TopRight() ,HDL_UPRGT)); - if (!bWdt0 ) maHdlList.AddHdl(new SdrHdl(aRect.LeftCenter() ,HDL_LEFT )); - if (!bWdt0 ) maHdlList.AddHdl(new SdrHdl(aRect.RightCenter() ,HDL_RIGHT)); - if (!bWdt0 && !bHgt0) maHdlList.AddHdl(new SdrHdl(aRect.BottomLeft() ,HDL_LWLFT)); - if ( !bHgt0) maHdlList.AddHdl(new SdrHdl(aRect.BottomCenter(),HDL_LOWER)); - if (!bWdt0 && !bHgt0) maHdlList.AddHdl(new SdrHdl(aRect.BottomRight() ,HDL_LWRGT)); + if (!bWdt0 && !bHgt0) maHdlList.AddHdl(new SdrHdl(aRect.TopLeft() ,SdrHdlKind::UpperLeft)); + if ( !bHgt0) maHdlList.AddHdl(new SdrHdl(aRect.TopCenter() ,SdrHdlKind::Upper)); + if (!bWdt0 && !bHgt0) maHdlList.AddHdl(new SdrHdl(aRect.TopRight() ,SdrHdlKind::UpperRight)); + if (!bWdt0 ) maHdlList.AddHdl(new SdrHdl(aRect.LeftCenter() ,SdrHdlKind::Left )); + if (!bWdt0 ) maHdlList.AddHdl(new SdrHdl(aRect.RightCenter() ,SdrHdlKind::Right)); + if (!bWdt0 && !bHgt0) maHdlList.AddHdl(new SdrHdl(aRect.BottomLeft() ,SdrHdlKind::LowerLeft)); + if ( !bHgt0) maHdlList.AddHdl(new SdrHdl(aRect.BottomCenter(),SdrHdlKind::Lower)); + if (!bWdt0 && !bHgt0) maHdlList.AddHdl(new SdrHdl(aRect.BottomRight() ,SdrHdlKind::LowerRight)); } } } @@ -898,7 +898,7 @@ void SdrMarkView::SetMarkHandles() { const SdrGluePoint& rGP=(*pGPL)[nNumGP]; Point aPos(rGP.GetAbsolutePos(*pObj)); - SdrHdl* pGlueHdl=new SdrHdl(aPos,HDL_GLUE); + SdrHdl* pGlueHdl=new SdrHdl(aPos,SdrHdlKind::Glue); pGlueHdl->SetObj(pObj); pGlueHdl->SetPageView(pPV); pGlueHdl->SetObjHdlNum(nId); @@ -965,7 +965,7 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode) case SdrDragMode::Rotate: { // add rotation center - SdrHdl* pHdl = new SdrHdl(maRef1, HDL_REF1); + SdrHdl* pHdl = new SdrHdl(maRef1, SdrHdlKind::Ref1); maHdlList.AddHdl(pHdl); @@ -974,9 +974,9 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode) case SdrDragMode::Mirror: { // add axis of reflection - SdrHdl* pHdl3 = new SdrHdl(maRef2, HDL_REF2); - SdrHdl* pHdl2 = new SdrHdl(maRef1, HDL_REF1); - SdrHdl* pHdl1 = new SdrHdlLine(*pHdl2, *pHdl3, HDL_MIRX); + SdrHdl* pHdl3 = new SdrHdl(maRef2, SdrHdlKind::Ref2); + SdrHdl* pHdl2 = new SdrHdl(maRef1, SdrHdlKind::Ref1); + SdrHdl* pHdl1 = new SdrHdlLine(*pHdl2, *pHdl3, SdrHdlKind::MirrorAxis); pHdl1->SetObjHdlNum(1); // for sorting pHdl2->SetObjHdlNum(2); // for sorting @@ -1237,7 +1237,7 @@ void SdrMarkView::SetRef1(const Point& rPt) if(meDragMode == SdrDragMode::Rotate || meDragMode == SdrDragMode::Mirror) { maRef1 = rPt; - SdrHdl* pH = maHdlList.GetHdl(HDL_REF1); + SdrHdl* pH = maHdlList.GetHdl(SdrHdlKind::Ref1); if(pH) pH->SetPos(rPt); } @@ -1248,7 +1248,7 @@ void SdrMarkView::SetRef2(const Point& rPt) if(meDragMode == SdrDragMode::Mirror) { maRef2 = rPt; - SdrHdl* pH = maHdlList.GetHdl(HDL_REF2); + SdrHdl* pH = maHdlList.GetHdl(SdrHdlKind::Ref2); if(pH) pH->SetPos(rPt); } diff --git a/svx/source/svdraw/svdmrkv1.cxx b/svx/source/svdraw/svdmrkv1.cxx index 5b1239a92c70..d75950603f93 100644 --- a/svx/source/svdraw/svdmrkv1.cxx +++ b/svx/source/svdraw/svdmrkv1.cxx @@ -102,7 +102,7 @@ sal_uIntPtr SdrMarkView::GetMarkedPointCount() const bool SdrMarkView::IsPointMarkable(const SdrHdl& rHdl) const { - return !ImpIsFrameHandles() && !rHdl.IsPlusHdl() && rHdl.GetKind()!=HDL_GLUE && rHdl.GetKind()!=HDL_SMARTTAG && rHdl.GetObj()!=nullptr && rHdl.GetObj()->IsPolyObj(); + return !ImpIsFrameHandles() && !rHdl.IsPlusHdl() && rHdl.GetKind()!=SdrHdlKind::Glue && rHdl.GetKind()!=SdrHdlKind::SmartTag && rHdl.GetObj()!=nullptr && rHdl.GetObj()->IsPolyObj(); } bool SdrMarkView::MarkPointHelper(SdrHdl* pHdl, SdrMark* pMark, bool bUnmark) @@ -112,7 +112,7 @@ bool SdrMarkView::MarkPointHelper(SdrHdl* pHdl, SdrMark* pMark, bool bUnmark) bool SdrMarkView::ImpMarkPoint(SdrHdl* pHdl, SdrMark* pMark, bool bUnmark) { - if (pHdl==nullptr || pHdl->IsPlusHdl() || pHdl->GetKind()==HDL_GLUE) + if (pHdl==nullptr || pHdl->IsPlusHdl() || pHdl->GetKind()==SdrHdlKind::Glue) return false; if (pHdl->IsSelected() != bUnmark) @@ -288,9 +288,9 @@ void SdrMarkView::ImpSetPointsRects() const for (size_t nHdlNum=0; nHdlNum<nHdlAnz; ++nHdlNum) { const SdrHdl* pHdl=maHdlList.GetHdl(nHdlNum); SdrHdlKind eKind=pHdl->GetKind(); - if ((eKind==HDL_POLY && pHdl->IsSelected()) || eKind==HDL_GLUE) { + if ((eKind==SdrHdlKind::Poly && pHdl->IsSelected()) || eKind==SdrHdlKind::Glue) { Point aPt(pHdl->GetPos()); - Rectangle& rR=eKind==HDL_GLUE ? aGlue : aPnts; + Rectangle& rR=eKind==SdrHdlKind::Glue ? aGlue : aPnts; if (rR.IsEmpty()) { rR=Rectangle(aPt,aPt); } else { @@ -556,7 +556,7 @@ SdrHdl* SdrMarkView::GetGluePointHdl(const SdrObject* pObj, sal_uInt16 nId) cons for (size_t nHdlNum=0; nHdlNum<nHdlAnz; ++nHdlNum) { SdrHdl* pHdl=maHdlList.GetHdl(nHdlNum); if (pHdl->GetObj()==pObj && - pHdl->GetKind()==HDL_GLUE && + pHdl->GetKind()==SdrHdlKind::Glue && pHdl->GetObjHdlNum()==nId ) return pHdl; } return nullptr; diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 3da4aa33b061..9482d259c3da 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -1894,7 +1894,7 @@ SdrHdl* SdrObjCustomShape::GetHdl( sal_uInt32 nHdlNum ) const try { css::awt::Point aPosition( aInteractionHandles[ nCustomShapeHdlNum ].xInteraction->getPosition() ); - pH = new SdrHdl( Point( aPosition.X, aPosition.Y ), HDL_CUSTOMSHAPE1 ); + pH = new SdrHdl( Point( aPosition.X, aPosition.Y ), SdrHdlKind::CustomShape1 ); pH->SetPointNum( nCustomShapeHdlNum ); pH->SetObj( const_cast<SdrObjCustomShape*>(this) ); } @@ -1917,7 +1917,7 @@ bool SdrObjCustomShape::beginSpecialDrag(SdrDragStat& rDrag) const { const SdrHdl* pHdl = rDrag.GetHdl(); - if(pHdl && HDL_CUSTOMSHAPE1 == pHdl->GetKind()) + if(pHdl && SdrHdlKind::CustomShape1 == pHdl->GetKind()) { rDrag.SetEndDragChangesAttributes(true); rDrag.SetNoSnap(); @@ -1925,19 +1925,19 @@ bool SdrObjCustomShape::beginSpecialDrag(SdrDragStat& rDrag) const else { const SdrHdl* pHdl2 = rDrag.GetHdl(); - const SdrHdlKind eHdl((pHdl2 == nullptr) ? HDL_MOVE : pHdl2->GetKind()); + const SdrHdlKind eHdl((pHdl2 == nullptr) ? SdrHdlKind::Move : pHdl2->GetKind()); switch( eHdl ) { - case HDL_UPLFT : - case HDL_UPPER : - case HDL_UPRGT : - case HDL_LEFT : - case HDL_RIGHT : - case HDL_LWLFT : - case HDL_LOWER : - case HDL_LWRGT : - case HDL_MOVE : + case SdrHdlKind::UpperLeft : + case SdrHdlKind::Upper : + case SdrHdlKind::UpperRight : + case SdrHdlKind::Left : + case SdrHdlKind::Right : + case SdrHdlKind::LowerLeft : + case SdrHdlKind::Lower : + case SdrHdlKind::LowerRight : + case SdrHdlKind::Move : { break; } @@ -2091,11 +2091,11 @@ void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point& rDestination, bool SdrObjCustomShape::applySpecialDrag(SdrDragStat& rDrag) { const SdrHdl* pHdl = rDrag.GetHdl(); - const SdrHdlKind eHdl((pHdl == nullptr) ? HDL_MOVE : pHdl->GetKind()); + const SdrHdlKind eHdl((pHdl == nullptr) ? SdrHdlKind::Move : pHdl->GetKind()); switch(eHdl) { - case HDL_CUSTOMSHAPE1 : + case SdrHdlKind::CustomShape1 : { rDrag.SetEndDragChangesGeoAndAttributes(true); DragMoveCustomShapeHdl( rDrag.GetNow(), (sal_uInt16)pHdl->GetPointNum(), !rDrag.GetDragMethod()->IsShiftPressed() ); @@ -2105,19 +2105,19 @@ bool SdrObjCustomShape::applySpecialDrag(SdrDragStat& rDrag) break; } - case HDL_UPLFT : - case HDL_UPPER : - case HDL_UPRGT : - case HDL_LEFT : - case HDL_RIGHT : - case HDL_LWLFT : - case HDL_LOWER : - case HDL_LWRGT : + case SdrHdlKind::UpperLeft : + case SdrHdlKind::Upper : + case SdrHdlKind::UpperRight : + case SdrHdlKind::Left : + case SdrHdlKind::Right : + case SdrHdlKind::LowerLeft : + case SdrHdlKind::Lower : + case SdrHdlKind::LowerRight : { DragResizeCustomShape( ImpDragCalcRect(rDrag) ); break; } - case HDL_MOVE : + case SdrHdlKind::Move : { Move(Size(rDrag.GetDX(), rDrag.GetDY())); break; diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 578c787fe397..b940c562cfdd 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1163,14 +1163,14 @@ SdrHdl* SdrObject::GetHdl(sal_uInt32 nHdlNum) const SdrHdl* pH=nullptr; const Rectangle& rR=GetSnapRect(); switch (nHdlNum) { - case 0: pH=new SdrHdl(rR.TopLeft(), HDL_UPLFT); break; - case 1: pH=new SdrHdl(rR.TopCenter(), HDL_UPPER); break; - case 2: pH=new SdrHdl(rR.TopRight(), HDL_UPRGT); break; - case 3: pH=new SdrHdl(rR.LeftCenter(), HDL_LEFT ); break; - case 4: pH=new SdrHdl(rR.RightCenter(), HDL_RIGHT); break; - case 5: pH=new SdrHdl(rR.BottomLeft(), HDL_LWLFT); break; - case 6: pH=new SdrHdl(rR.BottomCenter(),HDL_LOWER); break; - case 7: pH=new SdrHdl(rR.BottomRight(), HDL_LWRGT); break; + case 0: pH=new SdrHdl(rR.TopLeft(), SdrHdlKind::UpperLeft); break; + case 1: pH=new SdrHdl(rR.TopCenter(), SdrHdlKind::Upper); break; + case 2: pH=new SdrHdl(rR.TopRight(), SdrHdlKind::UpperRight); break; + case 3: pH=new SdrHdl(rR.LeftCenter(), SdrHdlKind::Left ); break; + case 4: pH=new SdrHdl(rR.RightCenter(), SdrHdlKind::Right); break; + case 5: pH=new SdrHdl(rR.BottomLeft(), SdrHdlKind::LowerLeft); break; + case 6: pH=new SdrHdl(rR.BottomCenter(),SdrHdlKind::Lower); break; + case 7: pH=new SdrHdl(rR.BottomRight(), SdrHdlKind::LowerRight); break; } return pH; } @@ -1207,15 +1207,15 @@ Rectangle SdrObject::ImpDragCalcRect(const SdrDragStat& rDrag) const Rectangle aTmpRect(GetSnapRect()); Rectangle aRect(aTmpRect); const SdrHdl* pHdl=rDrag.GetHdl(); - SdrHdlKind eHdl=pHdl==nullptr ? HDL_MOVE : pHdl->GetKind(); - bool bEcke=(eHdl==HDL_UPLFT || eHdl==HDL_UPRGT || eHdl==HDL_LWLFT || eHdl==HDL_LWRGT); + SdrHdlKind eHdl=pHdl==nullptr ? SdrHdlKind::Move : pHdl->GetKind(); + bool bEcke=(eHdl==SdrHdlKind::UpperLeft || eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::LowerLeft || eHdl==SdrHdlKind::LowerRight); bool bOrtho=rDrag.GetView()!=nullptr && rDrag.GetView()->IsOrtho(); bool bBigOrtho=bEcke && bOrtho && rDrag.GetView()->IsBigOrtho(); Point aPos(rDrag.GetNow()); - bool bLft=(eHdl==HDL_UPLFT || eHdl==HDL_LEFT || eHdl==HDL_LWLFT); - bool bRgt=(eHdl==HDL_UPRGT || eHdl==HDL_RIGHT || eHdl==HDL_LWRGT); - bool bTop=(eHdl==HDL_UPRGT || eHdl==HDL_UPPER || eHdl==HDL_UPLFT); - bool bBtm=(eHdl==HDL_LWRGT || eHdl==HDL_LOWER || eHdl==HDL_LWLFT); + bool bLft=(eHdl==SdrHdlKind::UpperLeft || eHdl==SdrHdlKind::Left || eHdl==SdrHdlKind::LowerLeft); + bool bRgt=(eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::Right || eHdl==SdrHdlKind::LowerRight); + bool bTop=(eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::Upper || eHdl==SdrHdlKind::UpperLeft); + bool bBtm=(eHdl==SdrHdlKind::LowerRight || eHdl==SdrHdlKind::Lower || eHdl==SdrHdlKind::LowerLeft); if (bLft) aTmpRect.Left() =aPos.X(); if (bRgt) aTmpRect.Right() =aPos.X(); if (bTop) aTmpRect.Top() =aPos.Y(); @@ -1292,11 +1292,11 @@ bool SdrObject::beginSpecialDrag(SdrDragStat& rDrag) const { const SdrHdl* pHdl = rDrag.GetHdl(); - SdrHdlKind eHdl = (pHdl == nullptr) ? HDL_MOVE : pHdl->GetKind(); + SdrHdlKind eHdl = (pHdl == nullptr) ? SdrHdlKind::Move : pHdl->GetKind(); - if(eHdl==HDL_UPLFT || eHdl==HDL_UPPER || eHdl==HDL_UPRGT || - eHdl==HDL_LEFT || eHdl==HDL_RIGHT || eHdl==HDL_LWLFT || - eHdl==HDL_LOWER || eHdl==HDL_LWRGT) + if(eHdl==SdrHdlKind::UpperLeft || eHdl==SdrHdlKind::Upper || eHdl==SdrHdlKind::UpperRight || + eHdl==SdrHdlKind::Left || eHdl==SdrHdlKind::Right || eHdl==SdrHdlKind::LowerLeft || + eHdl==SdrHdlKind::Lower || eHdl==SdrHdlKind::LowerRight) { return true; } diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index 64927a52b96a..bc917815586c 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -291,7 +291,7 @@ SdrHdl* SdrCaptionObj::GetHdl(sal_uInt32 nHdlNum) const if(nPntNum < aTailPoly.GetSize()) { - SdrHdl* pHdl = new SdrHdl(aTailPoly.GetPoint((sal_uInt16)nPntNum), HDL_POLY); + SdrHdl* pHdl = new SdrHdl(aTailPoly.GetPoint((sal_uInt16)nPntNum), SdrHdlKind::Poly); pHdl->SetPolyNum(1L); pHdl->SetPointNum(nPntNum); return pHdl; diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 7555116860b0..e00783e753dd 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -393,52 +393,52 @@ SdrHdl* SdrCircObj::GetHdl(sal_uInt32 nHdlNum) const SdrHdl* pH = nullptr; Point aPnt; - SdrHdlKind eLocalKind(HDL_MOVE); + SdrHdlKind eLocalKind(SdrHdlKind::Move); sal_uInt32 nPNum(0); switch (nHdlNum) { case 0: aPnt = GetAnglePnt(maRect,nStartAngle); - eLocalKind = HDL_CIRC; + eLocalKind = SdrHdlKind::Circle; nPNum = 1; break; case 1: aPnt = GetAnglePnt(maRect,nEndAngle); - eLocalKind = HDL_CIRC; + eLocalKind = SdrHdlKind::Circle; nPNum = 2L; break; case 2: aPnt = maRect.TopLeft(); - eLocalKind = HDL_UPLFT; + eLocalKind = SdrHdlKind::UpperLeft; break; case 3: aPnt = maRect.TopCenter(); - eLocalKind = HDL_UPPER; + eLocalKind = SdrHdlKind::Upper; break; case 4: aPnt = maRect.TopRight(); - eLocalKind = HDL_UPRGT; + eLocalKind = SdrHdlKind::UpperRight; break; case 5: aPnt = maRect.LeftCenter(); - eLocalKind = HDL_LEFT; + eLocalKind = SdrHdlKind::Left; break; case 6: aPnt = maRect.RightCenter(); - eLocalKind = HDL_RIGHT; + eLocalKind = SdrHdlKind::Right; break; case 7: aPnt = maRect.BottomLeft(); - eLocalKind = HDL_LWLFT; + eLocalKind = SdrHdlKind::LowerLeft; break; case 8: aPnt = maRect.BottomCenter(); - eLocalKind = HDL_LOWER; + eLocalKind = SdrHdlKind::Lower; break; case 9: aPnt = maRect.BottomRight(); - eLocalKind = HDL_LWRGT; + eLocalKind = SdrHdlKind::LowerRight; break; } @@ -452,7 +452,7 @@ SdrHdl* SdrCircObj::GetHdl(sal_uInt32 nHdlNum) const RotatePoint(aPnt,maRect.TopLeft(),aGeo.nSin,aGeo.nCos); } - if (eLocalKind != HDL_MOVE) + if (eLocalKind != SdrHdlKind::Move) { pH = new SdrHdl(aPnt,eLocalKind); pH->SetPointNum(nPNum); @@ -471,7 +471,7 @@ bool SdrCircObj::hasSpecialDrag() const bool SdrCircObj::beginSpecialDrag(SdrDragStat& rDrag) const { - const bool bAngle(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind()); + const bool bAngle(rDrag.GetHdl() && SdrHdlKind::Circle == rDrag.GetHdl()->GetKind()); if(bAngle) { @@ -488,7 +488,7 @@ bool SdrCircObj::beginSpecialDrag(SdrDragStat& rDrag) const bool SdrCircObj::applySpecialDrag(SdrDragStat& rDrag) { - const bool bAngle(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind()); + const bool bAngle(rDrag.GetHdl() && SdrHdlKind::Circle == rDrag.GetHdl()->GetKind()); if(bAngle) { @@ -586,7 +586,7 @@ OUString SdrCircObj::getSpecialDragComment(const SdrDragStat& rDrag) const } else { - const bool bAngle(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind()); + const bool bAngle(rDrag.GetHdl() && SdrHdlKind::Circle == rDrag.GetHdl()->GetKind()); if(bAngle) { diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index 30b766e74a39..b9db46047599 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -1744,10 +1744,10 @@ SdrHdl* SdrEdgeObj::GetHdl(sal_uInt32 nHdlNum) const sal_uInt32 nPointCount(pEdgeTrack->GetPointCount()); if (nPointCount!=0) { if (nHdlNum==0) { - pHdl=new ImpEdgeHdl((*pEdgeTrack)[0],HDL_POLY); + pHdl=new ImpEdgeHdl((*pEdgeTrack)[0],SdrHdlKind::Poly); if (aCon1.pObj!=nullptr && aCon1.bBestVertex) pHdl->Set1PixMore(); } else if (nHdlNum==1) { - pHdl=new ImpEdgeHdl((*pEdgeTrack)[sal_uInt16(nPointCount-1)],HDL_POLY); + pHdl=new ImpEdgeHdl((*pEdgeTrack)[sal_uInt16(nPointCount-1)],SdrHdlKind::Poly); if (aCon2.pObj!=nullptr && aCon2.bBestVertex) pHdl->Set1PixMore(); } else { SdrEdgeKind eKind=static_cast<const SdrEdgeKindItem&>(GetObjectItem(SDRATTR_EDGEKIND)).GetValue(); @@ -1757,7 +1757,7 @@ SdrHdl* SdrEdgeObj::GetHdl(sal_uInt32 nHdlNum) const sal_uInt32 nM(aEdgeInfo.nMiddleLine != 0xFFFF ? 1 : 0); sal_uInt32 nNum(nHdlNum - 2); sal_Int32 nPt(0); - pHdl=new ImpEdgeHdl(Point(),HDL_POLY); + pHdl=new ImpEdgeHdl(Point(),SdrHdlKind::Poly); if (nNum<nO1) { nPt=nNum+1; if (nNum==0) static_cast<ImpEdgeHdl*>(pHdl)->SetLineCode(OBJ1LINE2); @@ -1790,7 +1790,7 @@ SdrHdl* SdrEdgeObj::GetHdl(sal_uInt32 nHdlNum) const sal_uInt32 nNum(nHdlNum); if (GetConnectedNode(true)==nullptr) nNum++; Point aPos((*pEdgeTrack)[(sal_uInt16)nNum-1]); - pHdl=new ImpEdgeHdl(aPos,HDL_POLY); + pHdl=new ImpEdgeHdl(aPos,SdrHdlKind::Poly); if (nNum==2) static_cast<ImpEdgeHdl*>(pHdl)->SetLineCode(OBJ1LINE2); if (nNum==3) static_cast<ImpEdgeHdl*>(pHdl)->SetLineCode(OBJ2LINE2); } diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 4fd6ce448b66..bb9211c93306 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -1541,21 +1541,21 @@ void SdrGrafObj::addCropHandles(SdrHdlList& rTarget) const basegfx::B2DPoint aPos; aPos = aMatrix * basegfx::B2DPoint(0.0, 0.0); - rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_UPLFT, fShearX, fRotate)); + rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::UpperLeft, fShearX, fRotate)); aPos = aMatrix * basegfx::B2DPoint(0.5, 0.0); - rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_UPPER, fShearX, fRotate)); + rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Upper, fShearX, fRotate)); aPos = aMatrix * basegfx::B2DPoint(1.0, 0.0); - rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_UPRGT, fShearX, fRotate)); + rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::UpperRight, fShearX, fRotate)); aPos = aMatrix * basegfx::B2DPoint(0.0, 0.5); - rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_LEFT , fShearX, fRotate)); + rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Left , fShearX, fRotate)); aPos = aMatrix * basegfx::B2DPoint(1.0, 0.5); - rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_RIGHT, fShearX, fRotate)); + rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Right, fShearX, fRotate)); aPos = aMatrix * basegfx::B2DPoint(0.0, 1.0); - rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_LWLFT, fShearX, fRotate)); + rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::LowerLeft, fShearX, fRotate)); aPos = aMatrix * basegfx::B2DPoint(0.5, 1.0); - rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_LOWER, fShearX, fRotate)); + rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Lower, fShearX, fRotate)); aPos = aMatrix * basegfx::B2DPoint(1.0, 1.0); - rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), HDL_LWRGT, fShearX, fRotate)); + rTarget.AddHdl(new SdrCropHdl(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::LowerRight, fShearX, fRotate)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index b18baf6472b8..41146cdbaeb5 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -786,7 +786,7 @@ SdrHdl* SdrMeasureObj::GetHdl(sal_uInt32 nHdlNum) const case 4: aPt=aMPol.aHelpline1.aP2; break; case 5: aPt=aMPol.aHelpline2.aP2; break; } // switch - SdrHdl* pHdl=new ImpMeasureHdl(aPt,HDL_USER); + SdrHdl* pHdl=new ImpMeasureHdl(aPt,SdrHdlKind::User); pHdl->SetObjHdlNum(nHdlNum); pHdl->SetRotationAngle(aMPol.nLineAngle); return pHdl; diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 6f5a83217ac9..0f6071dde53d 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -2054,7 +2054,7 @@ void SdrPathObj::AddToHdlList(SdrHdlList& rHdlList) const for (sal_uInt16 j=0; j<nPntCnt; j++) { if (rXPoly.GetFlags(j)!=XPolyFlags::Control) { const Point& rPnt=rXPoly[j]; - SdrHdl* pHdl=new SdrHdl(rPnt,HDL_POLY); + SdrHdl* pHdl=new SdrHdl(rPnt,SdrHdlKind::Poly); pHdl->SetPolyNum(i); pHdl->SetPointNum(j); pHdl->Set1PixMore(j==0); diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index b1692206c6b5..526f68435ed7 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -319,7 +319,7 @@ SdrHdl* SdrRectObj::GetHdl(sal_uInt32 nHdlNum) const { SdrHdl* pH = nullptr; Point aPnt; - SdrHdlKind eKind = HDL_MOVE; + SdrHdlKind eKind = SdrHdlKind::Move; if(!IsTextFrame()) { @@ -346,17 +346,17 @@ SdrHdl* SdrRectObj::GetHdl(sal_uInt32 nHdlNum) const if (a<0) a=0; aPnt=maRect.TopLeft(); aPnt.X()+=a; - eKind = HDL_CIRC; + eKind = SdrHdlKind::Circle; break; } - case 2: aPnt=maRect.TopLeft(); eKind = HDL_UPLFT; break; - case 3: aPnt=maRect.TopCenter(); eKind = HDL_UPPER; break; - case 4: aPnt=maRect.TopRight(); eKind = HDL_UPRGT; break; - case 5: aPnt=maRect.LeftCenter(); eKind = HDL_LEFT ; break; - case 6: aPnt=maRect.RightCenter(); eKind = HDL_RIGHT; break; - case 7: aPnt=maRect.BottomLeft(); eKind = HDL_LWLFT; break; - case 8: aPnt=maRect.BottomCenter(); eKind = HDL_LOWER; break; - case 9: aPnt=maRect.BottomRight(); eKind = HDL_LWRGT; break; + case 2: aPnt=maRect.TopLeft(); eKind = SdrHdlKind::UpperLeft; break; + case 3: aPnt=maRect.TopCenter(); eKind = SdrHdlKind::Upper; break; + case 4: aPnt=maRect.TopRight(); eKind = SdrHdlKind::UpperRight; break; + case 5: aPnt=maRect.LeftCenter(); eKind = SdrHdlKind::Left ; break; + case 6: aPnt=maRect.RightCenter(); eKind = SdrHdlKind::Right; break; + case 7: aPnt=maRect.BottomLeft(); eKind = SdrHdlKind::LowerLeft; break; + case 8: aPnt=maRect.BottomCenter(); eKind = SdrHdlKind::Lower; break; + case 9: aPnt=maRect.BottomRight(); eKind = SdrHdlKind::LowerRight; break; } if(!pH) @@ -387,7 +387,7 @@ bool SdrRectObj::hasSpecialDrag() const bool SdrRectObj::beginSpecialDrag(SdrDragStat& rDrag) const { - const bool bRad(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind()); + const bool bRad(rDrag.GetHdl() && SdrHdlKind::Circle == rDrag.GetHdl()->GetKind()); if(bRad) { @@ -401,7 +401,7 @@ bool SdrRectObj::beginSpecialDrag(SdrDragStat& rDrag) const bool SdrRectObj::applySpecialDrag(SdrDragStat& rDrag) { - const bool bRad(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind()); + const bool bRad(rDrag.GetHdl() && SdrHdlKind::Circle == rDrag.GetHdl()->GetKind()); if (bRad) { @@ -438,7 +438,7 @@ OUString SdrRectObj::getSpecialDragComment(const SdrDragStat& rDrag) const } else { - const bool bRad(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind()); + const bool bRad(rDrag.GetHdl() && SdrHdlKind::Circle == rDrag.GetHdl()->GetKind()); if(bRad) { diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx index 0d8c54577f2a..93b0fad4aac1 100644 --- a/svx/source/svdraw/svdotxdr.cxx +++ b/svx/source/svdraw/svdotxdr.cxx @@ -41,20 +41,20 @@ SdrHdl* SdrTextObj::GetHdl(sal_uInt32 nHdlNum) const { SdrHdl* pH=nullptr; Point aPnt; - SdrHdlKind eKind=HDL_MOVE; + SdrHdlKind eKind=SdrHdlKind::Move; switch (nHdlNum) { - case 0: aPnt=maRect.TopLeft(); eKind=HDL_UPLFT; break; - case 1: aPnt=maRect.TopCenter(); eKind=HDL_UPPER; break; - case 2: aPnt=maRect.TopRight(); eKind=HDL_UPRGT; break; - case 3: aPnt=maRect.LeftCenter(); eKind=HDL_LEFT ; break; - case 4: aPnt=maRect.RightCenter(); eKind=HDL_RIGHT; break; - case 5: aPnt=maRect.BottomLeft(); eKind=HDL_LWLFT; break; - case 6: aPnt=maRect.BottomCenter(); eKind=HDL_LOWER; break; - case 7: aPnt=maRect.BottomRight(); eKind=HDL_LWRGT; break; + case 0: aPnt=maRect.TopLeft(); eKind=SdrHdlKind::UpperLeft; break; + case 1: aPnt=maRect.TopCenter(); eKind=SdrHdlKind::Upper; break; + case 2: aPnt=maRect.TopRight(); eKind=SdrHdlKind::UpperRight; break; + case 3: aPnt=maRect.LeftCenter(); eKind=SdrHdlKind::Left ; break; + case 4: aPnt=maRect.RightCenter(); eKind=SdrHdlKind::Right; break; + case 5: aPnt=maRect.BottomLeft(); eKind=SdrHdlKind::LowerLeft; break; + case 6: aPnt=maRect.BottomCenter(); eKind=SdrHdlKind::Lower; break; + case 7: aPnt=maRect.BottomRight(); eKind=SdrHdlKind::LowerRight; break; } if (aGeo.nShearAngle!=0) ShearPoint(aPnt,maRect.TopLeft(),aGeo.nTan); if (aGeo.nRotationAngle!=0) RotatePoint(aPnt,maRect.TopLeft(),aGeo.nSin,aGeo.nCos); - if (eKind!=HDL_MOVE) { + if (eKind!=SdrHdlKind::Move) { pH=new SdrHdl(aPnt,eKind); pH->SetObj(const_cast<SdrTextObj*>(this)); pH->SetRotationAngle(aGeo.nRotationAngle); @@ -72,8 +72,8 @@ Rectangle SdrTextObj::ImpDragCalcRect(const SdrDragStat& rDrag) const { Rectangle aTmpRect(maRect); const SdrHdl* pHdl=rDrag.GetHdl(); - SdrHdlKind eHdl=pHdl==nullptr ? HDL_MOVE : pHdl->GetKind(); - bool bEcke=(eHdl==HDL_UPLFT || eHdl==HDL_UPRGT || eHdl==HDL_LWLFT || eHdl==HDL_LWRGT); + SdrHdlKind eHdl=pHdl==nullptr ? SdrHdlKind::Move : pHdl->GetKind(); + bool bEcke=(eHdl==SdrHdlKind::UpperLeft || eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::LowerLeft || eHdl==SdrHdlKind::LowerRight); bool bOrtho=rDrag.GetView()!=nullptr && rDrag.GetView()->IsOrtho(); bool bBigOrtho=bEcke && bOrtho && rDrag.GetView()->IsBigOrtho(); Point aPos(rDrag.GetNow()); @@ -82,10 +82,10 @@ Rectangle SdrTextObj::ImpDragCalcRect(const SdrDragStat& rDrag) const // Unshear: if (aGeo.nShearAngle!=0) ShearPoint(aPos,aTmpRect.TopLeft(),-aGeo.nTan); - bool bLft=(eHdl==HDL_UPLFT || eHdl==HDL_LEFT || eHdl==HDL_LWLFT); - bool bRgt=(eHdl==HDL_UPRGT || eHdl==HDL_RIGHT || eHdl==HDL_LWRGT); - bool bTop=(eHdl==HDL_UPRGT || eHdl==HDL_UPPER || eHdl==HDL_UPLFT); - bool bBtm=(eHdl==HDL_LWRGT || eHdl==HDL_LOWER || eHdl==HDL_LWLFT); + bool bLft=(eHdl==SdrHdlKind::UpperLeft || eHdl==SdrHdlKind::Left || eHdl==SdrHdlKind::LowerLeft); + bool bRgt=(eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::Right || eHdl==SdrHdlKind::LowerRight); + bool bTop=(eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::Upper || eHdl==SdrHdlKind::UpperLeft); + bool bBtm=(eHdl==SdrHdlKind::LowerRight || eHdl==SdrHdlKind::Lower || eHdl==SdrHdlKind::LowerLeft); if (bLft) aTmpRect.Left() =aPos.X(); if (bRgt) aTmpRect.Right() =aPos.X(); if (bTop) aTmpRect.Top() =aPos.Y(); diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index ab936dbed8b8..76acf83e4138 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -621,7 +621,7 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co else if (eHit==SdrHitKind::Handle) { eEvent=SdrEventKind::BeginDragObj; // Mark+Drag,AddMark+Drag,DeepMark+Drag,Unmark - bool bGlue=pHdl->GetKind()==HDL_GLUE; + bool bGlue=pHdl->GetKind()==SdrHdlKind::Glue; bool bPoly=!bGlue && IsPointMarkable(*pHdl); bool bMarked=bGlue || (bPoly && pHdl->IsSelected()); if (bGlue || bPoly) @@ -1049,10 +1049,10 @@ Pointer SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDevice* SdrHdl* pHdl=aVEvt.pHdl; // now check the pointers for dragging if (pHdl!=nullptr || bMarkHit) { - SdrHdlKind eHdl= pHdl!=nullptr ? pHdl->GetKind() : HDL_MOVE; + SdrHdlKind eHdl= pHdl!=nullptr ? pHdl->GetKind() : SdrHdlKind::Move; bool bCorner=pHdl!=nullptr && pHdl->IsCornerHdl(); bool bVertex=pHdl!=nullptr && pHdl->IsVertexHdl(); - bool bMov=eHdl==HDL_MOVE; + bool bMov=eHdl==SdrHdlKind::Move; if (bMov && (meDragMode==SdrDragMode::Move || meDragMode==SdrDragMode::Resize || mbMarkedHitMovesAlways)) { if (!IsMoveAllowed()) return Pointer(PointerStyle::Arrow); // because double click or drag & drop is possible return Pointer(PointerStyle::Move); @@ -1089,8 +1089,8 @@ Pointer SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDevice* } break; case SdrDragMode::Mirror: { if (bCorner || bVertex || bMov) { - SdrHdl* pH1=maHdlList.GetHdl(HDL_REF1); - SdrHdl* pH2=maHdlList.GetHdl(HDL_REF2); + SdrHdl* pH1=maHdlList.GetHdl(SdrHdlKind::Ref1); + SdrHdl* pH2=maHdlList.GetHdl(SdrHdlKind::Ref2); bool b90=false; bool b45=false; Point aDif; |