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: svdsnpv.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/svdsnpv.hxx>
37 #include <svx/svdetc.hxx>
38 #include <svx/svdobj.hxx>
39 #include <svx/svdpagv.hxx>
40 #include <svx/svdpage.hxx>
41 #include "svditer.hxx"
42 #include <svx/sdr/overlay/overlayobjectlist.hxx>
43 #include <svx/sdr/overlay/overlaycrosshair.hxx>
44 #include <svx/sdr/overlay/overlayhelpline.hxx>
45 #include <svx/sdr/overlay/overlaymanager.hxx>
46 #include <basegfx/matrix/b2dhommatrix.hxx>
47 #include <sdrpaintwindow.hxx>
49 ////////////////////////////////////////////////////////////////////////////////////////////////////
50 // #114409#-1 Migrate PageOrigin
51 class ImplPageOriginOverlay
54 ::sdr::overlay::OverlayObjectList maObjects
;
56 // The current position in logical coodinates
57 basegfx::B2DPoint maPosition
;
60 ImplPageOriginOverlay(const SdrPaintView
& rView
, const basegfx::B2DPoint
& rStartPos
);
61 ~ImplPageOriginOverlay();
63 void SetPosition(const basegfx::B2DPoint
& rNewPosition
);
66 ImplPageOriginOverlay::ImplPageOriginOverlay(const SdrPaintView
& rView
, const basegfx::B2DPoint
& rStartPos
)
67 : maPosition(rStartPos
)
69 for(sal_uInt32
a(0L); a
< rView
.PaintWindowCount(); a
++)
71 SdrPaintWindow
* pCandidate
= rView
.GetPaintWindow(a
);
72 ::sdr::overlay::OverlayManager
* pTargetOverlay
= pCandidate
->GetOverlayManager();
76 ::sdr::overlay::OverlayCrosshairStriped
* aNew
= new ::sdr::overlay::OverlayCrosshairStriped(
78 pTargetOverlay
->add(*aNew
);
79 maObjects
.append(*aNew
);
84 ImplPageOriginOverlay::~ImplPageOriginOverlay()
86 // The OverlayObjects are cleared using the destructor of OverlayObjectList.
87 // That destructor calls clear() at the list which removes all objects from the
88 // OverlayManager and deletes them.
91 void ImplPageOriginOverlay::SetPosition(const basegfx::B2DPoint
& rNewPosition
)
93 if(rNewPosition
!= maPosition
)
95 // apply to OverlayObjects
96 for(sal_uInt32
a(0); a
< maObjects
.count(); a
++)
98 sdr::overlay::OverlayCrosshairStriped
* pCandidate
=
99 static_cast< sdr::overlay::OverlayCrosshairStriped
* >(&maObjects
.getOverlayObject(a
));
103 pCandidate
->setBasePosition(rNewPosition
);
107 // remember new position
108 maPosition
= rNewPosition
;
112 ////////////////////////////////////////////////////////////////////////////////////////////////////
113 // #114409#-2 Migrate HelpLine
114 class ImplHelpLineOverlay
116 // The OverlayObjects
117 ::sdr::overlay::OverlayObjectList maObjects
;
119 // The current position in logical coodinates
120 basegfx::B2DPoint maPosition
;
122 // HelpLine specific stuff
123 SdrPageView
* mpPageView
;
124 sal_uInt16 mnHelpLineNumber
;
125 SdrHelpLineKind meHelpLineKind
;
128 ImplHelpLineOverlay(const SdrPaintView
& rView
, const basegfx::B2DPoint
& rStartPos
,
129 SdrPageView
* pPageView
, sal_uInt16 nHelpLineNumber
, SdrHelpLineKind eKind
);
130 ~ImplHelpLineOverlay();
132 void SetPosition(const basegfx::B2DPoint
& rNewPosition
);
134 // access to HelpLine specific stuff
135 SdrPageView
* GetPageView() const { return mpPageView
; }
136 sal_uInt16
GetHelpLineNumber() const { return mnHelpLineNumber
; }
137 SdrHelpLineKind
GetHelpLineKind() const { return meHelpLineKind
; }
140 ImplHelpLineOverlay::ImplHelpLineOverlay(
141 const SdrPaintView
& rView
, const basegfx::B2DPoint
& rStartPos
,
142 SdrPageView
* pPageView
, sal_uInt16 nHelpLineNumber
, SdrHelpLineKind eKind
)
143 : maPosition(rStartPos
),
144 mpPageView(pPageView
),
145 mnHelpLineNumber(nHelpLineNumber
),
146 meHelpLineKind(eKind
)
148 for(sal_uInt32
a(0L); a
< rView
.PaintWindowCount(); a
++)
150 SdrPaintWindow
* pCandidate
= rView
.GetPaintWindow(a
);
151 ::sdr::overlay::OverlayManager
* pTargetOverlay
= pCandidate
->GetOverlayManager();
155 ::sdr::overlay::OverlayHelplineStriped
* aNew
= new ::sdr::overlay::OverlayHelplineStriped(
156 maPosition
, meHelpLineKind
);
157 pTargetOverlay
->add(*aNew
);
158 maObjects
.append(*aNew
);
163 ImplHelpLineOverlay::~ImplHelpLineOverlay()
165 // The OverlayObjects are cleared using the destructor of OverlayObjectList.
166 // That destructor calls clear() at the list which removes all objects from the
167 // OverlayManager and deletes them.
170 void ImplHelpLineOverlay::SetPosition(const basegfx::B2DPoint
& rNewPosition
)
172 if(rNewPosition
!= maPosition
)
174 // apply to OverlayObjects
175 // apply to OverlayObjects
176 for(sal_uInt32
a(0); a
< maObjects
.count(); a
++)
178 sdr::overlay::OverlayHelplineStriped
* pCandidate
=
179 static_cast< sdr::overlay::OverlayHelplineStriped
* >(&maObjects
.getOverlayObject(a
));
183 pCandidate
->setBasePosition(rNewPosition
);
187 // remember new position
188 maPosition
= rNewPosition
;
192 ////////////////////////////////////////////////////////////////////////////////////////////////////
193 ////////////////////////////////////////////////////////////////////////////////////////////////////
195 // @@@@ @@ @@ @@@@ @@@@@ @@ @@ @@ @@@@@ @@ @@
196 // @@ @@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
197 // @@ @@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
198 // @@@@ @@@@@@ @@@@@@ @@@@@ @@@@@ @@ @@@@ @@@@@@@
199 // @@ @@ @@@ @@ @@ @@ @@@ @@ @@ @@@@@@@
200 // @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
201 // @@@@ @@ @@ @@ @@ @@ @ @@ @@@@@ @@ @@
203 ////////////////////////////////////////////////////////////////////////////////////////////////////
204 ////////////////////////////////////////////////////////////////////////////////////////////////////
206 void SdrSnapView::ClearVars()
221 bMoveSnapOnlyTopLeft
=FALSE
;
225 bAngleSnapEnab
=FALSE
;
226 bMoveOnlyDragging
=FALSE
;
227 bSlantButShear
=FALSE
;
228 bCrookNoContortion
=FALSE
;
229 eCrookMode
=SDRCROOK_ROTATE
;
231 bEliminatePolyPoints
=FALSE
;
232 nEliminatePolyPointLimitAngle
=0;
234 // #114409#-1 Migrate PageOrigin
237 // #114409#-2 Migrate HelpLine
241 SdrSnapView::SdrSnapView(SdrModel
* pModel1
, OutputDevice
* pOut
):
242 SdrPaintView(pModel1
,pOut
),
243 // #114409#-1 Migrate PageOrigin
244 mpPageOriginOverlay(0L),
245 // #114409#-2 Migrate HelpLine
246 mpHelpLineOverlay(0L)
251 // #114409#-1 Migrate PageOrigin
252 SdrSnapView::~SdrSnapView()
254 // #114409#-1 Migrate PageOrigin
257 // #114409#-2 Migrate HelpLine
261 ////////////////////////////////////////////////////////////////////////////////////////////////////
263 BOOL
SdrSnapView::IsAction() const
265 return IsSetPageOrg() || IsDragHelpLine() || SdrPaintView::IsAction();
268 void SdrSnapView::MovAction(const Point
& rPnt
)
270 SdrPaintView::MovAction(rPnt
);
271 if (IsSetPageOrg()) {
274 if (IsDragHelpLine()) {
275 MovDragHelpLine(rPnt
);
279 void SdrSnapView::EndAction()
281 if (IsSetPageOrg()) {
284 if (IsDragHelpLine()) {
287 SdrPaintView::EndAction();
290 void SdrSnapView::BckAction()
294 SdrPaintView::BckAction();
297 void SdrSnapView::BrkAction()
301 SdrPaintView::BrkAction();
304 void SdrSnapView::TakeActionRect(Rectangle
& rRect
) const
306 if (IsSetPageOrg() || IsDragHelpLine()) {
307 rRect
=Rectangle(aDragStat
.GetNow(),aDragStat
.GetNow());
309 SdrPaintView::TakeActionRect(rRect
);
313 ////////////////////////////////////////////////////////////////////////////////////////////////////
315 Point
SdrSnapView::GetSnapPos(const Point
& rPnt
, const SdrPageView
* pPV
) const
322 #define NOT_SNAPPED 0x7FFFFFFF
323 USHORT
SdrSnapView::SnapPos(Point
& rPnt
, const SdrPageView
* pPV
) const
325 if (!bSnapEnab
) return SDRSNAP_NOTSNAPPED
;
331 pPV
=GetSdrPageView();
332 if (pPV
==NULL
) return SDRSNAP_NOTSNAPPED
;
338 long mx
=aMagnSiz
.Width();
339 long my
=aMagnSiz
.Height();
340 if (bHlplVisible
&& bHlplSnap
&& !IsDragHelpLine())
342 const SdrHelpLineList
& rHLL
=pPV
->GetHelpLines();
343 USHORT nAnz
=rHLL
.GetCount();
344 for (USHORT i
=nAnz
; i
>0;) {
346 const SdrHelpLine
& rHL
=rHLL
[i
];
347 const Point
& rPos
=rHL
.GetPos();
348 switch (rHL
.GetKind()) {
349 case SDRHELPLINE_VERTICAL
: {
351 if (Abs(a
)<=mx
) { dx1
=-a
; if (Abs(dx1
)<Abs(dx
)) dx
=dx1
; }
353 case SDRHELPLINE_HORIZONTAL
: {
355 if (Abs(b
)<=my
) { dy1
=-b
; if (Abs(dy1
)<Abs(dy
)) dy
=dy1
; }
357 case SDRHELPLINE_POINT
: {
360 if (Abs(a
)<=mx
&& Abs(b
)<=my
) {
362 if (Abs(dx1
)<Abs(dx
) && Abs(dy1
)<Abs(dy
)) { dx
=dx1
; dy
=dy1
; }
368 if (bBordVisible
&& bBordSnap
) {
369 SdrPage
* pPage
=pPV
->GetPage();
370 long xs
=pPage
->GetWdt();
371 long ys
=pPage
->GetHgt();
372 long lft
=pPage
->GetLftBorder();
373 long rgt
=pPage
->GetRgtBorder();
374 long upp
=pPage
->GetUppBorder();
375 long lwr
=pPage
->GetLwrBorder();
377 a
=x
- lft
; if (Abs(a
)<=mx
) { dx1
=-a
; if (Abs(dx1
)<Abs(dx
)) dx
=dx1
; } // linker Rand
378 a
=x
-(xs
-rgt
); if (Abs(a
)<=mx
) { dx1
=-a
; if (Abs(dx1
)<Abs(dx
)) dx
=dx1
; } // rechter Rand
379 a
=x
; if (Abs(a
)<=mx
) { dx1
=-a
; if (Abs(dx1
)<Abs(dx
)) dx
=dx1
; } // linke Papierkante
380 a
=x
- xs
; if (Abs(a
)<=mx
) { dx1
=-a
; if (Abs(dx1
)<Abs(dx
)) dx
=dx1
; } // rechte Papierkante
381 a
=y
- upp
; if (Abs(a
)<=my
) { dy1
=-a
; if (Abs(dy1
)<Abs(dy
)) dy
=dy1
; } // linker Rand
382 a
=y
-(ys
-lwr
); if (Abs(a
)<=my
) { dy1
=-a
; if (Abs(dy1
)<Abs(dy
)) dy
=dy1
; } // rechter Rand
383 a
=y
; if (Abs(a
)<=my
) { dy1
=-a
; if (Abs(dy1
)<Abs(dy
)) dy
=dy1
; } // linke Papierkante
384 a
=y
- ys
; if (Abs(a
)<=my
) { dy1
=-a
; if (Abs(dy1
)<Abs(dy
)) dy
=dy1
; } // rechte Papierkante
386 if (bOFrmSnap
|| bOPntSnap
/*|| (bConnVisible && bOConSnap)*/) {
387 ULONG nMaxPointSnapCount
=200;
388 ULONG nMaxFrameSnapCount
=200;
390 // #97981# go back to IM_DEEPNOGROUPS runthrough for snap to object comparisons
391 SdrObjListIter
aIter(*pPV
->GetPage(),/*IM_FLAT*/IM_DEEPNOGROUPS
,TRUE
);
393 while (aIter
.IsMore() && (nMaxPointSnapCount
>0 || nMaxFrameSnapCount
>0)) {
394 SdrObject
* pO
=aIter
.Next();
395 Rectangle
aRect(pO
->GetCurrentBoundRect());
400 if (aRect
.IsInside(rPnt
)) {
401 if (bOPntSnap
&& nMaxPointSnapCount
>0)
403 sal_uInt32
nAnz(pO
->GetSnapPointCount());
404 for (sal_uInt32
i(0L); i
< nAnz
&& nMaxPointSnapCount
> 0L; i
++)
406 Point
aP(pO
->GetSnapPoint(i
));
409 if (Abs(dx1
)<=mx
&& Abs(dy1
)<=my
&& Abs(dx1
)<Abs(dx
) && Abs(dy1
)<Abs(dy
)) {
413 nMaxPointSnapCount
--;
416 if (bOFrmSnap
&& nMaxFrameSnapCount
>0) {
417 Rectangle
aLog(pO
->GetSnapRect());
423 if (aR1
.IsInside(rPnt
)) {
424 if (Abs(x
-aLog
.Left ())<=mx
) { dx1
=-(x
-aLog
.Left ()); if (Abs(dx1
)<Abs(dx
)) dx
=dx1
; }
425 if (Abs(x
-aLog
.Right ())<=mx
) { dx1
=-(x
-aLog
.Right ()); if (Abs(dx1
)<Abs(dx
)) dx
=dx1
; }
426 if (Abs(y
-aLog
.Top ())<=my
) { dy1
=-(y
-aLog
.Top ()); if (Abs(dy1
)<Abs(dy
)) dy
=dy1
; }
427 if (Abs(y
-aLog
.Bottom())<=my
) { dy1
=-(y
-aLog
.Bottom()); if (Abs(dy1
)<Abs(dy
)) dy
=dy1
; }
429 nMaxFrameSnapCount
--;
436 double fSnapWidth
= aSnapWdtX
;
437 if(dx
== NOT_SNAPPED
&& fSnapWidth
!= 0.0)
439 double fx
= (double)x
;
442 if(fx
- (double)pPV
->GetPageOrigin().X() >= 0.0)
443 fx
+= fSnapWidth
/ 2.0;
445 fx
-= fSnapWidth
/ 2.0;
447 x
= (long)((fx
- (double)pPV
->GetPageOrigin().X()) / fSnapWidth
);
448 x
= (long)((double)x
* fSnapWidth
+ (double)pPV
->GetPageOrigin().X());
451 fSnapWidth
= aSnapWdtY
;
452 if(dy
== NOT_SNAPPED
&& fSnapWidth
)
454 double fy
= (double)y
;
457 if(fy
- (double)pPV
->GetPageOrigin().Y() >= 0.0)
458 fy
+= fSnapWidth
/ 2.0;
460 fy
-= fSnapWidth
/ 2.0;
462 y
= (long)((fy
- (double)pPV
->GetPageOrigin().Y()) / fSnapWidth
);
463 y
= (long)((double)y
* fSnapWidth
+ (double)pPV
->GetPageOrigin().Y());
467 BOOL bRet
=SDRSNAP_NOTSNAPPED
;
468 if (dx
==NOT_SNAPPED
) dx
=0; else bRet
|=SDRSNAP_XSNAPPED
;
469 if (dy
==NOT_SNAPPED
) dy
=0; else bRet
|=SDRSNAP_YSNAPPED
;
475 void SdrSnapView::CheckSnap(const Point
& rPt
, const SdrPageView
* pPV
, long& nBestXSnap
, long& nBestYSnap
, bool& bXSnapped
, bool& bYSnapped
) const
478 USHORT nRet
=SnapPos(aPt
,pPV
);
480 if ((nRet
& SDRSNAP_XSNAPPED
) !=0) {
482 if (Abs(aPt
.X())<Abs(nBestXSnap
)) {
490 if ((nRet
& SDRSNAP_YSNAPPED
) !=0) {
492 if (Abs(aPt
.Y())<Abs(nBestYSnap
)) {
502 USHORT
SdrSnapView::SnapRect(const Rectangle
& rRect
, const SdrPageView
* pPV
, long& rDX
, long& rDY
) const
506 bool bXSnapped
=FALSE
;
507 bool bYSnapped
=FALSE
;
508 CheckSnap(rRect
.TopLeft() ,pPV
,nBestXSnap
,nBestYSnap
,bXSnapped
,bYSnapped
);
509 if (!bMoveSnapOnlyTopLeft
) {
510 CheckSnap(rRect
.TopRight() ,pPV
,nBestXSnap
,nBestYSnap
,bXSnapped
,bYSnapped
);
511 CheckSnap(rRect
.BottomLeft() ,pPV
,nBestXSnap
,nBestYSnap
,bXSnapped
,bYSnapped
);
512 CheckSnap(rRect
.BottomRight(),pPV
,nBestXSnap
,nBestYSnap
,bXSnapped
,bYSnapped
);
517 if (bXSnapped
) nRet
+=SDRSNAP_XSNAPPED
;
518 if (bYSnapped
) nRet
+=SDRSNAP_YSNAPPED
;
522 ////////////////////////////////////////////////////////////////////////////////////////////////////
524 sal_Bool
SdrSnapView::BegSetPageOrg(const Point
& rPnt
)
528 DBG_ASSERT(0L == mpPageOriginOverlay
, "SdrSnapView::BegSetPageOrg: There exists a ImplPageOriginOverlay (!)");
529 basegfx::B2DPoint
aStartPos(rPnt
.X(), rPnt
.Y());
530 mpPageOriginOverlay
= new ImplPageOriginOverlay(*this, aStartPos
);
531 aDragStat
.Reset(GetSnapPos(rPnt
,NULL
));
536 void SdrSnapView::MovSetPageOrg(const Point
& rPnt
)
540 aDragStat
.NextMove(GetSnapPos(rPnt
,NULL
));
541 DBG_ASSERT(mpPageOriginOverlay
, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
542 basegfx::B2DPoint
aNewPos(aDragStat
.GetNow().X(), aDragStat
.GetNow().Y());
543 mpPageOriginOverlay
->SetPosition(aNewPos
);
547 sal_Bool
SdrSnapView::EndSetPageOrg()
549 sal_Bool
bRet(sal_False
);
553 SdrPageView
* pPV
= GetSdrPageView();
557 Point
aPnt(aDragStat
.GetNow());
558 pPV
->SetPageOrigin(aPnt
);
569 void SdrSnapView::BrkSetPageOrg()
573 DBG_ASSERT(mpPageOriginOverlay
, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
574 delete mpPageOriginOverlay
;
575 mpPageOriginOverlay
= 0L;
579 ////////////////////////////////////////////////////////////////////////////////////////////////////
581 sal_Bool
SdrSnapView::PickHelpLine(const Point
& rPnt
, short nTol
, const OutputDevice
& rOut
, USHORT
& rnHelpLineNum
, SdrPageView
*& rpPV
) const
584 nTol
=ImpGetHitTolLogic(nTol
,&rOut
);
585 SdrPageView
* pPV
= GetSdrPageView();
590 USHORT nIndex
=pPV
->GetHelpLines().HitTest(aPnt
,USHORT(nTol
),rOut
);
591 if (nIndex
!=SDRHELPLINE_NOTFOUND
) {
593 rnHelpLineNum
=nIndex
;
600 // start HelpLine drag for new HelpLine
601 sal_Bool
SdrSnapView::BegDragHelpLine(USHORT nHelpLineNum
, SdrPageView
* pPV
)
603 sal_Bool
bRet(sal_False
);
609 if(pPV
&& nHelpLineNum
< pPV
->GetHelpLines().GetCount())
611 const SdrHelpLineList
& rHelpLines
= pPV
->GetHelpLines();
612 const SdrHelpLine
& rHelpLine
= rHelpLines
[nHelpLineNum
];
613 Point aHelpLinePos
= rHelpLine
.GetPos(); // + pPV->GetOffset();
614 basegfx::B2DPoint
aStartPos(aHelpLinePos
.X(), aHelpLinePos
.Y());
616 DBG_ASSERT(0L == mpHelpLineOverlay
, "SdrSnapView::BegDragHelpLine: There exists a ImplHelpLineOverlay (!)");
617 mpHelpLineOverlay
= new ImplHelpLineOverlay(*this, aStartPos
, pPV
, nHelpLineNum
, rHelpLine
.GetKind());
619 aDragStat
.Reset(GetSnapPos(aHelpLinePos
, pPV
));
620 aDragStat
.SetMinMove(ImpGetMinMovLogic(-3, 0L));
629 // start HelpLine drag with existing HelpLine
630 sal_Bool
SdrSnapView::BegDragHelpLine(const Point
& rPnt
, SdrHelpLineKind eNewKind
)
632 sal_Bool
bRet(sal_False
);
638 DBG_ASSERT(0L == mpHelpLineOverlay
, "SdrSnapView::BegDragHelpLine: There exists a ImplHelpLineOverlay (!)");
639 basegfx::B2DPoint
aStartPos(rPnt
.X(), rPnt
.Y());
640 mpHelpLineOverlay
= new ImplHelpLineOverlay(*this, aStartPos
, 0L, 0, eNewKind
);
641 aDragStat
.Reset(GetSnapPos(rPnt
, 0L));
648 Pointer
SdrSnapView::GetDraggedHelpLinePointer() const
652 switch(mpHelpLineOverlay
->GetHelpLineKind())
654 case SDRHELPLINE_VERTICAL
: return Pointer(POINTER_ESIZE
);
655 case SDRHELPLINE_HORIZONTAL
: return Pointer(POINTER_SSIZE
);
656 default : return Pointer(POINTER_MOVE
);
660 return Pointer(POINTER_MOVE
);
663 void SdrSnapView::MovDragHelpLine(const Point
& rPnt
)
665 if(IsDragHelpLine() && aDragStat
.CheckMinMoved(rPnt
))
667 Point
aPnt(GetSnapPos(rPnt
, 0L));
669 if(aPnt
!= aDragStat
.GetNow())
671 aDragStat
.NextMove(aPnt
);
672 DBG_ASSERT(mpHelpLineOverlay
, "SdrSnapView::MovDragHelpLine: no ImplHelpLineOverlay (!)");
673 basegfx::B2DPoint
aNewPos(aDragStat
.GetNow().X(), aDragStat
.GetNow().Y());
674 mpHelpLineOverlay
->SetPosition(aNewPos
);
679 sal_Bool
SdrSnapView::EndDragHelpLine()
681 sal_Bool
bRet(sal_False
);
685 if(aDragStat
.IsMinMoved())
687 SdrPageView
* pPageView
= mpHelpLineOverlay
->GetPageView();
691 // moved existing one
692 Point
aPnt(aDragStat
.GetNow());
693 const SdrHelpLineList
& rHelpLines
= pPageView
->GetHelpLines();
694 SdrHelpLine aChangedHelpLine
= rHelpLines
[mpHelpLineOverlay
->GetHelpLineNumber()];
695 aChangedHelpLine
.SetPos(aPnt
);
696 pPageView
->SetHelpLine(mpHelpLineOverlay
->GetHelpLineNumber(), aChangedHelpLine
);
703 pPageView
= GetSdrPageView();
707 Point
aPnt(aDragStat
.GetNow());
708 SdrHelpLine
aNewHelpLine(mpHelpLineOverlay
->GetHelpLineKind(), aPnt
);
709 pPageView
->InsertHelpLine(aNewHelpLine
);
723 void SdrSnapView::BrkDragHelpLine()
727 DBG_ASSERT(mpHelpLineOverlay
, "SdrSnapView::EndDragHelpLine: no ImplHelpLineOverlay (!)");
728 delete mpHelpLineOverlay
;
729 mpHelpLineOverlay
= 0L;