1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: svdpoev.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
34 #include <svx/svdpoev.hxx>
36 #include <svx/svdpagv.hxx>
37 #include <svx/svdpage.hxx>
38 #include <svx/svdopath.hxx>
39 #include <svx/svdundo.hxx>
40 #include "svdstr.hrc" // Namen aus der Resource
41 #include "svdglob.hxx" // StringCache
42 #include <svx/svdtrans.hxx>
43 #include <basegfx/polygon/b2dpolygon.hxx>
44 #include <basegfx/polygon/b2dpolygontools.hxx>
45 #include <vcl/salbtype.hxx> // FRound
47 #include <svx/polypolygoneditor.hxx>
51 ////////////////////////////////////////////////////////////////////////////////////////////////////
53 void SdrPolyEditView::ImpResetPolyPossibilityFlags()
55 eMarkedPointsSmooth
=SDRPATHSMOOTH_DONTCARE
;
56 eMarkedSegmentsKind
=SDRPATHSEGMENT_DONTCARE
;
57 bSetMarkedPointsSmoothPossible
=FALSE
;
58 bSetMarkedSegmentsKindPossible
=FALSE
;
61 void SdrPolyEditView::ImpClearVars()
63 ImpResetPolyPossibilityFlags();
66 SdrPolyEditView::SdrPolyEditView(SdrModel
* pModel1
, OutputDevice
* pOut
):
67 SdrEditView(pModel1
,pOut
)
72 SdrPolyEditView::~SdrPolyEditView()
76 void SdrPolyEditView::ImpCheckPolyPossibilities()
78 ImpResetPolyPossibilityFlags();
79 const ULONG
nMarkAnz(GetMarkedObjectCount());
81 if(nMarkAnz
&& !ImpIsFrameHandles())
83 bool b1stSmooth(true);
86 bool bSmoothFuz(false);
88 basegfx::B2VectorContinuity eSmooth
= basegfx::CONTINUITY_NONE
;
90 for(ULONG
nMarkNum(0L); nMarkNum
< nMarkAnz
; nMarkNum
++)
92 SdrMark
* pM
= GetSdrMarkByIndex(nMarkNum
);
93 CheckPolyPossibilitiesHelper( pM
, b1stSmooth
, b1stSegm
, bCurve
, bSmoothFuz
, bSegmFuz
, eSmooth
);
98 void SdrPolyEditView::CheckPolyPossibilitiesHelper( SdrMark
* pM
, bool& b1stSmooth
, bool& b1stSegm
, bool& bCurve
, bool& bSmoothFuz
, bool& bSegmFuz
, basegfx::B2VectorContinuity
& eSmooth
)
100 SdrObject
* pObj
= pM
->GetMarkedSdrObj();
101 SdrUShortCont
* pPts
= pM
->GetMarkedPoints();
102 SdrPathObj
* pPath
= PTR_CAST(SdrPathObj
,pObj
);
106 const sal_uInt32
nMarkedPntAnz(pPts
->GetCount());
110 bool bClosed(pPath
->IsClosed());
111 bSetMarkedPointsSmoothPossible
= true;
115 bSetMarkedSegmentsKindPossible
= true;
118 for(sal_uInt32
nMarkedPntNum(0L); nMarkedPntNum
< nMarkedPntAnz
; nMarkedPntNum
++)
120 sal_uInt32
nNum(pPts
->GetObject(nMarkedPntNum
));
121 sal_uInt32 nPolyNum
, nPntNum
;
123 if(PolyPolygonEditor::GetRelativePolyPoint(pPath
->GetPathPoly(), nNum
, nPolyNum
, nPntNum
))
125 const basegfx::B2DPolygon
aLocalPolygon(pPath
->GetPathPoly().getB2DPolygon(nPolyNum
));
126 bool bCanSegment(bClosed
|| nPntNum
< aLocalPolygon
.count() - 1L);
128 if(!bSetMarkedSegmentsKindPossible
&& bCanSegment
)
130 bSetMarkedSegmentsKindPossible
= true;
138 eSmooth
= basegfx::tools::getContinuityInPoint(aLocalPolygon
, nPntNum
);
142 bSmoothFuz
= (eSmooth
!= basegfx::tools::getContinuityInPoint(aLocalPolygon
, nPntNum
));
150 bool bCrv(aLocalPolygon
.isNextControlPointUsed(nPntNum
));
159 bSegmFuz
= (bCrv
!= bCurve
);
166 if(!b1stSmooth
&& !bSmoothFuz
)
168 if(basegfx::CONTINUITY_NONE
== eSmooth
)
170 eMarkedPointsSmooth
= SDRPATHSMOOTH_ANGULAR
;
173 if(basegfx::CONTINUITY_C1
== eSmooth
)
175 eMarkedPointsSmooth
= SDRPATHSMOOTH_ASYMMETRIC
;
178 if(basegfx::CONTINUITY_C2
== eSmooth
)
180 eMarkedPointsSmooth
= SDRPATHSMOOTH_SYMMETRIC
;
184 if(!b1stSegm
&& !bSegmFuz
)
186 eMarkedSegmentsKind
= (bCurve
) ? SDRPATHSEGMENT_CURVE
: SDRPATHSEGMENT_LINE
;
192 void SdrPolyEditView::SetMarkedPointsSmooth(SdrPathSmoothKind eKind
)
194 basegfx::B2VectorContinuity eFlags
;
196 if(SDRPATHSMOOTH_ANGULAR
== eKind
)
198 eFlags
= basegfx::CONTINUITY_NONE
;
200 else if(SDRPATHSMOOTH_ASYMMETRIC
== eKind
)
202 eFlags
= basegfx::CONTINUITY_C1
;
204 else if(SDRPATHSMOOTH_SYMMETRIC
== eKind
)
206 eFlags
= basegfx::CONTINUITY_C2
;
213 if(HasMarkedPoints())
217 const bool bUndo
= IsUndoEnabled();
219 BegUndo(ImpGetResStr(STR_EditSetPointsSmooth
), GetDescriptionOfMarkedPoints());
220 ULONG
nMarkAnz(GetMarkedObjectCount());
222 for(ULONG
nMarkNum(nMarkAnz
); nMarkNum
> 0L;)
225 SdrMark
* pM
= GetSdrMarkByIndex(nMarkNum
);
226 SdrUShortCont
* pPts
= pM
->GetMarkedPoints();
227 SdrPathObj
* pPath
= dynamic_cast< SdrPathObj
* >( pM
->GetMarkedSdrObj() );
231 PolyPolygonEditor
aEditor( pPath
->GetPathPoly(), pPath
->IsClosed() );
232 if(aEditor
.SetPointsSmooth( eFlags
, pPts
->getContainer() ) )
235 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath
));
236 pPath
->SetPathPoly(aEditor
.GetPolyPolygon());
246 void SdrPolyEditView::SetMarkedSegmentsKind(SdrPathSegmentKind eKind
)
248 if(HasMarkedPoints())
252 const bool bUndo
= IsUndoEnabled();
254 BegUndo(ImpGetResStr(STR_EditSetSegmentsKind
), GetDescriptionOfMarkedPoints());
255 ULONG
nMarkAnz(GetMarkedObjectCount());
257 for(ULONG
nMarkNum(nMarkAnz
); nMarkNum
> 0L;)
260 SdrMark
* pM
= GetSdrMarkByIndex(nMarkNum
);
261 SdrUShortCont
* pPts
= pM
->GetMarkedPoints();
262 SdrPathObj
* pPath
= dynamic_cast< SdrPathObj
* >( pM
->GetMarkedSdrObj() );
266 PolyPolygonEditor
aEditor( pPath
->GetPathPoly(), pPath
->IsClosed() );
267 if(aEditor
.SetSegmentsKind( eKind
, pPts
->getContainer()) )
270 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath
));
271 pPath
->SetPathPoly(aEditor
.GetPolyPolygon());
281 BOOL
SdrPolyEditView::IsSetMarkedPointsSmoothPossible() const
283 ForcePossibilities();
284 return bSetMarkedPointsSmoothPossible
;
287 SdrPathSmoothKind
SdrPolyEditView::GetMarkedPointsSmooth() const
289 ForcePossibilities();
290 return eMarkedPointsSmooth
;
293 BOOL
SdrPolyEditView::IsSetMarkedSegmentsKindPossible() const
295 ForcePossibilities();
296 return bSetMarkedSegmentsKindPossible
;
299 SdrPathSegmentKind
SdrPolyEditView::GetMarkedSegmentsKind() const
301 ForcePossibilities();
302 return eMarkedSegmentsKind
;
305 BOOL
SdrPolyEditView::IsDeleteMarkedPointsPossible() const
307 return HasMarkedPoints();
310 void SdrPolyEditView::DeleteMarkedPoints()
312 if (HasMarkedPoints())
316 ULONG nMarkAnz
=GetMarkedObjectCount();
318 const bool bUndo
= IsUndoEnabled();
322 BegUndo(ImpGetResStr(STR_EditDelete
),GetDescriptionOfMarkedPoints(),SDRREPFUNC_OBJ_DELETE
);
325 for (ULONG nMarkNum
=nMarkAnz
; nMarkNum
>0;)
328 SdrMark
* pM
=GetSdrMarkByIndex(nMarkNum
);
329 SdrUShortCont
* pPts
=pM
->GetMarkedPoints();
330 SdrPathObj
* pPath
= dynamic_cast< SdrPathObj
* >( pM
->GetMarkedSdrObj() );
334 PolyPolygonEditor
aEditor( pPath
->GetPathPoly(), pPath
->IsClosed() );
335 if( aEditor
.DeletePoints( pPts
->getContainer() ) )
337 if( aEditor
.GetPolyPolygon().count() )
340 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath
));
341 pPath
->SetPathPoly( aEditor
.GetPolyPolygon() );
346 AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pPath
) );
347 pM
->GetPageView()->GetObjList()->RemoveObject(pPath
->GetOrdNum());
350 SdrObject
* pObj
= pPath
;
351 SdrObject::Free(pObj
);
361 MarkListHasChanged();
365 void SdrPolyEditView::RipUpAtMarkedPoints()
367 if(HasMarkedPoints())
370 sal_uInt32
nMarkAnz(GetMarkedObjectCount());
372 const bool bUndo
= IsUndoEnabled();
374 BegUndo(ImpGetResStr(STR_EditRipUp
), GetDescriptionOfMarkedPoints());
376 for(sal_uInt32
nMarkNum(nMarkAnz
); nMarkNum
> 0L;)
379 SdrMark
* pM
= GetSdrMarkByIndex(nMarkNum
);
380 SdrUShortCont
* pPts
= pM
->GetMarkedPoints();
381 SdrPathObj
* pObj
= PTR_CAST(SdrPathObj
, pM
->GetMarkedSdrObj());
387 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj
));
388 sal_Bool
bKorregFlag(sal_False
);
389 sal_Bool
bInsAny(sal_False
);
390 sal_uInt32
nMarkPtsAnz(pPts
->GetCount());
391 sal_uInt32
nMax(pObj
->GetHdlCount());
393 for(sal_uInt32
i(nMarkPtsAnz
); i
> 0L;)
396 sal_uInt32
nNewPt0Idx(0L);
397 SdrObject
* pNeuObj
= pObj
->RipPoint(pPts
->GetObject(i
), nNewPt0Idx
);
402 SdrInsertReason
aReason(SDRREASON_VIEWCALL
, pObj
);
403 pM
->GetPageView()->GetObjList()->InsertObject(pNeuObj
, pObj
->GetOrdNum() + 1, &aReason
);
405 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pNeuObj
));
406 MarkObj(pNeuObj
, pM
->GetPageView(), FALSE
, TRUE
);
411 // Korrektur notwendig?
412 DBG_ASSERT(bKorregFlag
==FALSE
,"Mehrfache Indexkorrektur bei SdrPolyEditView::RipUp()");
415 bKorregFlag
= sal_True
;
417 for(sal_uInt32
nBla(0L); nBla
< nMarkPtsAnz
; nBla
++)
419 sal_uInt32
nPntNum(pPts
->GetObject(nBla
));
420 nPntNum
+= nNewPt0Idx
;
427 pPts
->Replace((sal_uInt16
)nPntNum
, nBla
);
430 i
= nMarkPtsAnz
; // ... und nochmal von vorn
440 MarkListHasChanged();
444 bool SdrPolyEditView::IsRipUpAtMarkedPointsPossible() const
447 const sal_uInt32
nMarkCount(GetMarkedObjectCount());
449 for(sal_uInt32
a(0); a
< nMarkCount
; a
++)
451 const SdrMark
* pMark
= GetSdrMarkByIndex(a
);
452 const SdrPathObj
* pMarkedPathObject
= dynamic_cast< const SdrPathObj
* >(pMark
->GetMarkedSdrObj());
454 if(pMarkedPathObject
)
456 const SdrUShortCont
* pSelectedPoints
= pMark
->GetMarkedPoints();
458 if(pSelectedPoints
&& pSelectedPoints
->GetCount())
460 const basegfx::B2DPolyPolygon
& rPathPolyPolygon
= pMarkedPathObject
->GetPathPoly();
462 if(1 == rPathPolyPolygon
.count())
464 // #i76617# Do not yet use basegfx::B2DPolygon since curve definitions
465 // are different and methods need to be changed thoroughly with interaction rework
466 const Polygon
aPathPolygon(rPathPolyPolygon
.getB2DPolygon(0));
467 const sal_uInt16
nPointCount(aPathPolygon
.GetSize());
471 bRetval
= pMarkedPathObject
->IsClosedObj(); // #i76617# aPathPolygon.isClosed();
473 for(sal_uInt32
b(0); !bRetval
&& b
< pSelectedPoints
->GetCount(); b
++)
475 const sal_uInt16
nMarkedPointNum(pSelectedPoints
->GetObject(b
));
477 bRetval
= (nMarkedPointNum
> 0 && nMarkedPointNum
< nPointCount
- 1);
488 bool SdrPolyEditView::IsOpenCloseMarkedObjectsPossible() const
491 const sal_uInt32
nMarkCount(GetMarkedObjectCount());
493 for(sal_uInt32
a(0); a
< nMarkCount
; a
++)
495 const SdrMark
* pMark
= GetSdrMarkByIndex(a
);
496 const SdrPathObj
* pMarkedPathObject
= dynamic_cast< const SdrPathObj
* >(pMark
->GetMarkedSdrObj());
498 if(pMarkedPathObject
)
500 // #i76617# Do not yet use basegfx::B2DPolygon since curve definitions
501 // are different and methods need to be changed thoroughly with interaction rework
502 const PolyPolygon
aPathPolyPolygon(pMarkedPathObject
->GetPathPoly());
503 const sal_uInt16
nPolygonCount(aPathPolyPolygon
.Count());
505 for(sal_uInt16
b(0); !bRetval
&& b
< nPolygonCount
; b
++)
507 const Polygon
& rPathPolygon
= aPathPolyPolygon
[b
];
508 const sal_uInt16
nPointCount(rPathPolygon
.GetSize());
510 bRetval
= (nPointCount
>= 3);
518 SdrObjClosedKind
SdrPolyEditView::GetMarkedObjectsClosedState() const
522 const sal_uInt32
nMarkCount(GetMarkedObjectCount());
524 for(sal_uInt32
a(0); !(bOpen
&& bClosed
) && a
< nMarkCount
; a
++)
526 const SdrMark
* pMark
= GetSdrMarkByIndex(a
);
527 const SdrPathObj
* pMarkedPathObject
= dynamic_cast< const SdrPathObj
* >(pMark
->GetMarkedSdrObj());
529 if(pMarkedPathObject
)
531 if(pMarkedPathObject
->IsClosedObj())
544 return SDROBJCLOSED_DONTCARE
;
548 return SDROBJCLOSED_OPEN
;
552 return SDROBJCLOSED_CLOSED
;
556 void SdrPolyEditView::ShutMarkedObjects()
558 CloseMarkedObjects();
561 void SdrPolyEditView::CloseMarkedObjects(BOOL bToggle
, BOOL bOpen
) // , long nOpenDistance)
563 if (AreObjectsMarked())
565 const bool bUndo
= IsUndoEnabled();
567 BegUndo(ImpGetResStr(STR_EditShut
),GetDescriptionOfMarkedPoints());
570 ULONG nMarkAnz
=GetMarkedObjectCount();
571 for (ULONG nm
=0; nm
<nMarkAnz
; nm
++)
573 SdrMark
* pM
=GetSdrMarkByIndex(nm
);
574 SdrObject
* pO
=pM
->GetMarkedSdrObj();
575 BOOL bClosed
=pO
->IsClosedObj();
576 if (pO
->IsPolyObj() && (bClosed
==bOpen
) || bToggle
)
579 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO
));
581 SdrPathObj
* pPathObj
= dynamic_cast< SdrPathObj
* >( pO
);
583 pPathObj
->ToggleClosed();
594 MarkListHasChanged();
599 ////////////////////////////////////////////////////////////////////////////////////////////////////
601 void SdrPolyEditView::ImpCopyMarkedPoints()
605 ////////////////////////////////////////////////////////////////////////////////////////////////////
607 void SdrPolyEditView::ImpTransformMarkedPoints(PPolyTrFunc pTrFunc
, const void* p1
, const void* p2
, const void* p3
, const void* p4
, const void* p5
)
609 const bool bUndo
= IsUndoEnabled();
611 ULONG nMarkAnz
=GetMarkedObjectCount();
612 for (ULONG nm
=0; nm
<nMarkAnz
; nm
++)
614 SdrMark
* pM
=GetSdrMarkByIndex(nm
);
615 SdrObject
* pObj
=pM
->GetMarkedSdrObj();
616 const SdrUShortCont
* pPts
=pM
->GetMarkedPoints();
617 ULONG nPtAnz
=pPts
==NULL
? 0 : pPts
->GetCount();
618 SdrPathObj
* pPath
=PTR_CAST(SdrPathObj
,pObj
);
619 if (nPtAnz
!=0 && pPath
!=NULL
)
622 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj
));
624 basegfx::B2DPolyPolygon
aXPP(pPath
->GetPathPoly());
626 for(sal_uInt32
nPtNum(0L); nPtNum
< nPtAnz
; nPtNum
++)
628 sal_uInt32
nPt(pPts
->GetObject(nPtNum
));
629 sal_uInt32 nPolyNum
, nPointNum
;
631 if(PolyPolygonEditor::GetRelativePolyPoint(aXPP
, nPt
, nPolyNum
, nPointNum
))
633 //#i83671# used nLocalPointNum (which was the polygon point count)
634 // instead of the point index (nPointNum). This of course leaded
635 // to a wrong point access to the B2DPolygon.
636 basegfx::B2DPolygon
aNewXP(aXPP
.getB2DPolygon(nPolyNum
));
637 Point aPos
, aC1
, aC2
;
641 const basegfx::B2DPoint
aB2DPos(aNewXP
.getB2DPoint(nPointNum
));
642 aPos
= Point(FRound(aB2DPos
.getX()), FRound(aB2DPos
.getY()));
644 if(aNewXP
.isPrevControlPointUsed(nPointNum
))
646 const basegfx::B2DPoint
aB2DC1(aNewXP
.getPrevControlPoint(nPointNum
));
647 aC1
= Point(FRound(aB2DC1
.getX()), FRound(aB2DC1
.getY()));
651 if(aNewXP
.isNextControlPointUsed(nPointNum
))
653 const basegfx::B2DPoint
aB2DC2(aNewXP
.getNextControlPoint(nPointNum
));
654 aC2
= Point(FRound(aB2DC2
.getX()), FRound(aB2DC2
.getY()));
658 (*pTrFunc
)(aPos
,&aC1
,&aC2
,p1
,p2
,p3
,p4
,p5
);
659 aNewXP
.setB2DPoint(nPointNum
, basegfx::B2DPoint(aPos
.X(), aPos
.Y()));
663 aNewXP
.setPrevControlPoint(nPointNum
, basegfx::B2DPoint(aC1
.X(), aC1
.Y()));
668 aNewXP
.setNextControlPoint(nPointNum
, basegfx::B2DPoint(aC2
.X(), aC2
.Y()));
671 aXPP
.setB2DPolygon(nPolyNum
, aNewXP
);
675 pPath
->SetPathPoly(aXPP
);
680 ////////////////////////////////////////////////////////////////////////////////////////////////////
682 static void ImpMove(Point
& rPt
, Point
* pC1
, Point
* pC2
, const void* p1
, const void* /*p2*/, const void* /*p3*/, const void* /*p4*/, const void* /*p5*/)
684 MovePoint(rPt
,*(const Size
*)p1
);
685 if (pC1
!=NULL
) MovePoint(*pC1
,*(const Size
*)p1
);
686 if (pC2
!=NULL
) MovePoint(*pC2
,*(const Size
*)p1
);
689 void SdrPolyEditView::MoveMarkedPoints(const Size
& rSiz
, bool bCopy
)
691 bCopy
=FALSE
; // noch nicht implementiert
692 ForceUndirtyMrkPnt();
693 XubString
aStr(ImpGetResStr(STR_EditMove
));
694 if (bCopy
) aStr
+=ImpGetResStr(STR_EditWithCopy
);
695 BegUndo(aStr
,GetDescriptionOfMarkedPoints(),SDRREPFUNC_OBJ_MOVE
);
696 if (bCopy
) ImpCopyMarkedPoints();
697 ImpTransformMarkedPoints(ImpMove
,&rSiz
);
702 ////////////////////////////////////////////////////////////////////////////////////////////////////
704 static void ImpResize(Point
& rPt
, Point
* pC1
, Point
* pC2
, const void* p1
, const void* p2
, const void* p3
, const void* /*p4*/, const void* /*p5*/)
706 ResizePoint(rPt
,*(const Point
*)p1
,*(const Fraction
*)p2
,*(const Fraction
*)p3
);
707 if (pC1
!=NULL
) ResizePoint(*pC1
,*(const Point
*)p1
,*(const Fraction
*)p2
,*(const Fraction
*)p3
);
708 if (pC2
!=NULL
) ResizePoint(*pC2
,*(const Point
*)p1
,*(const Fraction
*)p2
,*(const Fraction
*)p3
);
711 void SdrPolyEditView::ResizeMarkedPoints(const Point
& rRef
, const Fraction
& xFact
, const Fraction
& yFact
, bool bCopy
)
713 bCopy
=FALSE
; // noch nicht implementiert
714 ForceUndirtyMrkPnt();
715 XubString
aStr(ImpGetResStr(STR_EditResize
));
716 if (bCopy
) aStr
+=ImpGetResStr(STR_EditWithCopy
);
717 BegUndo(aStr
,GetDescriptionOfMarkedPoints(),SDRREPFUNC_OBJ_RESIZE
);
718 if (bCopy
) ImpCopyMarkedPoints();
719 ImpTransformMarkedPoints(ImpResize
,&rRef
,&xFact
,&yFact
);
724 ////////////////////////////////////////////////////////////////////////////////////////////////////
726 static void ImpRotate(Point
& rPt
, Point
* pC1
, Point
* pC2
, const void* p1
, const void* /*p2*/, const void* p3
, const void* p4
, const void* /*p5*/)
728 RotatePoint(rPt
,*(const Point
*)p1
,*(const double*)p3
,*(const double*)p4
);
729 if (pC1
!=NULL
) RotatePoint(*pC1
,*(const Point
*)p1
,*(const double*)p3
,*(const double*)p4
);
730 if (pC2
!=NULL
) RotatePoint(*pC2
,*(const Point
*)p1
,*(const double*)p3
,*(const double*)p4
);
733 void SdrPolyEditView::RotateMarkedPoints(const Point
& rRef
, long nWink
, bool bCopy
)
735 bCopy
=FALSE
; // noch nicht implementiert
736 ForceUndirtyMrkPnt();
737 XubString
aStr(ImpGetResStr(STR_EditResize
));
738 if (bCopy
) aStr
+=ImpGetResStr(STR_EditWithCopy
);
739 BegUndo(aStr
,GetDescriptionOfMarkedPoints(),SDRREPFUNC_OBJ_ROTATE
);
740 if (bCopy
) ImpCopyMarkedPoints();
741 double nSin
=sin(nWink
*nPi180
);
742 double nCos
=cos(nWink
*nPi180
);
743 ImpTransformMarkedPoints(ImpRotate
,&rRef
,&nWink
,&nSin
,&nCos
);