convert SdrHdlKind to scoped enum
Change-Id: Ib0a06d94f8b51cce1f29f20d1c00d54be939c076
This commit is contained in:
parent
c3b305149e
commit
6fc92adb8f
@ -675,11 +675,11 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
|
||||
if(pHitSelectionHdl)
|
||||
{
|
||||
SdrHdlKind eKind = pHitSelectionHdl->GetKind();
|
||||
if( eKind==HDL_UPPER || eKind==HDL_LOWER )
|
||||
if( eKind==SdrHdlKind::Upper || eKind==SdrHdlKind::Lower )
|
||||
eRotationDirection = DragMethod_RotateDiagram::ROTATIONDIRECTION_X;
|
||||
else if( eKind==HDL_LEFT || eKind==HDL_RIGHT )
|
||||
else if( eKind==SdrHdlKind::Left || eKind==SdrHdlKind::Right )
|
||||
eRotationDirection = DragMethod_RotateDiagram::ROTATIONDIRECTION_Y;
|
||||
else if( eKind==HDL_UPLFT || eKind==HDL_UPRGT || eKind==HDL_LWLFT || eKind==HDL_LWRGT )
|
||||
else if( eKind==SdrHdlKind::UpperLeft || eKind==SdrHdlKind::UpperRight || eKind==SdrHdlKind::LowerLeft || eKind==SdrHdlKind::LowerRight )
|
||||
eRotationDirection = DragMethod_RotateDiagram::ROTATIONDIRECTION_Z;
|
||||
}
|
||||
pDragMethod = new DragMethod_RotateDiagram( *pDrawViewWrapper, m_aSelection.getSelectedCID(), getModel(), eRotationDirection );
|
||||
|
@ -602,7 +602,7 @@ bool SelectionHelper::getMarkHandles( SdrHdlList& rHdlList )
|
||||
for( sal_uInt32 nM = 0L; nM < aPolygon.count(); nM++)
|
||||
{
|
||||
const ::basegfx::B2DPoint aPoint(aPolygon.getB2DPoint(nM));
|
||||
SdrHdl* pHdl = new SdrHdl(Point(basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY())), HDL_POLY);
|
||||
SdrHdl* pHdl = new SdrHdl(Point(basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY())), SdrHdlKind::Poly);
|
||||
rHdlList.AddHdl(pHdl);
|
||||
}
|
||||
}
|
||||
@ -648,7 +648,7 @@ bool SelectionHelper::getMarkHandles( SdrHdlList& rHdlList )
|
||||
}
|
||||
|
||||
Point aPos = pSubObj->GetCurrentBoundRect().Center();
|
||||
SdrHdl* pHdl = new SdrHdl(aPos,HDL_POLY);
|
||||
SdrHdl* pHdl = new SdrHdl(aPos,SdrHdlKind::Poly);
|
||||
rHdlList.AddHdl(pHdl);
|
||||
}
|
||||
return true;
|
||||
|
@ -209,8 +209,8 @@ public:
|
||||
|
||||
inline const Rectangle& SdrDragMethod::GetMarkedRect() const
|
||||
{
|
||||
return getSdrDragView().meDragHdl==HDL_POLY ? getSdrDragView().GetMarkedPointsRect() :
|
||||
getSdrDragView().meDragHdl==HDL_GLUE ? getSdrDragView().GetMarkedGluePointsRect() :
|
||||
return getSdrDragView().meDragHdl==SdrHdlKind::Poly ? getSdrDragView().GetMarkedPointsRect() :
|
||||
getSdrDragView().meDragHdl==SdrHdlKind::Glue ? getSdrDragView().GetMarkedGluePointsRect() :
|
||||
getSdrDragView().GetMarkedObjRect();
|
||||
}
|
||||
|
||||
|
@ -101,8 +101,8 @@ public:
|
||||
bool IsDragObj() const { return mpCurrentSdrDragMethod && !mbInsPolyPoint && !mbInsGluePoint; }
|
||||
SdrHdl* GetDragHdl() const { return mpDragHdl; }
|
||||
SdrDragMethod* GetDragMethod() const { return mpCurrentSdrDragMethod; }
|
||||
bool IsDraggingPoints() const { return meDragHdl==HDL_POLY; }
|
||||
bool IsDraggingGluePoints() const { return meDragHdl==HDL_GLUE; }
|
||||
bool IsDraggingPoints() const { return meDragHdl==SdrHdlKind::Poly; }
|
||||
bool IsDraggingGluePoints() const { return meDragHdl==SdrHdlKind::Glue; }
|
||||
|
||||
// If you want to define that already during BegDrag
|
||||
// or in the middle.
|
||||
|
@ -47,38 +47,38 @@ class MouseEvent;
|
||||
// is picked up from the handle and passed to the app (on demand) to be switched on
|
||||
// Handles like e.g. rotation center or the mirror axis are generated by
|
||||
// the view if the correct transformation mode was selected by the controller.
|
||||
// HDL_MOVE...HDL_LWRGT should always be consecutive in the enum!
|
||||
// SdrHdlKind::Move...SdrHdlKind::LowerRight should always be consecutive in the enum!
|
||||
|
||||
enum SdrHdlKind
|
||||
enum class SdrHdlKind
|
||||
{
|
||||
HDL_MOVE, // Handle to move the object
|
||||
HDL_UPLFT, // Upper left
|
||||
HDL_UPPER, // Upper
|
||||
HDL_UPRGT, // Upper right
|
||||
HDL_LEFT, // Left
|
||||
HDL_RIGHT, // Right
|
||||
HDL_LWLFT, // Bottom left
|
||||
HDL_LOWER, // Bottom
|
||||
HDL_LWRGT, // Bottom right
|
||||
HDL_POLY, // Select point in polygon or beziercurve
|
||||
HDL_BWGT, // Weight of a beziercurve
|
||||
HDL_CIRC, // Angle to circle segment, corner radius to rectangle
|
||||
HDL_REF1, // Reference point 1, e.g. rotation center
|
||||
HDL_REF2, // Reference point 2, e.g. endpoint of mirror axis
|
||||
HDL_MIRX, // Mirror axis
|
||||
HDL_GLUE, // GluePoint
|
||||
HDL_GLUE_DESELECTED, // GluePoint
|
||||
HDL_ANCHOR, // Anchor symbol (SD, SW)
|
||||
HDL_TRNS, // Interactive transparence
|
||||
HDL_GRAD, // Interactive gradient
|
||||
HDL_COLR, // Interactive color
|
||||
HDL_USER,
|
||||
HDL_ANCHOR_TR, // #101688# Anchor handle with (0,0) at top right for SW
|
||||
Move, // Handle to move the object
|
||||
UpperLeft, // Upper left
|
||||
Upper, // Upper
|
||||
UpperRight, // Upper right
|
||||
Left, // Left
|
||||
Right, // Right
|
||||
LowerLeft, // Bottom left
|
||||
Lower, // Bottom
|
||||
LowerRight, // Bottom right
|
||||
Poly, // Select point in polygon or beziercurve
|
||||
BezierWeight, // Weight of a beziercurve
|
||||
Circle, // Angle to circle segment, corner radius to rectangle
|
||||
Ref1, // Reference point 1, e.g. rotation center
|
||||
Ref2, // Reference point 2, e.g. endpoint of mirror axis
|
||||
MirrorAxis, // Mirror axis
|
||||
Glue, // GluePoint
|
||||
GlueDeselected, // GluePoint
|
||||
Anchor, // Anchor symbol (SD, SW)
|
||||
Transparence, // Interactive transparence
|
||||
Gradient, // Interactive gradient
|
||||
Color, // Interactive color
|
||||
User,
|
||||
Anchor_TR, // #101688# Anchor handle with (0,0) at top right for SW
|
||||
|
||||
// for SJ and the CustomShapeHandles:
|
||||
HDL_CUSTOMSHAPE1,
|
||||
CustomShape1,
|
||||
|
||||
HDL_SMARTTAG
|
||||
SmartTag
|
||||
};
|
||||
|
||||
|
||||
@ -176,7 +176,7 @@ protected:
|
||||
|
||||
public:
|
||||
SdrHdl();
|
||||
explicit SdrHdl(const Point& rPnt, SdrHdlKind eNewKind=HDL_MOVE);
|
||||
explicit SdrHdl(const Point& rPnt, SdrHdlKind eNewKind=SdrHdlKind::Move);
|
||||
virtual ~SdrHdl();
|
||||
|
||||
const sdr::overlay::OverlayObjectList& getOverlayObjectList() const { return maOverlayGroup; }
|
||||
@ -200,8 +200,8 @@ public:
|
||||
void Set1PixMore(bool bJa=true);
|
||||
void SetRotationAngle(long n);
|
||||
|
||||
bool IsCornerHdl() const { return eKind==HDL_UPLFT || eKind==HDL_UPRGT || eKind==HDL_LWLFT || eKind==HDL_LWRGT; }
|
||||
bool IsVertexHdl() const { return eKind==HDL_UPPER || eKind==HDL_LOWER || eKind==HDL_LEFT || eKind==HDL_RIGHT; }
|
||||
bool IsCornerHdl() const { return eKind==SdrHdlKind::UpperLeft || eKind==SdrHdlKind::UpperRight || eKind==SdrHdlKind::LowerLeft || eKind==SdrHdlKind::LowerRight; }
|
||||
bool IsVertexHdl() const { return eKind==SdrHdlKind::Upper || eKind==SdrHdlKind::Lower || eKind==SdrHdlKind::Left || eKind==SdrHdlKind::Right; }
|
||||
|
||||
void SetObjHdlNum(sal_uInt32 nNum) { nObjHdlNum=nNum; }
|
||||
sal_uInt32 GetObjHdlNum() const { return nObjHdlNum; }
|
||||
@ -338,7 +338,7 @@ protected:
|
||||
SdrHdl* pHdl2;
|
||||
|
||||
public:
|
||||
SdrHdlLine(SdrHdl& rHdl1, SdrHdl& rHdl2, SdrHdlKind eNewKind=HDL_MIRX) { eKind=eNewKind; pHdl1=&rHdl1; pHdl2=&rHdl2; }
|
||||
SdrHdlLine(SdrHdl& rHdl1, SdrHdl& rHdl2, SdrHdlKind eNewKind=SdrHdlKind::MirrorAxis) { eKind=eNewKind; pHdl1=&rHdl1; pHdl2=&rHdl2; }
|
||||
virtual ~SdrHdlLine();
|
||||
|
||||
virtual Pointer GetPointer() const override;
|
||||
@ -357,7 +357,7 @@ protected:
|
||||
|
||||
public:
|
||||
// this is not a Copy-Ctor!!!
|
||||
SdrHdlBezWgt(const SdrHdl* pRefHdl1, SdrHdlKind eNewKind=HDL_BWGT) { eKind=eNewKind; pHdl1=pRefHdl1; }
|
||||
SdrHdlBezWgt(const SdrHdl* pRefHdl1, SdrHdlKind eNewKind=SdrHdlKind::BezierWeight) { eKind=eNewKind; pHdl1=pRefHdl1; }
|
||||
virtual ~SdrHdlBezWgt();
|
||||
};
|
||||
|
||||
|
@ -1642,17 +1642,17 @@ void OViewsWindow::handleKey(const vcl::KeyCode& _rCode)
|
||||
|
||||
switch(pHdl->GetKind())
|
||||
{
|
||||
case HDL_LEFT:
|
||||
case HDL_UPLFT:
|
||||
case HDL_LWLFT:
|
||||
case HDL_UPPER:
|
||||
case SdrHdlKind::Left:
|
||||
case SdrHdlKind::UpperLeft:
|
||||
case SdrHdlKind::LowerLeft:
|
||||
case SdrHdlKind::Upper:
|
||||
aNewRect.Left() += nX;
|
||||
aNewRect.Top() += nY;
|
||||
break;
|
||||
case HDL_UPRGT:
|
||||
case HDL_RIGHT:
|
||||
case HDL_LWRGT:
|
||||
case HDL_LOWER:
|
||||
case SdrHdlKind::UpperRight:
|
||||
case SdrHdlKind::Right:
|
||||
case SdrHdlKind::LowerRight:
|
||||
case SdrHdlKind::Lower:
|
||||
aNewRect.setWidth(aNewRect.getWidth() + nX);
|
||||
aNewRect.setHeight(aNewRect.getHeight() + nY);
|
||||
break;
|
||||
|
@ -586,7 +586,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
|
||||
|
||||
if(pHdl)
|
||||
{
|
||||
if(pHdl->GetKind() == HDL_POLY)
|
||||
if(pHdl->GetKind() == SdrHdlKind::Poly)
|
||||
{
|
||||
// rescue ID of point with focus
|
||||
sal_uInt32 nPol(pHdl->GetPolyNum());
|
||||
@ -619,7 +619,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
|
||||
SdrHdl* pAct = rHdlList.GetHdl(a);
|
||||
|
||||
if(pAct
|
||||
&& pAct->GetKind() == HDL_POLY
|
||||
&& pAct->GetKind() == SdrHdlKind::Poly
|
||||
&& pAct->GetPolyNum() == nPol
|
||||
&& pAct->GetPointNum() == nPnt)
|
||||
{
|
||||
|
@ -126,7 +126,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
|
||||
if( ScDrawLayer::IsNoteCaption( pMarkedObj ) )
|
||||
{
|
||||
// move using the valid caption handles for note text box.
|
||||
if(pHdl && (pHdl->GetKind() != HDL_POLY && pHdl->GetKind() != HDL_CIRC))
|
||||
if(pHdl && (pHdl->GetKind() != SdrHdlKind::Poly && pHdl->GetKind() != SdrHdlKind::Circle))
|
||||
bDrag = true;
|
||||
// move the complete note box.
|
||||
else if(!pHdl)
|
||||
|
@ -239,7 +239,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
|
||||
SdrObject* pMarkedObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
|
||||
if( ScDrawLayer::IsNoteCaption( pMarkedObj ) )
|
||||
{
|
||||
if(pHdl->GetKind() != HDL_POLY && pHdl->GetKind() != HDL_CIRC)
|
||||
if(pHdl->GetKind() != SdrHdlKind::Poly && pHdl->GetKind() != SdrHdlKind::Circle)
|
||||
bDrag = true;
|
||||
}
|
||||
else
|
||||
|
@ -75,8 +75,8 @@ void ScDrawView::SetPageAnchored()
|
||||
pViewData->GetDocShell()->SetDrawModified();
|
||||
|
||||
// Remove the anchor object.
|
||||
maHdlList.RemoveAllByKind(HDL_ANCHOR);
|
||||
maHdlList.RemoveAllByKind(HDL_ANCHOR_TR);
|
||||
maHdlList.RemoveAllByKind(SdrHdlKind::Anchor);
|
||||
maHdlList.RemoveAllByKind(SdrHdlKind::Anchor_TR);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ void ScGridWindow::CreateAnchorHandle(SdrHdlList& rHdl, const ScAddress& rAddres
|
||||
bool bNegativePage = pViewData->GetDocument()->IsNegativePage( pViewData->GetTabNo() );
|
||||
Point aPos = pViewData->GetScrPos( rAddress.Col(), rAddress.Row(), eWhich, true );
|
||||
aPos = PixelToLogic(aPos);
|
||||
rHdl.AddHdl(new SdrHdl(aPos, bNegativePage ? HDL_ANCHOR_TR : HDL_ANCHOR));
|
||||
rHdl.AddHdl(new SdrHdl(aPos, bNegativePage ? SdrHdlKind::Anchor_TR : SdrHdlKind::Anchor));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ void SdTiledRenderingTest::testSetGraphicSelection()
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(8), pObject->GetHdlCount());
|
||||
// Take the bottom center one.
|
||||
SdrHdl* pHdl = pObject->GetHdl(6);
|
||||
CPPUNIT_ASSERT_EQUAL(HDL_LOWER, pHdl->GetKind());
|
||||
CPPUNIT_ASSERT_EQUAL((int)SdrHdlKind::Lower, (int)pHdl->GetKind());
|
||||
Rectangle aShapeBefore = pObject->GetSnapRect();
|
||||
// Resize.
|
||||
pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_START, convertMm100ToTwip(pHdl->GetPos().getX()), convertMm100ToTwip(pHdl->GetPos().getY()));
|
||||
|
@ -527,12 +527,12 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl )
|
||||
// to create the needed local SdrDragEntry for it in createSdrDragEntries()
|
||||
const basegfx::B2DPolyPolygon aDragPoly(mpPathObj->GetPathPoly());
|
||||
|
||||
if( (pHdl->GetKind() == HDL_MOVE) || (pHdl->GetKind() == HDL_SMARTTAG) )
|
||||
if( (pHdl->GetKind() == SdrHdlKind::Move) || (pHdl->GetKind() == SdrHdlKind::SmartTag) )
|
||||
{
|
||||
pDragMethod = new PathDragMove( mrView, xTag, aDragPoly );
|
||||
pHdl->SetPos( aMDPos );
|
||||
}
|
||||
else if( pHdl->GetKind() == HDL_POLY )
|
||||
else if( pHdl->GetKind() == SdrHdlKind::Poly )
|
||||
{
|
||||
pDragMethod = new PathDragObjOwn( mrView, aDragPoly );
|
||||
}
|
||||
@ -628,7 +628,7 @@ bool MotionPathTag::OnMarkHandle( const KeyEvent& rKEvt )
|
||||
const SdrHdlList& rHdlList = mrView.GetHdlList();
|
||||
SdrHdl* pHdl = rHdlList.GetFocusHdl();
|
||||
|
||||
if(pHdl && pHdl->GetKind() == HDL_POLY )
|
||||
if(pHdl && pHdl->GetKind() == SdrHdlKind::Poly )
|
||||
{
|
||||
// rescue ID of point with focus
|
||||
sal_uInt32 nPol(pHdl->GetPolyNum());
|
||||
@ -659,7 +659,7 @@ bool MotionPathTag::OnMarkHandle( const KeyEvent& rKEvt )
|
||||
{
|
||||
SdrHdl* pAct = rHdlList.GetHdl(a);
|
||||
|
||||
if(pAct && pAct->GetKind() == HDL_POLY && pAct->GetPolyNum() == nPol && pAct->GetPointNum() == nPnt)
|
||||
if(pAct && pAct->GetKind() == SdrHdlKind::Poly && pAct->GetPolyNum() == nPol && pAct->GetPointNum() == nPnt)
|
||||
pNewOne = pAct;
|
||||
}
|
||||
|
||||
@ -714,15 +714,15 @@ bool MotionPathTag::OnMove( const KeyEvent& rKEvt )
|
||||
// start dragging
|
||||
rtl::Reference< MotionPathTag > xTag( this );
|
||||
SdrDragMethod* pDragMethod = nullptr;
|
||||
if( (pHdl->GetKind() == HDL_MOVE) || (pHdl->GetKind() == HDL_SMARTTAG) )
|
||||
if( (pHdl->GetKind() == SdrHdlKind::Move) || (pHdl->GetKind() == SdrHdlKind::SmartTag) )
|
||||
{
|
||||
pDragMethod = new PathDragMove( mrView, xTag );
|
||||
}
|
||||
else if( pHdl->GetKind() == HDL_POLY )
|
||||
else if( pHdl->GetKind() == SdrHdlKind::Poly )
|
||||
{
|
||||
pDragMethod = new PathDragObjOwn( mrView );
|
||||
}
|
||||
else if( pHdl->GetKind() != HDL_BWGT )
|
||||
else if( pHdl->GetKind() != SdrHdlKind::BezierWeight )
|
||||
{
|
||||
pDragMethod = new PathDragResize( mrView, xTag );
|
||||
}
|
||||
@ -787,7 +787,7 @@ sal_uLong MotionPathTag::GetMarkedPointCount() const
|
||||
bool MotionPathTag::MarkPoint(SdrHdl& rHdl, bool bUnmark )
|
||||
{
|
||||
bool bRet=false;
|
||||
if( mpPathObj && mrView.IsPointMarkable( rHdl ) && (rHdl.GetKind() != HDL_SMARTTAG) )
|
||||
if( mpPathObj && mrView.IsPointMarkable( rHdl ) && (rHdl.GetKind() != SdrHdlKind::SmartTag) )
|
||||
{
|
||||
SmartHdl* pSmartHdl = dynamic_cast< SmartHdl* >( &rHdl );
|
||||
if( pSmartHdl && pSmartHdl->getTag().get() == this )
|
||||
@ -955,23 +955,23 @@ void MotionPathTag::addCustomHandles( SdrHdlList& rHandlerList )
|
||||
bool bHgt0=aRect.Top()==aRect.Bottom();
|
||||
if (bWdt0 && bHgt0)
|
||||
{
|
||||
rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopLeft(),HDL_UPLFT));
|
||||
rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopLeft(),SdrHdlKind::UpperLeft));
|
||||
}
|
||||
else if (bWdt0 || bHgt0)
|
||||
{
|
||||
rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopLeft() ,HDL_UPLFT));
|
||||
rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.BottomRight(),HDL_LWRGT));
|
||||
rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopLeft() ,SdrHdlKind::UpperLeft));
|
||||
rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.BottomRight(),SdrHdlKind::LowerRight));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!bWdt0 && !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopLeft() ,HDL_UPLFT));
|
||||
if ( !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopCenter() ,HDL_UPPER));
|
||||
if (!bWdt0 && !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopRight() ,HDL_UPRGT));
|
||||
if (!bWdt0 ) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.LeftCenter() ,HDL_LEFT ));
|
||||
if (!bWdt0 ) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.RightCenter() ,HDL_RIGHT));
|
||||
if (!bWdt0 && !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.BottomLeft() ,HDL_LWLFT));
|
||||
if ( !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.BottomCenter(),HDL_LOWER));
|
||||
if (!bWdt0 && !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.BottomRight() ,HDL_LWRGT));
|
||||
if (!bWdt0 && !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopLeft() ,SdrHdlKind::UpperLeft));
|
||||
if ( !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopCenter() ,SdrHdlKind::Upper));
|
||||
if (!bWdt0 && !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopRight() ,SdrHdlKind::UpperRight));
|
||||
if (!bWdt0 ) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.LeftCenter() ,SdrHdlKind::Left ));
|
||||
if (!bWdt0 ) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.RightCenter() ,SdrHdlKind::Right));
|
||||
if (!bWdt0 && !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.BottomLeft() ,SdrHdlKind::LowerLeft));
|
||||
if ( !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.BottomCenter(),SdrHdlKind::Lower));
|
||||
if (!bWdt0 && !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.BottomRight() ,SdrHdlKind::LowerRight));
|
||||
}
|
||||
|
||||
while( nCount < rHandlerList.GetHdlCount() )
|
||||
|
@ -526,7 +526,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt)
|
||||
|
||||
if(pHdl)
|
||||
{
|
||||
if(pHdl->GetKind() == HDL_POLY)
|
||||
if(pHdl->GetKind() == SdrHdlKind::Poly)
|
||||
{
|
||||
// rescue ID of point with focus
|
||||
sal_uInt32 nPol(pHdl->GetPolyNum());
|
||||
@ -559,7 +559,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt)
|
||||
SdrHdl* pAct = rHdlList.GetHdl(a);
|
||||
|
||||
if(pAct
|
||||
&& pAct->GetKind() == HDL_POLY
|
||||
&& pAct->GetKind() == SdrHdlKind::Poly
|
||||
&& pAct->GetPolyNum() == nPol
|
||||
&& pAct->GetPointNum() == nPnt)
|
||||
{
|
||||
|
@ -438,7 +438,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
|
||||
SdrViewEvent aVEvt;
|
||||
SdrHitKind eHit = mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
|
||||
|
||||
if (eHit == SdrHitKind::Handle && aVEvt.pHdl->GetKind() == HDL_BWGT)
|
||||
if (eHit == SdrHitKind::Handle && aVEvt.pHdl->GetKind() == SdrHdlKind::BezierWeight)
|
||||
{
|
||||
/******************************************************************
|
||||
* Drag Handle
|
||||
@ -718,9 +718,9 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
mpView->Start3DCreation();
|
||||
bSuppressChangesOfSelection = false;
|
||||
}
|
||||
else if (pHdl->GetKind() != HDL_MIRX &&
|
||||
pHdl->GetKind() != HDL_REF1 &&
|
||||
pHdl->GetKind() != HDL_REF2 && mpView->Is3DRotationCreationActive())
|
||||
else if (pHdl->GetKind() != SdrHdlKind::MirrorAxis &&
|
||||
pHdl->GetKind() != SdrHdlKind::Ref1 &&
|
||||
pHdl->GetKind() != SdrHdlKind::Ref2 && mpView->Is3DRotationCreationActive())
|
||||
{
|
||||
/*********************************************************
|
||||
* If 3D-rotation bodies are about to be created,
|
||||
|
@ -348,14 +348,14 @@ void SmartTagSet::CheckPossibilities()
|
||||
mxSelectedTag->CheckPossibilities();
|
||||
}
|
||||
|
||||
SmartHdl::SmartHdl( const SmartTagReference& xTag, SdrObject* pObject, const Point& rPnt, SdrHdlKind eNewKind /*=HDL_MOVE*/ )
|
||||
SmartHdl::SmartHdl( const SmartTagReference& xTag, SdrObject* pObject, const Point& rPnt, SdrHdlKind eNewKind /*=SdrHdlKind::Move*/ )
|
||||
: SdrHdl( rPnt, eNewKind )
|
||||
, mxTag( xTag )
|
||||
{
|
||||
SetObj( pObject );
|
||||
}
|
||||
|
||||
SmartHdl::SmartHdl( const SmartTagReference& xTag, const Point& rPnt, SdrHdlKind eNewKind /*=HDL_MOVE*/ )
|
||||
SmartHdl::SmartHdl( const SmartTagReference& xTag, const Point& rPnt, SdrHdlKind eNewKind /*=SdrHdlKind::Move*/ )
|
||||
: SdrHdl( rPnt, eNewKind )
|
||||
, mxTag( xTag )
|
||||
{
|
||||
|
@ -164,8 +164,8 @@ private:
|
||||
class SmartHdl : public SdrHdl
|
||||
{
|
||||
public:
|
||||
SmartHdl( const SmartTagReference& xTag, SdrObject* pObject, const Point& rPnt, SdrHdlKind eNewKind=HDL_SMARTTAG );
|
||||
SmartHdl( const SmartTagReference& xTag, const Point& rPnt, SdrHdlKind eNewKind=HDL_SMARTTAG );
|
||||
SmartHdl( const SmartTagReference& xTag, SdrObject* pObject, const Point& rPnt, SdrHdlKind eNewKind=SdrHdlKind::SmartTag );
|
||||
SmartHdl( const SmartTagReference& xTag, const Point& rPnt, SdrHdlKind eNewKind=SdrHdlKind::SmartTag );
|
||||
|
||||
const SmartTagReference& getTag() const { return mxTag; }
|
||||
|
||||
|
@ -518,7 +518,7 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge
|
||||
{
|
||||
SdrHdl* pIAOHandle = rHdlList.GetHdl( n );
|
||||
|
||||
if( pIAOHandle && ( HDL_COLR == pIAOHandle->GetKind() ) )
|
||||
if( pIAOHandle && ( SdrHdlKind::Color == pIAOHandle->GetKind() ) )
|
||||
{
|
||||
if(pIAOHandle->getOverlayObjectList().isHitPixel(rEvt.maPosPixel))
|
||||
{
|
||||
@ -672,7 +672,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt,
|
||||
{
|
||||
SdrHdl* pIAOHandle = rHdlList.GetHdl( n );
|
||||
|
||||
if( pIAOHandle && ( HDL_COLR == pIAOHandle->GetKind() ) )
|
||||
if( pIAOHandle && ( SdrHdlKind::Color == pIAOHandle->GetKind() ) )
|
||||
{
|
||||
if(pIAOHandle->getOverlayObjectList().isHitPixel(rEvt.maPosPixel))
|
||||
{
|
||||
|
@ -105,7 +105,7 @@ public:
|
||||
E3dDragMove(
|
||||
SdrDragView &rView,
|
||||
const SdrMarkList& rMark,
|
||||
SdrHdlKind eDrgHdl = HDL_MOVE,
|
||||
SdrHdlKind eDrgHdl = SdrHdlKind::Move,
|
||||
E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
|
||||
bool bFull = false);
|
||||
|
||||
|
@ -541,7 +541,7 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
|
||||
|
||||
if(pHdl)
|
||||
{
|
||||
if(pHdl->GetKind() == HDL_POLY)
|
||||
if(pHdl->GetKind() == SdrHdlKind::Poly)
|
||||
{
|
||||
// rescue ID of point with focus
|
||||
sal_uInt32 nPol(pHdl->GetPolyNum());
|
||||
@ -574,7 +574,7 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
|
||||
SdrHdl* pAct = rHdlList.GetHdl(a);
|
||||
|
||||
if(pAct
|
||||
&& pAct->GetKind() == HDL_POLY
|
||||
&& pAct->GetKind() == SdrHdlKind::Poly
|
||||
&& pAct->GetPolyNum() == nPol
|
||||
&& pAct->GetPointNum() == nPnt)
|
||||
{
|
||||
|
@ -441,39 +441,39 @@ E3dDragMove::E3dDragMove(SdrDragView &_rView,
|
||||
{
|
||||
switch(meWhatDragHdl)
|
||||
{
|
||||
case HDL_LEFT:
|
||||
case SdrHdlKind::Left:
|
||||
maScaleFixPos = maFullBound.RightCenter();
|
||||
break;
|
||||
case HDL_RIGHT:
|
||||
case SdrHdlKind::Right:
|
||||
maScaleFixPos = maFullBound.LeftCenter();
|
||||
break;
|
||||
case HDL_UPPER:
|
||||
case SdrHdlKind::Upper:
|
||||
maScaleFixPos = maFullBound.BottomCenter();
|
||||
break;
|
||||
case HDL_LOWER:
|
||||
case SdrHdlKind::Lower:
|
||||
maScaleFixPos = maFullBound.TopCenter();
|
||||
break;
|
||||
case HDL_UPLFT:
|
||||
case SdrHdlKind::UpperLeft:
|
||||
maScaleFixPos = maFullBound.BottomRight();
|
||||
break;
|
||||
case HDL_UPRGT:
|
||||
case SdrHdlKind::UpperRight:
|
||||
maScaleFixPos = maFullBound.BottomLeft();
|
||||
break;
|
||||
case HDL_LWLFT:
|
||||
case SdrHdlKind::LowerLeft:
|
||||
maScaleFixPos = maFullBound.TopRight();
|
||||
break;
|
||||
case HDL_LWRGT:
|
||||
case SdrHdlKind::LowerRight:
|
||||
maScaleFixPos = maFullBound.TopLeft();
|
||||
break;
|
||||
default:
|
||||
// Moving the object, HDL_MOVE
|
||||
// Moving the object, SdrHdlKind::Move
|
||||
break;
|
||||
}
|
||||
|
||||
// Override when IsResizeAtCenter()
|
||||
if(getSdrDragView().IsResizeAtCenter())
|
||||
{
|
||||
meWhatDragHdl = HDL_USER;
|
||||
meWhatDragHdl = SdrHdlKind::User;
|
||||
maScaleFixPos = maFullBound.Center();
|
||||
}
|
||||
}
|
||||
@ -487,7 +487,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt)
|
||||
|
||||
if(DragStat().CheckMinMoved(rPnt))
|
||||
{
|
||||
if(HDL_MOVE == meWhatDragHdl)
|
||||
if(SdrHdlKind::Move == meWhatDragHdl)
|
||||
{
|
||||
// Translation
|
||||
// Determine the motion vector
|
||||
@ -605,13 +605,13 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt)
|
||||
// constraints?
|
||||
switch(meWhatDragHdl)
|
||||
{
|
||||
case HDL_LEFT:
|
||||
case HDL_RIGHT:
|
||||
case SdrHdlKind::Left:
|
||||
case SdrHdlKind::Right:
|
||||
// to constrain on X -> Y equal
|
||||
aScNext.setY(aScFixPos.getY());
|
||||
break;
|
||||
case HDL_UPPER:
|
||||
case HDL_LOWER:
|
||||
case SdrHdlKind::Upper:
|
||||
case SdrHdlKind::Lower:
|
||||
// constrain to auf Y -> X equal
|
||||
aScNext.setX(aScFixPos.getX());
|
||||
break;
|
||||
|
@ -866,7 +866,7 @@ void E3dCompoundObject::AddToHdlList(SdrHdlList& rHdlList) const
|
||||
// to 2d world coor
|
||||
aPos2D *= rVCScene.getObjectTransformation();
|
||||
|
||||
rHdlList.AddHdl(new SdrHdl(Point(basegfx::fround(aPos2D.getX()), basegfx::fround(aPos2D.getY())), HDL_BWGT));
|
||||
rHdlList.AddHdl(new SdrHdl(Point(basegfx::fround(aPos2D.getX()), basegfx::fround(aPos2D.getY())), SdrHdlKind::BezierWeight));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1224,7 +1224,7 @@ bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut,
|
||||
}
|
||||
if( bThereAre3DObjects )
|
||||
{
|
||||
meDragHdl = ( pHdl == nullptr ? HDL_MOVE : pHdl->GetKind() );
|
||||
meDragHdl = ( pHdl == nullptr ? SdrHdlKind::Move : pHdl->GetKind() );
|
||||
switch ( meDragMode )
|
||||
{
|
||||
case SdrDragMode::Rotate:
|
||||
@ -1232,24 +1232,24 @@ bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut,
|
||||
{
|
||||
switch ( meDragHdl )
|
||||
{
|
||||
case HDL_LEFT:
|
||||
case HDL_RIGHT:
|
||||
case SdrHdlKind::Left:
|
||||
case SdrHdlKind::Right:
|
||||
{
|
||||
eConstraint = E3DDRAG_CONSTR_X;
|
||||
}
|
||||
break;
|
||||
|
||||
case HDL_UPPER:
|
||||
case HDL_LOWER:
|
||||
case SdrHdlKind::Upper:
|
||||
case SdrHdlKind::Lower:
|
||||
{
|
||||
eConstraint = E3DDRAG_CONSTR_Y;
|
||||
}
|
||||
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:
|
||||
{
|
||||
eConstraint = E3DDRAG_CONSTR_Z;
|
||||
}
|
||||
@ -1417,7 +1417,7 @@ void E3dView::Start3DCreation()
|
||||
// Show mirror polygon IMMEDIATELY
|
||||
const SdrHdlList &aHdlList = GetHdlList();
|
||||
mpMirrorOverlay = new Impl3DMirrorConstructOverlay(*this);
|
||||
mpMirrorOverlay->SetMirrorAxis(aHdlList.GetHdl(HDL_REF1)->GetPos(), aHdlList.GetHdl(HDL_REF2)->GetPos());
|
||||
mpMirrorOverlay->SetMirrorAxis(aHdlList.GetHdl(SdrHdlKind::Ref1)->GetPos(), aHdlList.GetHdl(SdrHdlKind::Ref2)->GetPos());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1434,9 +1434,9 @@ void E3dView::MovAction(const Point& rPnt)
|
||||
SdrHdlKind eHdlKind = pHdl->GetKind();
|
||||
|
||||
// reacts only due to a mirror axis
|
||||
if ((eHdlKind == HDL_REF1) ||
|
||||
(eHdlKind == HDL_REF2) ||
|
||||
(eHdlKind == HDL_MIRX))
|
||||
if ((eHdlKind == SdrHdlKind::Ref1) ||
|
||||
(eHdlKind == SdrHdlKind::Ref2) ||
|
||||
(eHdlKind == SdrHdlKind::MirrorAxis))
|
||||
{
|
||||
const SdrHdlList &aHdlList = GetHdlList ();
|
||||
|
||||
@ -1444,8 +1444,8 @@ void E3dView::MovAction(const Point& rPnt)
|
||||
// it anew
|
||||
SdrView::MovAction (rPnt);
|
||||
mpMirrorOverlay->SetMirrorAxis(
|
||||
aHdlList.GetHdl (HDL_REF1)->GetPos(),
|
||||
aHdlList.GetHdl (HDL_REF2)->GetPos());
|
||||
aHdlList.GetHdl (SdrHdlKind::Ref1)->GetPos(),
|
||||
aHdlList.GetHdl (SdrHdlKind::Ref2)->GetPos());
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1490,8 +1490,8 @@ void E3dView::End3DCreation(bool bUseDefaultValuesForMirrorAxes)
|
||||
// Determine from the handle positions and the displacement of
|
||||
// the points
|
||||
const SdrHdlList &aHdlList = GetHdlList();
|
||||
Point aMirrorRef1 = aHdlList.GetHdl(HDL_REF1)->GetPos();
|
||||
Point aMirrorRef2 = aHdlList.GetHdl(HDL_REF2)->GetPos();
|
||||
Point aMirrorRef1 = aHdlList.GetHdl(SdrHdlKind::Ref1)->GetPos();
|
||||
Point aMirrorRef2 = aHdlList.GetHdl(SdrHdlKind::Ref2)->GetPos();
|
||||
|
||||
basegfx::B2DPoint aPnt1(aMirrorRef1.X(), -aMirrorRef1.Y());
|
||||
basegfx::B2DPoint aPnt2(aMirrorRef2.X(), -aMirrorRef2.Y());
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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),
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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: */
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -2149,14 +2149,14 @@ void SdrTableObj::AddToHdlList(SdrHdlList& rHdlList) const
|
||||
// add remaining handles
|
||||
SdrHdl* pH=nullptr;
|
||||
rHdlList.AddHdl( pH = new TableBorderHdl( maRect, !IsTextEditActive() ) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.TopLeft(),HDL_UPLFT) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.TopCenter(),HDL_UPPER) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.TopRight(),HDL_UPRGT) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.LeftCenter(),HDL_LEFT) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.RightCenter(),HDL_RIGHT) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.BottomLeft(),HDL_LWLFT) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.BottomCenter(),HDL_LOWER) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.BottomRight(),HDL_LWRGT) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.TopLeft(),SdrHdlKind::UpperLeft) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.TopCenter(),SdrHdlKind::Upper) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.TopRight(),SdrHdlKind::UpperRight) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.LeftCenter(),SdrHdlKind::Left) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.RightCenter(),SdrHdlKind::Right) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.BottomLeft(),SdrHdlKind::LowerLeft) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.BottomCenter(),SdrHdlKind::Lower) ); pH->SetMoveOutside( true );
|
||||
rHdlList.AddHdl( pH = new SdrHdl(maRect.BottomRight(),SdrHdlKind::LowerRight) ); pH->SetMoveOutside( true );
|
||||
|
||||
const size_t nHdlCount = rHdlList.GetHdlCount();
|
||||
for( size_t nHdl = 0; nHdl < nHdlCount; ++nHdl )
|
||||
@ -2196,24 +2196,24 @@ bool SdrTableObj::hasSpecialDrag() const
|
||||
bool SdrTableObj::beginSpecialDrag(SdrDragStat& rDrag) const
|
||||
{
|
||||
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_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;
|
||||
}
|
||||
|
||||
case HDL_USER:
|
||||
case SdrHdlKind::User:
|
||||
{
|
||||
rDrag.SetEndDragChangesAttributes(false);
|
||||
rDrag.SetNoSnap();
|
||||
@ -2233,18 +2233,18 @@ bool SdrTableObj::applySpecialDrag(SdrDragStat& rDrag)
|
||||
{
|
||||
bool bRet(true);
|
||||
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_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:
|
||||
{
|
||||
const Rectangle aNewRectangle(ImpDragCalcRect(rDrag));
|
||||
|
||||
@ -2256,13 +2256,13 @@ bool SdrTableObj::applySpecialDrag(SdrDragStat& rDrag)
|
||||
break;
|
||||
}
|
||||
|
||||
case HDL_MOVE:
|
||||
case SdrHdlKind::Move:
|
||||
{
|
||||
NbcMove( Size( rDrag.GetDX(), rDrag.GetDY() ) );
|
||||
break;
|
||||
}
|
||||
|
||||
case HDL_USER:
|
||||
case SdrHdlKind::User:
|
||||
{
|
||||
rDrag.SetEndDragChangesAttributes(false);
|
||||
rDrag.SetNoSnap();
|
||||
@ -2300,7 +2300,7 @@ basegfx::B2DPolyPolygon SdrTableObj::getSpecialDragPoly(const SdrDragStat& rDrag
|
||||
basegfx::B2DPolyPolygon aRetval;
|
||||
const SdrHdl* pHdl = rDrag.GetHdl();
|
||||
|
||||
if( pHdl && (HDL_USER == pHdl->GetKind()) )
|
||||
if( pHdl && (SdrHdlKind::User == pHdl->GetKind()) )
|
||||
{
|
||||
const TableEdgeHdl* pEdgeHdl = dynamic_cast< const TableEdgeHdl* >( pHdl );
|
||||
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
|
||||
|
||||
TableEdgeHdl::TableEdgeHdl( const Point& rPnt, bool bHorizontal, sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nEdges )
|
||||
: SdrHdl( rPnt, HDL_USER )
|
||||
: SdrHdl( rPnt, SdrHdlKind::User )
|
||||
, mbHorizontal( bHorizontal )
|
||||
, mnMin( nMin )
|
||||
, mnMax( nMax )
|
||||
@ -245,7 +245,7 @@ drawinglayer::primitive2d::Primitive2DContainer OverlayTableEdge::createOverlayO
|
||||
TableBorderHdl::TableBorderHdl(
|
||||
const Rectangle& rRect,
|
||||
bool bAnimate)
|
||||
: SdrHdl(rRect.TopLeft(), HDL_MOVE),
|
||||
: SdrHdl(rRect.TopLeft(), SdrHdlKind::Move),
|
||||
maRectangle(rRect),
|
||||
mbAnimate(bAnimate)
|
||||
{
|
||||
|
@ -329,7 +329,7 @@ void SwTiledRenderingTest::testSetGraphicSelection()
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(8), pObject->GetHdlCount());
|
||||
// Take the bottom center one.
|
||||
SdrHdl* pHdl = pObject->GetHdl(6);
|
||||
CPPUNIT_ASSERT_EQUAL(HDL_LOWER, pHdl->GetKind());
|
||||
CPPUNIT_ASSERT_EQUAL((int)SdrHdlKind::Lower, (int)pHdl->GetKind());
|
||||
Rectangle aShapeBefore = pObject->GetSnapRect();
|
||||
// Resize.
|
||||
pXTextDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_START, pHdl->GetPos().getX(), pHdl->GetPos().getY());
|
||||
|
@ -940,14 +940,14 @@ void SwVirtFlyDrawObj::addCropHandles(SdrHdlList& rTarget) const
|
||||
|
||||
if(!aRect.IsEmpty())
|
||||
{
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.TopLeft() , HDL_UPLFT, 0, 0));
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.TopCenter() , HDL_UPPER, 0, 0));
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.TopRight() , HDL_UPRGT, 0, 0));
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.LeftCenter() , HDL_LEFT , 0, 0));
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.RightCenter() , HDL_RIGHT, 0, 0));
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.BottomLeft() , HDL_LWLFT, 0, 0));
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.BottomCenter(), HDL_LOWER, 0, 0));
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.BottomRight() , HDL_LWRGT, 0, 0));
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.TopLeft() , SdrHdlKind::UpperLeft, 0, 0));
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.TopCenter() , SdrHdlKind::Upper, 0, 0));
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.TopRight() , SdrHdlKind::UpperRight, 0, 0));
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.LeftCenter() , SdrHdlKind::Left , 0, 0));
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.RightCenter() , SdrHdlKind::Right, 0, 0));
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.BottomLeft() , SdrHdlKind::LowerLeft, 0, 0));
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.BottomCenter(), SdrHdlKind::Lower, 0, 0));
|
||||
rTarget.AddHdl(new SdrCropHdl(aRect.BottomRight() , SdrHdlKind::LowerRight, 0, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,13 +64,13 @@ class SwSdrHdl : public SdrHdl
|
||||
{
|
||||
public:
|
||||
SwSdrHdl(const Point& rPnt, bool bTopRight ) :
|
||||
SdrHdl( rPnt, bTopRight ? HDL_ANCHOR_TR : HDL_ANCHOR ) {}
|
||||
SdrHdl( rPnt, bTopRight ? SdrHdlKind::Anchor_TR : SdrHdlKind::Anchor ) {}
|
||||
virtual bool IsFocusHdl() const override;
|
||||
};
|
||||
|
||||
bool SwSdrHdl::IsFocusHdl() const
|
||||
{
|
||||
if( HDL_ANCHOR == eKind || HDL_ANCHOR_TR == eKind )
|
||||
if( SdrHdlKind::Anchor == eKind || SdrHdlKind::Anchor_TR == eKind )
|
||||
return true;
|
||||
return SdrHdl::IsFocusHdl();
|
||||
}
|
||||
@ -746,9 +746,9 @@ const SwFrame* SwDrawView::CalcAnchor()
|
||||
|
||||
void SwDrawView::ShowDragAnchor()
|
||||
{
|
||||
SdrHdl* pHdl = maHdlList.GetHdl(HDL_ANCHOR);
|
||||
SdrHdl* pHdl = maHdlList.GetHdl(SdrHdlKind::Anchor);
|
||||
if ( ! pHdl )
|
||||
pHdl = maHdlList.GetHdl(HDL_ANCHOR_TR);
|
||||
pHdl = maHdlList.GetHdl(SdrHdlKind::Anchor_TR);
|
||||
|
||||
if(pHdl)
|
||||
{
|
||||
|
@ -178,7 +178,7 @@ bool g_bModePushed = false;
|
||||
bool g_bDDTimerStarted = false;
|
||||
bool g_bFlushCharBuffer = false;
|
||||
bool g_bDDINetAttr = false;
|
||||
SdrHdlKind g_eSdrMoveHdl = HDL_USER;
|
||||
SdrHdlKind g_eSdrMoveHdl = SdrHdlKind::User;
|
||||
|
||||
QuickHelpData* SwEditWin::m_pQuickHlpData = nullptr;
|
||||
|
||||
@ -230,7 +230,7 @@ public:
|
||||
: pHdl( pH )
|
||||
, aHdlPos( pH->GetPos() )
|
||||
, aLastPos( pH->GetPos() )
|
||||
, bTopRightHandle( pH->GetKind() == HDL_ANCHOR_TR )
|
||||
, bTopRightHandle( pH->GetKind() == SdrHdlKind::Anchor_TR )
|
||||
{}
|
||||
const Point& GetLastPos() const { return aLastPos; }
|
||||
void SetLastPos( const Point& rNew ) { aLastPos = rNew; }
|
||||
@ -243,7 +243,7 @@ public:
|
||||
pHdl = pNew;
|
||||
if ( pHdl )
|
||||
{
|
||||
bTopRightHandle = (pHdl->GetKind() == HDL_ANCHOR_TR);
|
||||
bTopRightHandle = (pHdl->GetKind() == SdrHdlKind::Anchor_TR);
|
||||
}
|
||||
}
|
||||
const Point GetPosForHitTest( const OutputDevice& rOut )
|
||||
@ -1301,8 +1301,8 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir )
|
||||
// move handle with index nHandleIndex
|
||||
if(pHdl && (nX || nY))
|
||||
{
|
||||
if( HDL_ANCHOR == pHdl->GetKind() ||
|
||||
HDL_ANCHOR_TR == pHdl->GetKind() )
|
||||
if( SdrHdlKind::Anchor == pHdl->GetKind() ||
|
||||
SdrHdlKind::Anchor_TR == pHdl->GetKind() )
|
||||
{
|
||||
// anchor move cannot be allowed when position is protected
|
||||
if(!(nProtect&FlyProtectFlags::Pos))
|
||||
@ -1537,9 +1537,9 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
|
||||
rSh.GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1))))
|
||||
{
|
||||
SdrHdlList& rHdlList = (SdrHdlList&)rSh.GetDrawView()->GetHdlList();
|
||||
SdrHdl* pAnchor = rHdlList.GetHdl(HDL_ANCHOR);
|
||||
SdrHdl* pAnchor = rHdlList.GetHdl(SdrHdlKind::Anchor);
|
||||
if ( ! pAnchor )
|
||||
pAnchor = rHdlList.GetHdl(HDL_ANCHOR_TR);
|
||||
pAnchor = rHdlList.GetHdl(SdrHdlKind::Anchor_TR);
|
||||
if(pAnchor)
|
||||
rHdlList.SetFocusHdl(pAnchor);
|
||||
return;
|
||||
@ -3111,8 +3111,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
|
||||
!m_pAnchorMarker &&
|
||||
pSdrView &&
|
||||
nullptr != ( pHdl = pSdrView->PickHandle(aDocPos) ) &&
|
||||
( pHdl->GetKind() == HDL_ANCHOR ||
|
||||
pHdl->GetKind() == HDL_ANCHOR_TR ) )
|
||||
( pHdl->GetKind() == SdrHdlKind::Anchor ||
|
||||
pHdl->GetKind() == SdrHdlKind::Anchor_TR ) )
|
||||
{
|
||||
// #i121463# Set selected during drag
|
||||
pHdl->SetSelected();
|
||||
@ -3138,8 +3138,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
|
||||
if ( rSh.IsSelFrameMode())
|
||||
{
|
||||
SdrHdl* pHdl = rSh.GetDrawView()->PickHandle(aDocPos);
|
||||
bool bHitHandle = pHdl && pHdl->GetKind() != HDL_ANCHOR &&
|
||||
pHdl->GetKind() != HDL_ANCHOR_TR;
|
||||
bool bHitHandle = pHdl && pHdl->GetKind() != SdrHdlKind::Anchor &&
|
||||
pHdl->GetKind() != SdrHdlKind::Anchor_TR;
|
||||
|
||||
if ((rSh.IsInsideSelectedObj(aDocPos) || bHitHandle) &&
|
||||
!(rMEvt.GetModifier() == KEY_SHIFT && !bHitHandle))
|
||||
@ -3270,8 +3270,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
|
||||
SdrHdl *pHdl;
|
||||
if( !bIsDocReadOnly && !m_pAnchorMarker && nullptr !=
|
||||
( pHdl = pSdrView->PickHandle(aDocPos) ) &&
|
||||
( pHdl->GetKind() == HDL_ANCHOR ||
|
||||
pHdl->GetKind() == HDL_ANCHOR_TR ) )
|
||||
( pHdl->GetKind() == SdrHdlKind::Anchor ||
|
||||
pHdl->GetKind() == SdrHdlKind::Anchor_TR ) )
|
||||
{
|
||||
m_pAnchorMarker = new SwAnchorMarker( pHdl );
|
||||
UpdatePointer( aDocPos, rMEvt.GetModifier() );
|
||||
@ -3994,8 +3994,8 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
|
||||
SdrHdl* pHdl;
|
||||
if( pSdrView && (nullptr!=( pHdl = pSdrView->PickHandle( aOld ) )||
|
||||
nullptr !=(pHdl = pSdrView->PickHandle( m_pAnchorMarker->GetHdlPos()) ) ) &&
|
||||
( pHdl->GetKind() == HDL_ANCHOR ||
|
||||
pHdl->GetKind() == HDL_ANCHOR_TR ) )
|
||||
( pHdl->GetKind() == SdrHdlKind::Anchor ||
|
||||
pHdl->GetKind() == SdrHdlKind::Anchor_TR ) )
|
||||
{
|
||||
m_pAnchorMarker->ChgHdl( pHdl );
|
||||
if( aNew.X() || aNew.Y() )
|
||||
@ -4059,13 +4059,13 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
|
||||
const Point aSttPt( PixelToLogic( m_aStartPos ) );
|
||||
|
||||
// can we start?
|
||||
if( HDL_USER == g_eSdrMoveHdl )
|
||||
if( SdrHdlKind::User == g_eSdrMoveHdl )
|
||||
{
|
||||
SdrHdl* pHdl = pSdrView->PickHandle( aSttPt );
|
||||
g_eSdrMoveHdl = pHdl ? pHdl->GetKind() : HDL_MOVE;
|
||||
g_eSdrMoveHdl = pHdl ? pHdl->GetKind() : SdrHdlKind::Move;
|
||||
}
|
||||
|
||||
sal_uInt16 nEvent = HDL_MOVE == g_eSdrMoveHdl
|
||||
sal_uInt16 nEvent = SdrHdlKind::Move == g_eSdrMoveHdl
|
||||
? SW_EVENT_FRM_MOVE
|
||||
: SW_EVENT_FRM_RESIZE;
|
||||
|
||||
@ -4116,7 +4116,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
|
||||
bool bResizeKeepRatio = rSh.GetSelectionType() & nsSelectionType::SEL_GRF ||
|
||||
rSh.GetSelectionType() & nsSelectionType::SEL_MEDIA ||
|
||||
rSh.GetSelectionType() & nsSelectionType::SEL_OLE;
|
||||
bool bisResize = g_eSdrMoveHdl != HDL_MOVE;
|
||||
bool bisResize = g_eSdrMoveHdl != SdrHdlKind::Move;
|
||||
|
||||
if (pSdrView)
|
||||
{
|
||||
@ -4341,7 +4341,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
DELETEZ( m_pRowColumnSelectionStart );
|
||||
|
||||
SdrHdlKind eOldSdrMoveHdl = g_eSdrMoveHdl;
|
||||
g_eSdrMoveHdl = HDL_USER; // for MoveEvents - reset again
|
||||
g_eSdrMoveHdl = SdrHdlKind::User; // for MoveEvents - reset again
|
||||
|
||||
// preventively reset
|
||||
m_rView.SetTabColFromDoc( false );
|
||||
@ -4530,7 +4530,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
const SwFrameFormat* pFlyFormat;
|
||||
const SvxMacro* pMacro;
|
||||
|
||||
sal_uInt16 nEvent = HDL_MOVE == eOldSdrMoveHdl
|
||||
sal_uInt16 nEvent = SdrHdlKind::Move == eOldSdrMoveHdl
|
||||
? SW_EVENT_FRM_MOVE
|
||||
: SW_EVENT_FRM_RESIZE;
|
||||
|
||||
|
@ -107,7 +107,7 @@ bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
|
||||
m_aStartPos = m_pWin->PixelToLogic(rMEvt.GetPosPixel());
|
||||
sal_uInt16 nEditMode = m_pWin->GetBezierMode();
|
||||
|
||||
if (eHit == SdrHitKind::Handle && aVEvt.pHdl->GetKind() == HDL_BWGT)
|
||||
if (eHit == SdrHitKind::Handle && aVEvt.pHdl->GetKind() == SdrHdlKind::BezierWeight)
|
||||
{
|
||||
// Drag handle
|
||||
g_bNoInterrupt = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user