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: svddrgv.cxx,v $
10 * $Revision: 1.27.18.1 $
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/svddrgv.hxx>
36 #include <svx/xpoly.hxx>
37 #include <svx/svdetc.hxx>
38 #include <svx/svdtrans.hxx>
39 #include <svx/svdundo.hxx>
40 #include <svx/svdocapt.hxx>
41 #include <svx/svdpagv.hxx>
42 #include <svx/svdopath.hxx>
43 #include <svx/svdoedge.hxx>
45 #include "svdglob.hxx"
46 #include "svddrgm1.hxx"
47 #include <svx/obj3d.hxx>
48 #include <svx/svdoashp.hxx>
49 #include <sdrpaintwindow.hxx>
50 #include <basegfx/polygon/b2dpolypolygontools.hxx>
51 #include <basegfx/polygon/b2dpolygontools.hxx>
52 #include <svx/polypolygoneditor.hxx>
53 #include <basegfx/matrix/b2dhommatrix.hxx>
54 #include <svx/sdr/overlay/overlaymanager.hxx>
58 ////////////////////////////////////////////////////////////////////////////////////////////////////
59 ////////////////////////////////////////////////////////////////////////////////////////////////////
61 // @@@@@ @@@@@ @@@@ @@@@ @@ @@ @@ @@@@@ @@ @@
62 // @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
63 // @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
64 // @@ @@ @@@@@ @@@@@@ @@ @@@ @@@@@ @@ @@@@ @@@@@@@
65 // @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
66 // @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
67 // @@@@@ @@ @@ @@ @@ @@@@@ @ @@ @@@@@ @@ @@
69 ////////////////////////////////////////////////////////////////////////////////////////////////////
70 ////////////////////////////////////////////////////////////////////////////////////////////////////
72 void SdrDragView::ImpClearVars()
75 eDragMode
=SDRDRAG_MOVE
;
77 bMarkedHitMovesAlways
=FALSE
;
82 mpCurrentSdrDragMethod
=NULL
;
88 bInsObjPointMode
=FALSE
;
89 bInsGluePointMode
=FALSE
;
90 nDragXorPolyLimit
=100;
91 nDragXorPointLimit
=500;
92 bNoDragXorPolys
=FALSE
;
95 bRubberEdgeDragging
=TRUE
;
96 nRubberEdgeDraggingLimit
=100;
97 bDetailedEdgeDragging
=TRUE
;
98 nDetailedEdgeDraggingLimit
=10;
99 bResizeAtCenter
=FALSE
;
100 bCrookAtCenter
=FALSE
;
101 bMouseHideWhileDraggingPoints
=FALSE
;
103 // init using default
104 mbSolidDragging
= getOptionsDrawinglayer().IsSolidDragCreate();
107 void SdrDragView::ImpMakeDragAttr()
112 SdrDragView::SdrDragView(SdrModel
* pModel1
, OutputDevice
* pOut
)
113 : SdrExchangeView(pModel1
,pOut
)
119 SdrDragView::~SdrDragView()
124 void SdrDragView::ImpDelDragAttr()
128 BOOL
SdrDragView::IsAction() const
130 return (mpCurrentSdrDragMethod
|| SdrExchangeView::IsAction());
133 void SdrDragView::MovAction(const Point
& rPnt
)
135 SdrExchangeView::MovAction(rPnt
);
136 if (mpCurrentSdrDragMethod
)
142 void SdrDragView::EndAction()
144 if (mpCurrentSdrDragMethod
)
148 SdrExchangeView::EndAction();
151 void SdrDragView::BckAction()
153 SdrExchangeView::BckAction();
157 void SdrDragView::BrkAction()
159 SdrExchangeView::BrkAction();
163 void SdrDragView::TakeActionRect(Rectangle
& rRect
) const
165 if (mpCurrentSdrDragMethod
)
167 rRect
=aDragStat
.GetActionRect();
170 SdrPageView
* pPV
= GetSdrPageView();
172 if(pPV
&& pPV
->HasMarkedObjPageView())
174 // #i95646# is this used..?
175 const basegfx::B2DRange
aBoundRange(mpCurrentSdrDragMethod
->getCurrentRange());
177 basegfx::fround(aBoundRange
.getMinX()), basegfx::fround(aBoundRange
.getMinY()),
178 basegfx::fround(aBoundRange
.getMaxX()), basegfx::fround(aBoundRange
.getMaxY()));
183 rRect
=Rectangle(aDragStat
.GetNow(),aDragStat
.GetNow());
188 SdrExchangeView::TakeActionRect(rRect
);
192 BOOL
SdrDragView::TakeDragObjAnchorPos(Point
& rPos
, BOOL bTR
) const
196 rPos
= bTR
? aR
.TopRight() : aR
.TopLeft();
197 if (GetMarkedObjectCount()==1 && IsDragObj() && // nur bei Einzelselektion
198 !IsDraggingPoints() && !IsDraggingGluePoints() && // nicht beim Punkteschieben
199 !mpCurrentSdrDragMethod
->ISA(SdrDragMovHdl
)) // nicht beim Handlesschieben
201 SdrObject
* pObj
=GetMarkedObjectByIndex(0);
202 if (pObj
->ISA(SdrCaptionObj
))
204 Point
aPt(((SdrCaptionObj
*)pObj
)->GetTailPos());
205 BOOL bTail
=eDragHdl
==HDL_POLY
; // Schwanz wird gedraggt (nicht so ganz feine Abfrage hier)
206 BOOL bOwn
=mpCurrentSdrDragMethod
->ISA(SdrDragObjOwn
); // Objektspeziefisch
208 { // bei bTail liefert TakeActionRect schon das richtige
210 { // bOwn kann sein MoveTextFrame, ResizeTextFrame aber eben nicht mehr DragTail
215 // drag the whole Object (Move, Resize, ...)
216 const basegfx::B2DPoint
aTransformed(mpCurrentSdrDragMethod
->getCurrentTransformation() * basegfx::B2DPoint(aPt
.X(), aPt
.Y()));
217 rPos
.X() = basegfx::fround(aTransformed
.getX());
218 rPos
.Y() = basegfx::fround(aTransformed
.getY());
227 ////////////////////////////////////////////////////////////////////////////////////////////////////
229 BOOL
SdrDragView::TakeDragLimit(SdrDragMode
/*eMode*/, Rectangle
& /*rRect*/) const
234 BOOL
SdrDragView::BegDragObj(const Point
& rPnt
, OutputDevice
* pOut
, SdrHdl
* pHdl
, short nMinMov
, SdrDragMethod
* pForcedMeth
)
240 SetDragWithCopy(FALSE
);
241 //ForceEdgesOfMarkedNodes();
242 //TODO: aAni.Reset();
243 mpCurrentSdrDragMethod
=NULL
;
246 SdrDragMode eTmpMode
=eDragMode
;
247 if (eTmpMode
==SDRDRAG_MOVE
&& pHdl
!=NULL
&& pHdl
->GetKind()!=HDL_MOVE
) {
248 eTmpMode
=SDRDRAG_RESIZE
;
250 bDragLimit
=TakeDragLimit(eTmpMode
,aDragLimit
);
251 bFramDrag
=ImpIsFrameHandles();
253 (pMarkedObj
==NULL
|| !pMarkedObj
->hasSpecialDrag()) &&
254 (pHdl
==NULL
|| pHdl
->GetObj()==NULL
)) {
260 || pHdl
->GetKind() == HDL_MOVE
261 || pHdl
->GetKind() == HDL_MIRX
262 || pHdl
->GetKind() == HDL_TRNS
263 || pHdl
->GetKind() == HDL_GRAD
)
265 aDragStat
.Reset(aPnt
);
269 aDragStat
.Reset(pHdl
->GetPos());
272 aDragStat
.SetView((SdrView
*)this);
273 aDragStat
.SetPageView(pMarkedPV
); // <<-- hier muss die DragPV rein!!!
274 aDragStat
.SetMinMove(ImpGetMinMovLogic(nMinMov
,pOut
));
275 aDragStat
.SetHdl(pHdl
);
276 aDragStat
.NextPoint();
279 eDragHdl
= pHdl
==NULL
? HDL_MOVE
: pHdl
->GetKind();
280 bDragHdl
=eDragHdl
==HDL_REF1
|| eDragHdl
==HDL_REF2
|| eDragHdl
==HDL_MIRX
;
282 // #103894# Expand test for HDL_ANCHOR_TR
283 BOOL bNotDraggable
= (HDL_ANCHOR
== eDragHdl
|| HDL_ANCHOR_TR
== eDragHdl
);
285 if(pHdl
&& (pHdl
->GetKind() == HDL_SMARTTAG
) && pForcedMeth
)
287 // just use the forced method for smart tags
291 mpCurrentSdrDragMethod
= new SdrDragMovHdl(*this);
293 else if(!bNotDraggable
)
297 case SDRDRAG_ROTATE
: case SDRDRAG_SHEAR
: case SDRDRAG_DISTORT
:
301 case HDL_LEFT
: case HDL_RIGHT
:
302 case HDL_UPPER
: case HDL_LOWER
:
304 // Sind 3D-Objekte selektiert?
305 BOOL b3DObjSelected
= FALSE
;
306 for(UINT32 a
=0;!b3DObjSelected
&& a
<GetMarkedObjectCount();a
++)
308 SdrObject
* pObj
= GetMarkedObjectByIndex(a
);
309 if(pObj
&& pObj
->ISA(E3dObject
))
310 b3DObjSelected
= TRUE
;
312 // Falls ja, Shear auch bei !IsShearAllowed zulassen,
313 // da es sich bei 3D-Objekten um eingeschraenkte
314 // Rotationen handelt
315 if (!b3DObjSelected
&& !IsShearAllowed())
317 mpCurrentSdrDragMethod
= new SdrDragShear(*this,eDragMode
==SDRDRAG_ROTATE
);
319 case HDL_UPLFT
: case HDL_UPRGT
:
320 case HDL_LWLFT
: case HDL_LWRGT
:
322 if (eDragMode
==SDRDRAG_SHEAR
|| eDragMode
==SDRDRAG_DISTORT
)
324 if (!IsDistortAllowed(TRUE
) && !IsDistortAllowed(FALSE
)) return FALSE
;
325 mpCurrentSdrDragMethod
= new SdrDragDistort(*this);
329 if (!IsRotateAllowed(TRUE
)) return FALSE
;
330 mpCurrentSdrDragMethod
= new SdrDragRotate(*this);
335 if (IsMarkedHitMovesAlways() && eDragHdl
==HDL_MOVE
)
336 { // HDL_MOVE ist auch wenn Obj direkt getroffen
337 if (!IsMoveAllowed()) return FALSE
;
338 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
342 if (!IsRotateAllowed(TRUE
)) return FALSE
;
343 mpCurrentSdrDragMethod
= new SdrDragRotate(*this);
350 if (eDragHdl
==HDL_MOVE
&& IsMarkedHitMovesAlways())
352 if (!IsMoveAllowed()) return FALSE
;
353 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
357 if (!IsMirrorAllowed(TRUE
,TRUE
)) return FALSE
;
358 mpCurrentSdrDragMethod
= new SdrDragMirror(*this);
364 if (eDragHdl
==HDL_MOVE
&& IsMarkedHitMovesAlways())
366 if (!IsMoveAllowed())
368 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
372 if (!IsCrookAllowed(TRUE
) && !IsCrookAllowed(FALSE
))
374 mpCurrentSdrDragMethod
= new SdrDragCrop(*this);
379 case SDRDRAG_TRANSPARENCE
:
381 if(eDragHdl
== HDL_MOVE
&& IsMarkedHitMovesAlways())
385 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
389 if(!IsTransparenceAllowed())
392 mpCurrentSdrDragMethod
= new SdrDragGradient(*this, FALSE
);
396 case SDRDRAG_GRADIENT
:
398 if(eDragHdl
== HDL_MOVE
&& IsMarkedHitMovesAlways())
402 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
406 if(!IsGradientAllowed())
409 mpCurrentSdrDragMethod
= new SdrDragGradient(*this);
416 if (eDragHdl
==HDL_MOVE
&& IsMarkedHitMovesAlways())
418 if (!IsMoveAllowed()) return FALSE
;
419 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
423 if (!IsCrookAllowed(TRUE
) && !IsCrookAllowed(FALSE
)) return FALSE
;
424 mpCurrentSdrDragMethod
= new SdrDragCrook(*this);
431 if((eDragHdl
== HDL_MOVE
) && !IsMoveAllowed())
435 else if(eDragHdl
== HDL_GLUE
)
437 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
443 if(eDragHdl
== HDL_MOVE
)
445 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
449 if(!IsResizeAllowed(TRUE
))
454 sal_Bool bSingleTextObjMark
= sal_False
; // SJ: #i100490#
455 if ( GetMarkedObjectCount() == 1 )
457 pMarkedObj
=GetMarkedObjectByIndex(0);
459 pMarkedObj
->ISA( SdrTextObj
) &&
460 static_cast<SdrTextObj
*>(pMarkedObj
)->IsTextFrame() )
461 bSingleTextObjMark
= sal_True
;
463 if ( bSingleTextObjMark
)
464 mpCurrentSdrDragMethod
= new SdrDragObjOwn(*this);
466 mpCurrentSdrDragMethod
= new SdrDragResize(*this);
471 if(HDL_MOVE
== eDragHdl
)
473 const bool bCustomShapeSelected(1 == GetMarkedObjectCount() && GetMarkedObjectByIndex(0)->ISA(SdrObjCustomShape
));
475 if(bCustomShapeSelected
)
477 mpCurrentSdrDragMethod
= new SdrDragMove( *this );
480 else if(HDL_POLY
== eDragHdl
)
482 const bool bConnectorSelected(1 == GetMarkedObjectCount() && GetMarkedObjectByIndex(0)->ISA(SdrEdgeObj
));
484 if(bConnectorSelected
)
487 // fallback to old behaviour for connectors (see
488 // text in task description for more details)
490 else if(!IsMoveAllowed() || !IsResizeAllowed())
493 // do not allow move of polygon points if object is move or size protected
498 if(!mpCurrentSdrDragMethod
)
500 // fallback to DragSpecial if no interaction defined
502 mpCurrentSdrDragMethod
= new SdrDragObjOwn(*this);
509 if (pForcedMeth
!=NULL
)
511 delete mpCurrentSdrDragMethod
;
512 mpCurrentSdrDragMethod
= pForcedMeth
;
514 aDragStat
.SetDragMethod(mpCurrentSdrDragMethod
);
515 if (mpCurrentSdrDragMethod
)
517 bRet
= mpCurrentSdrDragMethod
->BeginSdrDrag();
520 if (pHdl
==NULL
&& IS_TYPE(SdrDragObjOwn
,mpCurrentSdrDragMethod
))
522 // Aha, Obj kann nicht Move SpecialDrag, also MoveFrameDrag versuchen
523 delete mpCurrentSdrDragMethod
;
524 mpCurrentSdrDragMethod
= 0;
527 if (!IsMoveAllowed())
531 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
532 aDragStat
.SetDragMethod(mpCurrentSdrDragMethod
);
533 bRet
= mpCurrentSdrDragMethod
->BeginSdrDrag();
538 delete mpCurrentSdrDragMethod
;
539 mpCurrentSdrDragMethod
= 0;
540 aDragStat
.SetDragMethod(mpCurrentSdrDragMethod
);
548 void SdrDragView::MovDragObj(const Point
& rPnt
)
550 if (mpCurrentSdrDragMethod
)
553 ImpLimitToWorkArea(aPnt
);
554 mpCurrentSdrDragMethod
->MoveSdrDrag(aPnt
); // this call already makes a Hide()/Show combination
558 BOOL
SdrDragView::EndDragObj(BOOL bCopy
)
562 // #i73341# If insert GluePoint, do not insist on last points being different
563 if(mpCurrentSdrDragMethod
&& aDragStat
.IsMinMoved() && (IsInsertGluePoint() || aDragStat
.GetNow() != aDragStat
.GetPrev()))
567 if (bEliminatePolyPoints
)
569 nHdlAnzMerk
=GetMarkablePointCount();
572 const bool bUndo
= IsUndoEnabled();
573 if (IsInsertGluePoint() && bUndo
)
575 BegUndo(aInsPointUndoStr
);
576 AddUndo(pInsPointUndo
);
579 bRet
= mpCurrentSdrDragMethod
->EndSdrDrag(bCopy
);
581 if( IsInsertGluePoint() && bUndo
)
584 delete mpCurrentSdrDragMethod
;
585 mpCurrentSdrDragMethod
= 0;
587 if (bEliminatePolyPoints
)
589 if (nHdlAnzMerk
!=GetMarkablePointCount())
601 BegUndo(aInsPointUndoStr
);
602 AddUndo(pInsPointUndo
);
610 if (!bSomeObjChgdFlag
)
612 // Aha, Obj hat nicht gebroadcastet (z.B. Writer FlyFrames)
625 SetInsertGluePoint(FALSE
);
630 void SdrDragView::BrkDragObj()
632 if (mpCurrentSdrDragMethod
)
634 mpCurrentSdrDragMethod
->CancelSdrDrag();
636 delete mpCurrentSdrDragMethod
;
637 mpCurrentSdrDragMethod
= 0;
641 pInsPointUndo
->Undo(); // Den eingefuegten Punkt wieder raus
642 delete pInsPointUndo
;
648 if (IsInsertGluePoint())
650 pInsPointUndo
->Undo(); // Den eingefuegten Klebepunkt wieder raus
651 delete pInsPointUndo
;
653 SetInsertGluePoint(FALSE
);
661 BOOL
SdrDragView::IsInsObjPointPossible() const
663 return pMarkedObj
!=NULL
&& pMarkedObj
->IsPolyObj();
666 sal_Bool
SdrDragView::ImpBegInsObjPoint(sal_Bool bIdxZwang
, sal_uInt32 nIdx
, const Point
& rPnt
, sal_Bool bNewObj
, OutputDevice
* pOut
)
668 sal_Bool
bRet(sal_False
);
670 if(pMarkedObj
&& pMarkedObj
->ISA(SdrPathObj
))
672 SdrPathObj
* pMarkedPath
= (SdrPathObj
*)pMarkedObj
;
674 pInsPointUndo
= dynamic_cast< SdrUndoGeoObj
* >( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pMarkedObj
) );
675 DBG_ASSERT( pInsPointUndo
, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" );
677 XubString
aStr(ImpGetResStr(STR_DragInsertPoint
));
679 pMarkedObj
->TakeObjNameSingul(aName
);
680 xub_StrLen
nPos(aStr
.SearchAscii("%1"));
682 if(STRING_NOTFOUND
!= nPos
)
685 aStr
.Insert(aName
, nPos
);
688 aInsPointUndoStr
= aStr
;
692 aPt
= GetSnapPos(aPt
,pMarkedPV
);
694 sal_Bool
bClosed0(pMarkedPath
->IsClosedObj());
698 mnInsPointNum
= pMarkedPath
->NbcInsPoint(nIdx
, aPt
, bNewObj
, sal_True
);
702 mnInsPointNum
= pMarkedPath
->NbcInsPointOld(aPt
, bNewObj
, sal_True
);
705 if(bClosed0
!= pMarkedPath
->IsClosedObj())
707 // Obj was closed implicit
709 pMarkedPath
->SetChanged();
710 pMarkedPath
->BroadcastObjectChange();
713 if(0xffffffff != mnInsPointNum
)
715 bInsPolyPoint
= sal_True
;
719 bRet
= BegDragObj(rPnt
, pOut
, aHdl
.GetHdl(mnInsPointNum
), 0);
723 aDragStat
.SetMinMoved();
729 delete pInsPointUndo
;
730 pInsPointUndo
= NULL
;
737 BOOL
SdrDragView::EndInsObjPoint(SdrCreateCmd eCmd
)
741 sal_uInt32
nNextPnt(mnInsPointNum
);
742 Point
aPnt(aDragStat
.GetNow());
743 BOOL bOk
=EndDragObj(FALSE
);
744 if (bOk
==TRUE
&& eCmd
!=SDRCREATE_FORCEEND
)
746 // Ret=True bedeutet: Action ist vorbei.
747 bOk
=!(ImpBegInsObjPoint(sal_True
, nNextPnt
, aPnt
, eCmd
== SDRCREATE_NEXTOBJECT
, pDragWin
));
754 BOOL
SdrDragView::IsInsGluePointPossible() const
757 if (IsInsGluePointMode() && AreObjectsMarked())
759 if (GetMarkedObjectCount()==1)
761 // FALSE liefern, wenn 1 Objekt und dieses ein Verbinder ist.
762 const SdrObject
* pObj
=GetMarkedObjectByIndex(0);
763 if (!HAS_BASE(SdrEdgeObj
,pObj
))
776 BOOL
SdrDragView::BegInsGluePoint(const Point
& rPnt
)
782 if (PickMarkedObj(rPnt
,pObj
,pPV
,&nMarkNum
,SDRSEARCH_PASS2BOUND
))
785 UnmarkAllGluePoints();
786 pInsPointUndo
= dynamic_cast< SdrUndoGeoObj
* >( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj
) );
787 DBG_ASSERT( pInsPointUndo
, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" );
788 XubString
aStr(ImpGetResStr(STR_DragInsertGluePoint
));
789 XubString aName
; pObj
->TakeObjNameSingul(aName
);
791 aStr
.SearchAndReplaceAscii("%1", aName
);
793 aInsPointUndoStr
=aStr
;
794 SdrGluePointList
* pGPL
=pObj
->ForceGluePointList();
797 USHORT nGlueIdx
=pGPL
->Insert(SdrGluePoint());
798 SdrGluePoint
& rGP
=(*pGPL
)[nGlueIdx
];
799 USHORT nGlueId
=rGP
.GetId();
800 rGP
.SetAbsolutePos(rPnt
,*pObj
);
803 if (MarkGluePoint(pObj
,nGlueId
,pPV
))
805 pHdl
=GetGluePointHdl(pObj
,nGlueId
);
807 if (pHdl
!=NULL
&& pHdl
->GetKind()==HDL_GLUE
&& pHdl
->GetObj()==pObj
&& pHdl
->GetObjHdlNum()==nGlueId
)
809 SetInsertGluePoint(TRUE
);
810 bRet
=BegDragObj(rPnt
,NULL
,pHdl
,0);
813 aDragStat
.SetMinMoved();
818 SetInsertGluePoint(FALSE
);
819 delete pInsPointUndo
;
825 DBG_ERROR("BegInsGluePoint(): GluePoint-Handle nicht gefunden");
830 // Keine Klebepunkte moeglich bei diesem Objekt (z.B. Edge)
831 SetInsertGluePoint(FALSE
);
832 delete pInsPointUndo
;
840 void SdrDragView::ShowDragObj()
842 if(mpCurrentSdrDragMethod
&& !aDragStat
.IsShown())
844 for(sal_uInt32
a(0); a
< PaintWindowCount(); a
++)
846 SdrPaintWindow
* pCandidate
= GetPaintWindow(a
);
847 sdr::overlay::OverlayManager
* pOverlayManager
= pCandidate
->GetOverlayManager();
851 mpCurrentSdrDragMethod
->CreateOverlayGeometry(*pOverlayManager
);
853 // #i101679# Force changed overlay to be shown
854 pOverlayManager
->flush();
858 aDragStat
.SetShown(TRUE
);
862 void SdrDragView::HideDragObj()
864 if(mpCurrentSdrDragMethod
&& aDragStat
.IsShown())
866 mpCurrentSdrDragMethod
->destroyOverlayGeometry();
867 aDragStat
.SetShown(FALSE
);
871 ////////////////////////////////////////////////////////////////////////////////////////////////////
873 void SdrDragView::SetNoDragXorPolys(BOOL bOn
)
875 if (IsNoDragXorPolys()!=bOn
)
877 const bool bDragging(mpCurrentSdrDragMethod
);
878 const bool bShown(bDragging
&& aDragStat
.IsShown());
885 bNoDragXorPolys
= bOn
;
889 // force recreation of drag content
890 mpCurrentSdrDragMethod
->resetSdrDragEntries();
900 void SdrDragView::SetDragStripes(BOOL bOn
)
902 if (mpCurrentSdrDragMethod
&& aDragStat
.IsShown())
914 BOOL
SdrDragView::IsOrthoDesired() const
916 if(mpCurrentSdrDragMethod
&& (IS_TYPE(SdrDragObjOwn
, mpCurrentSdrDragMethod
) || IS_TYPE(SdrDragResize
, mpCurrentSdrDragMethod
)))
918 return bOrthoDesiredOnMarked
;
924 ////////////////////////////////////////////////////////////////////////////////////////////////////
926 void SdrDragView::SetRubberEdgeDragging(BOOL bOn
)
928 if (bOn
!=IsRubberEdgeDragging())
930 ULONG nAnz
= GetEdgesOfMarkedNodes().GetMarkCount();
931 BOOL bShowHide
=nAnz
!=0 && IsDragObj() &&
932 (nRubberEdgeDraggingLimit
>=nAnz
);
935 bRubberEdgeDragging
=bOn
;
941 void SdrDragView::SetRubberEdgeDraggingLimit(USHORT nEdgeObjAnz
)
943 if (nEdgeObjAnz
!=nRubberEdgeDraggingLimit
)
945 ULONG nAnz
= GetEdgesOfMarkedNodes().GetMarkCount();
946 BOOL bShowHide
=IsRubberEdgeDragging() && nAnz
!=0 && IsDragObj() &&
947 (nEdgeObjAnz
>=nAnz
)!=(nRubberEdgeDraggingLimit
>=nAnz
);
950 nRubberEdgeDraggingLimit
=nEdgeObjAnz
;
956 void SdrDragView::SetDetailedEdgeDragging(BOOL bOn
)
958 if (bOn
!=IsDetailedEdgeDragging())
960 ULONG nAnz
= GetEdgesOfMarkedNodes().GetMarkCount();
961 BOOL bShowHide
=nAnz
!=0 && IsDragObj() &&
962 (nDetailedEdgeDraggingLimit
>=nAnz
);
965 bDetailedEdgeDragging
=bOn
;
971 void SdrDragView::SetDetailedEdgeDraggingLimit(USHORT nEdgeObjAnz
)
973 if (nEdgeObjAnz
!=nDetailedEdgeDraggingLimit
)
975 ULONG nAnz
= GetEdgesOfMarkedNodes().GetMarkCount();
976 BOOL bShowHide
=IsDetailedEdgeDragging() && nAnz
!=0 && IsDragObj() &&
977 (nEdgeObjAnz
>=nAnz
)!=(nDetailedEdgeDraggingLimit
>=nAnz
);
980 nDetailedEdgeDraggingLimit
=nEdgeObjAnz
;
986 void SdrDragView::SetMarkHandles()
991 SdrExchangeView::SetMarkHandles();
994 void SdrDragView::SetSolidDragging(bool bOn
)
996 if((bool)mbSolidDragging
!= bOn
)
998 mbSolidDragging
= bOn
;
1002 bool SdrDragView::IsSolidDragging() const
1004 // allow each user to disable by having a local setting, but using AND for
1005 // checking allowance
1006 return mbSolidDragging
&& getOptionsDrawinglayer().IsSolidDragCreate();