summaryrefslogtreecommitdiff
path: root/sd/source/ui/animations/motionpathtag.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/animations/motionpathtag.cxx')
-rw-r--r--sd/source/ui/animations/motionpathtag.cxx118
1 files changed, 59 insertions, 59 deletions
diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx
index dfa17a7df551..47200c01054d 100644
--- a/sd/source/ui/animations/motionpathtag.cxx
+++ b/sd/source/ui/animations/motionpathtag.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -87,23 +87,23 @@ static const int DRGPIX = 2; // Drag MinMove i
class PathDragMove : public SdrDragMove
{
private:
- basegfx::B2DPolyPolygon maPathPolyPolygon;
+ basegfx::B2DPolyPolygon maPathPolyPolygon;
protected:
virtual void createSdrDragEntries();
public:
- PathDragMove(SdrDragView& rNewView,
+ PathDragMove(SdrDragView& rNewView,
const rtl::Reference <MotionPathTag >& xTag,
const basegfx::B2DPolyPolygon& rPathPolyPolygon)
- : SdrDragMove(rNewView),
+ : SdrDragMove(rNewView),
maPathPolyPolygon(rPathPolyPolygon),
mxTag( xTag )
{}
- PathDragMove(SdrDragView& rNewView,
+ PathDragMove(SdrDragView& rNewView,
const rtl::Reference <MotionPathTag >& xTag)
- : SdrDragMove(rNewView),
+ : SdrDragMove(rNewView),
maPathPolyPolygon(),
mxTag( xTag )
{}
@@ -151,23 +151,23 @@ bool PathDragMove::EndSdrDrag(bool /*bCopy*/)
class PathDragResize : public SdrDragResize
{
private:
- basegfx::B2DPolyPolygon maPathPolyPolygon;
+ basegfx::B2DPolyPolygon maPathPolyPolygon;
protected:
virtual void createSdrDragEntries();
public:
- PathDragResize(SdrDragView& rNewView,
+ PathDragResize(SdrDragView& rNewView,
const rtl::Reference <MotionPathTag >& xTag,
const basegfx::B2DPolyPolygon& rPathPolyPolygon)
- : SdrDragResize(rNewView),
+ : SdrDragResize(rNewView),
maPathPolyPolygon(rPathPolyPolygon),
mxTag( xTag )
{}
- PathDragResize(SdrDragView& rNewView,
+ PathDragResize(SdrDragView& rNewView,
const rtl::Reference <MotionPathTag >& xTag)
- : SdrDragResize(rNewView),
+ : SdrDragResize(rNewView),
maPathPolyPolygon(),
mxTag( xTag )
{}
@@ -212,7 +212,7 @@ bool PathDragResize::EndSdrDrag(bool /*bCopy*/)
class PathDragObjOwn : public SdrDragObjOwn
{
private:
- basegfx::B2DPolyPolygon maPathPolyPolygon;
+ basegfx::B2DPolyPolygon maPathPolyPolygon;
protected:
virtual void createSdrDragEntries();
@@ -220,12 +220,12 @@ protected:
public:
PathDragObjOwn(SdrDragView& rNewView,
const basegfx::B2DPolyPolygon& rPathPolyPolygon)
- : SdrDragObjOwn(rNewView),
+ : SdrDragObjOwn(rNewView),
maPathPolyPolygon(rPathPolyPolygon)
{}
PathDragObjOwn(SdrDragView& rNewView)
- : SdrDragObjOwn(rNewView),
+ : SdrDragObjOwn(rNewView),
maPathPolyPolygon()
{}
@@ -246,7 +246,7 @@ void PathDragObjOwn::createSdrDragEntries()
bool PathDragObjOwn::EndSdrDrag(bool /*bCopy*/)
{
Hide();
-
+
SdrObject* pObj = GetDragObj();
if(pObj)
@@ -297,7 +297,7 @@ void SdPathHdl::CreateB2dIAObject()
{
// first throw away old one
GetRidOfIAObject();
-
+
if(pHdlList)
{
SdrMarkView* pView = pHdlList->GetView();
@@ -511,7 +511,7 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl )
return true;
}
else if( rMEvt.IsLeft() )
- {
+ {
OutputDevice* pOut = mrView.GetViewShell()->GetActiveWindow();
Point aMDPos( pOut->PixelToLogic( rMEvt.GetPosPixel() ) );
@@ -524,7 +524,7 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl )
Point aPt(aMDPos); // - pMarkedPV->GetOffset());
- if(bNewObj)
+ if(bNewObj)
aPt = mrView.GetSnapPos(aPt,mrView.GetSdrPageView());
sal_Bool bClosed0(mpPathObj->IsClosedObj());
@@ -532,21 +532,21 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl )
sal_uInt32 nInsPointNum = mpPathObj->NbcInsPointOld(aPt, bNewObj, sal_True);
if(bClosed0 != mpPathObj->IsClosedObj())
- {
+ {
// Obj was closed implicit
// object changed
mpPathObj->SetChanged();
mpPathObj->BroadcastObjectChange();
}
- if(0xffffffff != nInsPointNum)
+ if(0xffffffff != nInsPointNum)
{
mrView.UnmarkAllPoints();
mrView.updateHandles();
bool bRet = mrView.BegDragObj(aMDPos, pOut, mrView.GetHdl(nInsPointNum+1), 0, new PathDragObjOwn( mrView ) );
- if (bRet)
+ if (bRet)
{
const_cast< SdrDragStat* >( &mrView.GetDragStat() )->SetMinMoved();
mrView.MovDragObj(aMDPos);
@@ -576,7 +576,7 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl )
pHdl = dynamic_cast< SmartHdl* >( mrView.PickHandle(aMDPos) );
}
}
-
+
if (pHdl)
mrView.MarkPoint(*pHdl);
}
@@ -586,7 +586,7 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl )
{
mrView.BrkAction();
const USHORT nDrgLog = (USHORT)pOut->PixelToLogic(Size(DRGPIX,0)).Width();
-
+
rtl::Reference< MotionPathTag > xTag( this );
SdrDragMethod* pDragMethod;
@@ -607,12 +607,12 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl )
{
pDragMethod = new PathDragResize( mrView, xTag, aDragPoly );
}
-
+
mrView.BegDragObj(aMDPos, NULL, pHdl, nDrgLog, pDragMethod );
}
return true;
}
- }
+ }
}
return false;
@@ -702,7 +702,7 @@ bool MotionPathTag::OnMarkHandle( const KeyEvent& rKEvt )
// rescue ID of point with focus
sal_uInt32 nPol(pHdl->GetPolyNum());
sal_uInt32 nPnt(pHdl->GetPointNum());
-
+
if(mrView.IsPointMarked(*pHdl))
{
if(rKEvt.GetKeyCode().IsShift())
@@ -727,7 +727,7 @@ bool MotionPathTag::OnMarkHandle( const KeyEvent& rKEvt )
for(sal_uInt32 a(0); !pNewOne && a < rHdlList.GetHdlCount(); a++)
{
SdrHdl* pAct = rHdlList.GetHdl(a);
-
+
if(pAct && pAct->GetKind() == HDL_POLY && pAct->GetPolyNum() == nPol && pAct->GetPointNum() == nPnt)
pNewOne = pAct;
}
@@ -747,10 +747,10 @@ bool MotionPathTag::OnMove( const KeyEvent& rKEvt )
switch( rKEvt.GetKeyCode().GetCode() )
{
- case KEY_UP: nY = -1; break;
- case KEY_DOWN: nY = 1; break;
- case KEY_LEFT: nX = -1; break;
- case KEY_RIGHT: nX = 1; break;
+ case KEY_UP: nY = -1; break;
+ case KEY_DOWN: nY = 1; break;
+ case KEY_LEFT: nX = -1; break;
+ case KEY_RIGHT: nX = 1; break;
default: break;
}
@@ -1008,13 +1008,13 @@ void MotionPathTag::addCustomHandles( SdrHdlList& rHandlerList )
const bool bSelected= pMrkPnts && pMrkPnts->Exist(sal::static_int_cast< USHORT >(nHandle));
pSmartHdl->SetSelected(bSelected);
- if( mrView.IsPlusHandlesAlwaysVisible() || bSelected )
+ if( mrView.IsPlusHandlesAlwaysVisible() || bSelected )
{
sal_uInt32 nPlusAnz=mpPathObj->GetPlusHdlCount(*pSmartHdl);
- for (sal_uInt32 nPlusNum=0; nPlusNum<nPlusAnz; nPlusNum++)
+ for (sal_uInt32 nPlusNum=0; nPlusNum<nPlusAnz; nPlusNum++)
{
SdrHdl* pPlusHdl = mpPathObj->GetPlusHdl(*pSmartHdl,nPlusNum);
- if (pPlusHdl!=NULL)
+ if (pPlusHdl!=NULL)
{
pPlusHdl->SetObj(mpPathObj);
pPlusHdl->SetPageView(mrView.GetSdrPageView());
@@ -1029,22 +1029,22 @@ void MotionPathTag::addCustomHandles( SdrHdlList& rHandlerList )
{
Rectangle aRect(mpPathObj->GetCurrentBoundRect());
- if(!aRect.IsEmpty())
+ if(!aRect.IsEmpty())
{
ULONG nCount = rHandlerList.GetHdlCount();
BOOL bWdt0=aRect.Left()==aRect.Right();
BOOL bHgt0=aRect.Top()==aRect.Bottom();
- if (bWdt0 && bHgt0)
+ if (bWdt0 && bHgt0)
{
rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopLeft(),HDL_UPLFT));
- }
+ }
else if (bWdt0 || bHgt0)
{
rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopLeft() ,HDL_UPLFT));
rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.BottomRight(),HDL_LWRGT));
- }
- else
+ }
+ 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));
@@ -1104,10 +1104,10 @@ void MotionPathTag::deselect()
{
SdrUShortCont* pPts = mpMark->GetMarkedPoints();
- if( pPts )
+ if( pPts )
pPts->Clear();
}
-
+
selectionChanged();
}
@@ -1130,24 +1130,24 @@ void MotionPathTag::DeleteMarkedPoints()
mrView.BrkAction();
// Description
-// BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedPoints(),SDRREPFUNC_OBJ_DELETE);
+// BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedPoints(),SDRREPFUNC_OBJ_DELETE);
SdrUShortCont* pPts = mpMark->GetMarkedPoints();
- if( pPts )
+ if( pPts )
{
PolyPolygonEditor aEditor( mpPathObj->GetPathPoly(), mpPathObj->IsClosed() );
if( aEditor.DeletePoints( pPts->getContainer() ) )
{
if( aEditor.GetPolyPolygon().count() )
{
-// AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath ));
+// AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath ));
mpPathObj->SetPathPoly( aEditor.GetPolyPolygon() );
}
else
{
-// AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pPath ) );
-// pM->GetPageView()->GetObjList()->RemoveObject(pObj->GetOrdNum());
+// AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pPath ) );
+// pM->GetPageView()->GetObjList()->RemoveObject(pObj->GetOrdNum());
}
mrView.UnmarkAllPoints();
@@ -1156,7 +1156,7 @@ void MotionPathTag::DeleteMarkedPoints()
}
}
-// EndUndo();
+// EndUndo();
}
}
@@ -1194,15 +1194,15 @@ SdrPathSegmentKind MotionPathTag::GetMarkedSegmentsKind() const
void MotionPathTag::SetMarkedSegmentsKind(SdrPathSegmentKind eKind)
{
- if(mpPathObj && isSelected() && (GetMarkedPointCount() != 0))
+ if(mpPathObj && isSelected() && (GetMarkedPointCount() != 0))
{
SdrUShortCont* pPts = mpMark->GetMarkedPoints();
- if(pPts)
+ if(pPts)
{
PolyPolygonEditor aEditor( mpPathObj->GetPathPoly(), mpPathObj->IsClosed() );
if(aEditor.SetSegmentsKind( eKind, pPts->getContainer()) )
{
-// AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath));
+// AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath));
mpPathObj->SetPathPoly(aEditor.GetPolyPolygon());
mrView.MarkListHasChanged();
mrView.updateHandles();
@@ -1230,33 +1230,33 @@ SdrPathSmoothKind MotionPathTag::GetMarkedPointsSmooth() const
void MotionPathTag::SetMarkedPointsSmooth(SdrPathSmoothKind eKind)
{
basegfx::B2VectorContinuity eFlags;
-
- if(SDRPATHSMOOTH_ANGULAR == eKind)
+
+ if(SDRPATHSMOOTH_ANGULAR == eKind)
{
eFlags = basegfx::CONTINUITY_NONE;
}
- else if(SDRPATHSMOOTH_ASYMMETRIC == eKind)
+ else if(SDRPATHSMOOTH_ASYMMETRIC == eKind)
{
eFlags = basegfx::CONTINUITY_C1;
}
- else if(SDRPATHSMOOTH_SYMMETRIC == eKind)
+ else if(SDRPATHSMOOTH_SYMMETRIC == eKind)
{
eFlags = basegfx::CONTINUITY_C2;
}
- else
+ else
{
return;
}
- if(mpPathObj && mpMark && isSelected() && (GetMarkedPointCount() != 0))
+ if(mpPathObj && mpMark && isSelected() && (GetMarkedPointCount() != 0))
{
SdrUShortCont* pPts = mpMark->GetMarkedPoints();
- if(pPts)
+ if(pPts)
{
PolyPolygonEditor aEditor( mpPathObj->GetPathPoly(), mpPathObj->IsClosed() );
if(aEditor.SetPointsSmooth( eFlags, pPts->getContainer() ) )
{
-// AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath));
+// AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath));
mpPathObj->SetPathPoly(aEditor.GetPolyPolygon());
mrView.MarkListHasChanged();
mrView.updateHandles();
@@ -1264,7 +1264,7 @@ void MotionPathTag::SetMarkedPointsSmooth(SdrPathSmoothKind eKind)
}
}
}
-
+
void MotionPathTag::CloseMarkedObjects(BOOL /*bToggle*/, BOOL /*bOpen*/ )
{
// not supported for motion path