1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <svx/svddrgv.hxx>
22 #include "svx/xattr.hxx"
23 #include <svx/xpoly.hxx>
24 #include <svx/svdetc.hxx>
25 #include <svx/svdtrans.hxx>
26 #include <svx/svdundo.hxx>
27 #include <svx/svdocapt.hxx>
28 #include <svx/svdpagv.hxx>
29 #include <svx/svdopath.hxx>
30 #include <svx/svdoedge.hxx>
31 #include "svx/svdstr.hrc"
32 #include "svx/svdglob.hxx"
33 #include "svddrgm1.hxx"
34 #include <svx/obj3d.hxx>
35 #include <svx/svdoashp.hxx>
36 #include <svx/sdrpaintwindow.hxx>
37 #include <basegfx/polygon/b2dpolypolygontools.hxx>
38 #include <basegfx/polygon/b2dpolygontools.hxx>
39 #include <svx/polypolygoneditor.hxx>
40 #include <basegfx/matrix/b2dhommatrix.hxx>
41 #include <svx/sdr/overlay/overlaymanager.hxx>
45 ////////////////////////////////////////////////////////////////////////////////////////////////////
46 ////////////////////////////////////////////////////////////////////////////////////////////////////
48 ////////////////////////////////////////////////////////////////////////////////////////////////////
49 ////////////////////////////////////////////////////////////////////////////////////////////////////
51 void SdrDragView::ImpClearVars()
54 eDragMode
=SDRDRAG_MOVE
;
56 bMarkedHitMovesAlways
=sal_False
;
60 bDragSpecial
=sal_False
;
61 mpCurrentSdrDragMethod
=NULL
;
62 bDragStripes
=sal_False
;
63 bMirrRefDragObj
=sal_True
;
64 bDragWithCopy
=sal_False
;
66 bInsGluePoint
=sal_False
;
67 bInsObjPointMode
=sal_False
;
68 bInsGluePointMode
=sal_False
;
69 nDragXorPolyLimit
=100;
70 nDragXorPointLimit
=500;
71 bNoDragXorPolys
=sal_False
;
72 bAutoVertexCon
=sal_True
;
73 bAutoCornerCon
=sal_False
;
74 bRubberEdgeDragging
=sal_True
;
75 bDetailedEdgeDragging
=sal_True
;
76 nDetailedEdgeDraggingLimit
=10;
77 bResizeAtCenter
=sal_False
;
78 bCrookAtCenter
=sal_False
;
79 bMouseHideWhileDraggingPoints
=sal_False
;
82 mbSolidDragging
= getOptionsDrawinglayer().IsSolidDragCreate();
85 SdrDragView::SdrDragView(SdrModel
* pModel1
, OutputDevice
* pOut
)
86 : SdrExchangeView(pModel1
,pOut
)
91 SdrDragView::~SdrDragView()
95 sal_Bool
SdrDragView::IsAction() const
97 return (mpCurrentSdrDragMethod
|| SdrExchangeView::IsAction());
100 void SdrDragView::MovAction(const Point
& rPnt
)
102 SdrExchangeView::MovAction(rPnt
);
103 if (mpCurrentSdrDragMethod
)
109 void SdrDragView::EndAction()
111 if (mpCurrentSdrDragMethod
)
113 EndDragObj(sal_False
);
115 SdrExchangeView::EndAction();
118 void SdrDragView::BckAction()
120 SdrExchangeView::BckAction();
124 void SdrDragView::BrkAction()
126 SdrExchangeView::BrkAction();
130 void SdrDragView::TakeActionRect(Rectangle
& rRect
) const
132 if (mpCurrentSdrDragMethod
)
134 rRect
=aDragStat
.GetActionRect();
137 SdrPageView
* pPV
= GetSdrPageView();
139 if(pPV
&& pPV
->HasMarkedObjPageView())
141 // #i95646# is this used..?
142 const basegfx::B2DRange
aBoundRange(mpCurrentSdrDragMethod
->getCurrentRange());
144 basegfx::fround(aBoundRange
.getMinX()), basegfx::fround(aBoundRange
.getMinY()),
145 basegfx::fround(aBoundRange
.getMaxX()), basegfx::fround(aBoundRange
.getMaxY()));
150 rRect
=Rectangle(aDragStat
.GetNow(),aDragStat
.GetNow());
155 SdrExchangeView::TakeActionRect(rRect
);
159 sal_Bool
SdrDragView::TakeDragObjAnchorPos(Point
& rPos
, sal_Bool bTR
) const
163 rPos
= bTR
? aR
.TopRight() : aR
.TopLeft();
164 if (GetMarkedObjectCount()==1 && IsDragObj() && // only on single selection
165 !IsDraggingPoints() && !IsDraggingGluePoints() && // not when moving points
166 !mpCurrentSdrDragMethod
->ISA(SdrDragMovHdl
)) // not when moving handles
168 SdrObject
* pObj
=GetMarkedObjectByIndex(0);
169 if (pObj
->ISA(SdrCaptionObj
))
171 Point
aPt(((SdrCaptionObj
*)pObj
)->GetTailPos());
172 bool bTail
=eDragHdl
==HDL_POLY
; // drag tail
173 sal_Bool bOwn
=mpCurrentSdrDragMethod
->ISA(SdrDragObjOwn
); // specific to object
175 { // for bTail, TakeActionRect already does the right thing
177 { // bOwn may be MoveTextFrame, ResizeTextFrame, but may not (any more) be DragTail
182 // drag the whole Object (Move, Resize, ...)
183 const basegfx::B2DPoint
aTransformed(mpCurrentSdrDragMethod
->getCurrentTransformation() * basegfx::B2DPoint(aPt
.X(), aPt
.Y()));
184 rPos
.X() = basegfx::fround(aTransformed
.getX());
185 rPos
.Y() = basegfx::fround(aTransformed
.getY());
194 ////////////////////////////////////////////////////////////////////////////////////////////////////
196 sal_Bool
SdrDragView::TakeDragLimit(SdrDragMode
/*eMode*/, Rectangle
& /*rRect*/) const
201 sal_Bool
SdrDragView::BegDragObj(const Point
& rPnt
, OutputDevice
* pOut
, SdrHdl
* pHdl
, short nMinMov
, SdrDragMethod
* pForcedMeth
)
207 SetDragWithCopy(sal_False
);
208 //TODO: aAni.Reset();
209 mpCurrentSdrDragMethod
=NULL
;
210 bDragSpecial
=sal_False
;
211 bDragLimit
=sal_False
;
212 SdrDragMode eTmpMode
=eDragMode
;
213 if (eTmpMode
==SDRDRAG_MOVE
&& pHdl
!=NULL
&& pHdl
->GetKind()!=HDL_MOVE
) {
214 eTmpMode
=SDRDRAG_RESIZE
;
216 bDragLimit
=TakeDragLimit(eTmpMode
,aDragLimit
);
217 bFramDrag
=ImpIsFrameHandles();
219 (pMarkedObj
==NULL
|| !pMarkedObj
->hasSpecialDrag()) &&
220 (pHdl
==NULL
|| pHdl
->GetObj()==NULL
)) {
226 || pHdl
->GetKind() == HDL_MOVE
227 || pHdl
->GetKind() == HDL_MIRX
228 || pHdl
->GetKind() == HDL_TRNS
229 || pHdl
->GetKind() == HDL_GRAD
)
231 aDragStat
.Reset(aPnt
);
235 aDragStat
.Reset(pHdl
->GetPos());
238 aDragStat
.SetView((SdrView
*)this);
239 aDragStat
.SetPageView(pMarkedPV
); // <<-- DragPV has to go here!!!
240 aDragStat
.SetMinMove(ImpGetMinMovLogic(nMinMov
,pOut
));
241 aDragStat
.SetHdl(pHdl
);
242 aDragStat
.NextPoint();
245 eDragHdl
= pHdl
==NULL
? HDL_MOVE
: pHdl
->GetKind();
246 bDragHdl
=eDragHdl
==HDL_REF1
|| eDragHdl
==HDL_REF2
|| eDragHdl
==HDL_MIRX
;
248 // Expand test for HDL_ANCHOR_TR
249 bool bNotDraggable
= (HDL_ANCHOR
== eDragHdl
|| HDL_ANCHOR_TR
== eDragHdl
);
251 if(pHdl
&& (pHdl
->GetKind() == HDL_SMARTTAG
) && pForcedMeth
)
253 // just use the forced method for smart tags
257 mpCurrentSdrDragMethod
= new SdrDragMovHdl(*this);
259 else if(!bNotDraggable
)
263 case SDRDRAG_ROTATE
: case SDRDRAG_SHEAR
: case SDRDRAG_DISTORT
:
267 case HDL_LEFT
: case HDL_RIGHT
:
268 case HDL_UPPER
: case HDL_LOWER
:
270 // are 3D objects selected?
271 bool b3DObjSelected
= false;
272 for(sal_uInt32 a
=0;!b3DObjSelected
&& a
<GetMarkedObjectCount();a
++)
274 SdrObject
* pObj
= GetMarkedObjectByIndex(a
);
275 if(pObj
&& pObj
->ISA(E3dObject
))
276 b3DObjSelected
= true;
278 // If yes, allow shear even when !IsShearAllowed,
279 // because 3D objects are limited rotations
280 if (!b3DObjSelected
&& !IsShearAllowed())
282 mpCurrentSdrDragMethod
= new SdrDragShear(*this,eDragMode
==SDRDRAG_ROTATE
);
284 case HDL_UPLFT
: case HDL_UPRGT
:
285 case HDL_LWLFT
: case HDL_LWRGT
:
287 if (eDragMode
==SDRDRAG_SHEAR
|| eDragMode
==SDRDRAG_DISTORT
)
289 if (!IsDistortAllowed(sal_True
) && !IsDistortAllowed(sal_False
)) return sal_False
;
290 mpCurrentSdrDragMethod
= new SdrDragDistort(*this);
294 if (!IsRotateAllowed(sal_True
)) return sal_False
;
295 mpCurrentSdrDragMethod
= new SdrDragRotate(*this);
300 if (IsMarkedHitMovesAlways() && eDragHdl
==HDL_MOVE
)
301 { // HDL_MOVE is true, even if Obj is hit directly
302 if (!IsMoveAllowed()) return sal_False
;
303 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
307 if (!IsRotateAllowed(sal_True
)) return sal_False
;
308 mpCurrentSdrDragMethod
= new SdrDragRotate(*this);
315 if (eDragHdl
==HDL_MOVE
&& IsMarkedHitMovesAlways())
317 if (!IsMoveAllowed()) return sal_False
;
318 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
322 if (!IsMirrorAllowed(sal_True
,sal_True
)) return sal_False
;
323 mpCurrentSdrDragMethod
= new SdrDragMirror(*this);
329 if (eDragHdl
==HDL_MOVE
&& IsMarkedHitMovesAlways())
331 if (!IsMoveAllowed())
333 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
337 if (!IsCrookAllowed(sal_True
) && !IsCrookAllowed(sal_False
))
339 mpCurrentSdrDragMethod
= new SdrDragCrop(*this);
344 case SDRDRAG_TRANSPARENCE
:
346 if(eDragHdl
== HDL_MOVE
&& IsMarkedHitMovesAlways())
350 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
354 if(!IsTransparenceAllowed())
357 mpCurrentSdrDragMethod
= new SdrDragGradient(*this, sal_False
);
361 case SDRDRAG_GRADIENT
:
363 if(eDragHdl
== HDL_MOVE
&& IsMarkedHitMovesAlways())
367 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
371 if(!IsGradientAllowed())
374 mpCurrentSdrDragMethod
= new SdrDragGradient(*this);
381 if (eDragHdl
==HDL_MOVE
&& IsMarkedHitMovesAlways())
383 if (!IsMoveAllowed()) return sal_False
;
384 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
388 if (!IsCrookAllowed(sal_True
) && !IsCrookAllowed(sal_False
)) return sal_False
;
389 mpCurrentSdrDragMethod
= new SdrDragCrook(*this);
396 if((eDragHdl
== HDL_MOVE
) && !IsMoveAllowed())
400 else if(eDragHdl
== HDL_GLUE
)
402 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
408 if(eDragHdl
== HDL_MOVE
)
410 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
414 if(!IsResizeAllowed(sal_True
))
419 bool bSingleTextObjMark
= false; // SJ: #i100490#
420 if ( GetMarkedObjectCount() == 1 )
422 pMarkedObj
=GetMarkedObjectByIndex(0);
424 pMarkedObj
->ISA( SdrTextObj
) &&
425 static_cast<SdrTextObj
*>(pMarkedObj
)->IsTextFrame() )
426 bSingleTextObjMark
= true;
428 if ( bSingleTextObjMark
)
429 mpCurrentSdrDragMethod
= new SdrDragObjOwn(*this);
431 mpCurrentSdrDragMethod
= new SdrDragResize(*this);
436 if(HDL_MOVE
== eDragHdl
)
438 const bool bCustomShapeSelected(1 == GetMarkedObjectCount() && GetMarkedObjectByIndex(0)->ISA(SdrObjCustomShape
));
440 if(bCustomShapeSelected
)
442 mpCurrentSdrDragMethod
= new SdrDragMove( *this );
445 else if(HDL_POLY
== eDragHdl
)
447 const bool bConnectorSelected(1 == GetMarkedObjectCount() && GetMarkedObjectByIndex(0)->ISA(SdrEdgeObj
));
449 if(bConnectorSelected
)
452 // fallback to old behaviour for connectors (see
453 // text in task description for more details)
455 else if(!IsMoveAllowed() || !IsResizeAllowed())
458 // do not allow move of polygon points if object is move or size protected
463 if(!mpCurrentSdrDragMethod
)
465 // fallback to DragSpecial if no interaction defined
466 bDragSpecial
= sal_True
;
467 mpCurrentSdrDragMethod
= new SdrDragObjOwn(*this);
474 if (pForcedMeth
!=NULL
)
476 delete mpCurrentSdrDragMethod
;
477 mpCurrentSdrDragMethod
= pForcedMeth
;
479 aDragStat
.SetDragMethod(mpCurrentSdrDragMethod
);
480 if (mpCurrentSdrDragMethod
)
482 bRet
= mpCurrentSdrDragMethod
->BeginSdrDrag();
485 if (pHdl
==NULL
&& IS_TYPE(SdrDragObjOwn
,mpCurrentSdrDragMethod
))
487 // Obj may not Move SpecialDrag, so try with MoveFrameDrag
488 delete mpCurrentSdrDragMethod
;
489 mpCurrentSdrDragMethod
= 0;
490 bDragSpecial
=sal_False
;
492 if (!IsMoveAllowed())
496 mpCurrentSdrDragMethod
= new SdrDragMove(*this);
497 aDragStat
.SetDragMethod(mpCurrentSdrDragMethod
);
498 bRet
= mpCurrentSdrDragMethod
->BeginSdrDrag();
503 delete mpCurrentSdrDragMethod
;
504 mpCurrentSdrDragMethod
= 0;
505 aDragStat
.SetDragMethod(mpCurrentSdrDragMethod
);
513 void SdrDragView::MovDragObj(const Point
& rPnt
)
515 if (mpCurrentSdrDragMethod
)
518 ImpLimitToWorkArea(aPnt
);
519 mpCurrentSdrDragMethod
->MoveSdrDrag(aPnt
); // this call already makes a Hide()/Show combination
523 sal_Bool
SdrDragView::EndDragObj(sal_Bool bCopy
)
527 // #i73341# If inserting GluePoint, do not insist on last points being different
528 if(mpCurrentSdrDragMethod
&& aDragStat
.IsMinMoved() && (IsInsertGluePoint() || aDragStat
.GetNow() != aDragStat
.GetPrev()))
530 sal_uIntPtr nHdlAnzMerk
=0;
532 if (bEliminatePolyPoints
)
534 nHdlAnzMerk
=GetMarkablePointCount();
537 const bool bUndo
= IsUndoEnabled();
538 if (IsInsertGluePoint() && bUndo
)
540 BegUndo(aInsPointUndoStr
);
541 AddUndo(pInsPointUndo
);
544 bRet
= mpCurrentSdrDragMethod
->EndSdrDrag(bCopy
);
546 if( IsInsertGluePoint() && bUndo
)
549 delete mpCurrentSdrDragMethod
;
550 mpCurrentSdrDragMethod
= 0;
552 if (bEliminatePolyPoints
)
554 if (nHdlAnzMerk
!=GetMarkablePointCount())
563 bInsPolyPoint
=sal_False
;
566 BegUndo(aInsPointUndoStr
);
567 AddUndo(pInsPointUndo
);
575 if (!bSomeObjChgdFlag
)
577 // Obj did not broadcast (e. g. Writer FlyFrames)
589 bInsPolyPoint
=sal_False
;
590 SetInsertGluePoint(sal_False
);
595 void SdrDragView::BrkDragObj()
597 if (mpCurrentSdrDragMethod
)
599 mpCurrentSdrDragMethod
->CancelSdrDrag();
601 delete mpCurrentSdrDragMethod
;
602 mpCurrentSdrDragMethod
= 0;
606 pInsPointUndo
->Undo(); // delete inserted point again
607 delete pInsPointUndo
;
610 bInsPolyPoint
=sal_False
;
613 if (IsInsertGluePoint())
615 pInsPointUndo
->Undo(); // delete inserted glue point again
616 delete pInsPointUndo
;
618 SetInsertGluePoint(sal_False
);
626 bool SdrDragView::IsInsObjPointPossible() const
628 return pMarkedObj
!=NULL
&& pMarkedObj
->IsPolyObj();
631 sal_Bool
SdrDragView::ImpBegInsObjPoint(sal_Bool bIdxZwang
, sal_uInt32 nIdx
, const Point
& rPnt
, sal_Bool bNewObj
, OutputDevice
* pOut
)
633 sal_Bool
bRet(sal_False
);
635 if(pMarkedObj
&& pMarkedObj
->ISA(SdrPathObj
))
637 SdrPathObj
* pMarkedPath
= (SdrPathObj
*)pMarkedObj
;
639 pInsPointUndo
= dynamic_cast< SdrUndoGeoObj
* >( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pMarkedObj
) );
640 DBG_ASSERT( pInsPointUndo
, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" );
642 XubString
aStr(ImpGetResStr(STR_DragInsertPoint
));
644 pMarkedObj
->TakeObjNameSingul(aName
);
645 xub_StrLen
nPos(aStr
.SearchAscii("%1"));
647 if(STRING_NOTFOUND
!= nPos
)
650 aStr
.Insert(aName
, nPos
);
653 aInsPointUndoStr
= aStr
;
657 aPt
= GetSnapPos(aPt
,pMarkedPV
);
659 bool bClosed0
= pMarkedPath
->IsClosedObj();
663 mnInsPointNum
= pMarkedPath
->NbcInsPoint(nIdx
, aPt
, bNewObj
, sal_True
);
667 mnInsPointNum
= pMarkedPath
->NbcInsPointOld(aPt
, bNewObj
, sal_True
);
670 if(bClosed0
!= pMarkedPath
->IsClosedObj())
672 // Obj was closed implicitly
674 pMarkedPath
->SetChanged();
675 pMarkedPath
->BroadcastObjectChange();
678 if(0xffffffff != mnInsPointNum
)
680 bInsPolyPoint
= sal_True
;
684 bRet
= BegDragObj(rPnt
, pOut
, aHdl
.GetHdl(mnInsPointNum
), 0);
688 aDragStat
.SetMinMoved();
694 delete pInsPointUndo
;
695 pInsPointUndo
= NULL
;
702 sal_Bool
SdrDragView::EndInsObjPoint(SdrCreateCmd eCmd
)
706 sal_uInt32
nNextPnt(mnInsPointNum
);
707 Point
aPnt(aDragStat
.GetNow());
708 sal_Bool bOk
=EndDragObj(sal_False
);
709 if (bOk
==sal_True
&& eCmd
!=SDRCREATE_FORCEEND
)
711 // Ret=True means: Action is over.
712 bOk
=!(ImpBegInsObjPoint(sal_True
, nNextPnt
, aPnt
, eCmd
== SDRCREATE_NEXTOBJECT
, pDragWin
));
716 } else return sal_False
;
719 sal_Bool
SdrDragView::IsInsGluePointPossible() const
721 sal_Bool bRet
=sal_False
;
722 if (IsInsGluePointMode() && AreObjectsMarked())
724 if (GetMarkedObjectCount()==1)
726 // return sal_False, if only 1 object which is a connector.
727 const SdrObject
* pObj
=GetMarkedObjectByIndex(0);
728 if (!HAS_BASE(SdrEdgeObj
,pObj
))
741 sal_Bool
SdrDragView::BegInsGluePoint(const Point
& rPnt
)
743 sal_Bool bRet
=sal_False
;
746 sal_uIntPtr nMarkNum
;
747 if (PickMarkedObj(rPnt
,pObj
,pPV
,&nMarkNum
,SDRSEARCH_PASS2BOUND
))
750 UnmarkAllGluePoints();
751 pInsPointUndo
= dynamic_cast< SdrUndoGeoObj
* >( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj
) );
752 DBG_ASSERT( pInsPointUndo
, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" );
753 XubString
aStr(ImpGetResStr(STR_DragInsertGluePoint
));
754 XubString aName
; pObj
->TakeObjNameSingul(aName
);
756 aStr
.SearchAndReplaceAscii("%1", aName
);
758 aInsPointUndoStr
=aStr
;
759 SdrGluePointList
* pGPL
=pObj
->ForceGluePointList();
762 sal_uInt16 nGlueIdx
=pGPL
->Insert(SdrGluePoint());
763 SdrGluePoint
& rGP
=(*pGPL
)[nGlueIdx
];
764 sal_uInt16 nGlueId
=rGP
.GetId();
765 rGP
.SetAbsolutePos(rPnt
,*pObj
);
768 if (MarkGluePoint(pObj
,nGlueId
,pPV
))
770 pHdl
=GetGluePointHdl(pObj
,nGlueId
);
772 if (pHdl
!=NULL
&& pHdl
->GetKind()==HDL_GLUE
&& pHdl
->GetObj()==pObj
&& pHdl
->GetObjHdlNum()==nGlueId
)
774 SetInsertGluePoint(sal_True
);
775 bRet
=BegDragObj(rPnt
,NULL
,pHdl
,0);
778 aDragStat
.SetMinMoved();
783 SetInsertGluePoint(sal_False
);
784 delete pInsPointUndo
;
790 OSL_FAIL("BegInsGluePoint(): GluePoint handle not found.");
795 // no glue points possible for this object (e. g. Edge)
796 SetInsertGluePoint(sal_False
);
797 delete pInsPointUndo
;
805 void SdrDragView::ShowDragObj()
807 if(mpCurrentSdrDragMethod
&& !aDragStat
.IsShown())
809 for(sal_uInt32
a(0); a
< PaintWindowCount(); a
++)
811 SdrPaintWindow
* pCandidate
= GetPaintWindow(a
);
812 rtl::Reference
<sdr::overlay::OverlayManager
> xOverlayManager
= pCandidate
->GetOverlayManager();
814 if (xOverlayManager
.is())
816 mpCurrentSdrDragMethod
->CreateOverlayGeometry(*xOverlayManager
);
818 // #i101679# Force changed overlay to be shown
819 xOverlayManager
->flush();
823 aDragStat
.SetShown(sal_True
);
827 void SdrDragView::HideDragObj()
829 if(mpCurrentSdrDragMethod
&& aDragStat
.IsShown())
831 mpCurrentSdrDragMethod
->destroyOverlayGeometry();
832 aDragStat
.SetShown(sal_False
);
836 ////////////////////////////////////////////////////////////////////////////////////////////////////
838 void SdrDragView::SetNoDragXorPolys(sal_Bool bOn
)
840 if (IsNoDragXorPolys()!=bOn
)
842 const bool bDragging(mpCurrentSdrDragMethod
);
843 const bool bShown(bDragging
&& aDragStat
.IsShown());
850 bNoDragXorPolys
= bOn
;
854 // force recreation of drag content
855 mpCurrentSdrDragMethod
->resetSdrDragEntries();
865 void SdrDragView::SetDragStripes(sal_Bool bOn
)
867 if (mpCurrentSdrDragMethod
&& aDragStat
.IsShown())
879 sal_Bool
SdrDragView::IsOrthoDesired() const
881 if(mpCurrentSdrDragMethod
&& (IS_TYPE(SdrDragObjOwn
, mpCurrentSdrDragMethod
) || IS_TYPE(SdrDragResize
, mpCurrentSdrDragMethod
)))
883 return bOrthoDesiredOnMarked
;
889 void SdrDragView::SetMarkHandles()
894 SdrExchangeView::SetMarkHandles();
897 void SdrDragView::SetSolidDragging(bool bOn
)
899 if((bool)mbSolidDragging
!= bOn
)
901 mbSolidDragging
= bOn
;
905 bool SdrDragView::IsSolidDragging() const
907 // allow each user to disable by having a local setting, but using AND for
908 // checking allowance
909 return mbSolidDragging
&& getOptionsDrawinglayer().IsSolidDragCreate();
912 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */