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 <osl/diagnose.h>
22 #include <tools/debug.hxx>
23 #include <svx/svddrgv.hxx>
24 #include <svx/svdview.hxx>
25 #include <svx/svdundo.hxx>
26 #include <svx/svdocapt.hxx>
27 #include <svx/svdpagv.hxx>
28 #include <svx/svdopath.hxx>
29 #include <svx/svdoedge.hxx>
30 #include <svx/strings.hrc>
31 #include <svx/dialmgr.hxx>
32 #include "svddrgm1.hxx"
33 #include <svx/obj3d.hxx>
34 #include <svx/svdoashp.hxx>
35 #include <svx/sdrpaintwindow.hxx>
36 #include <basegfx/matrix/b2dhommatrix.hxx>
37 #include <svtools/optionsdrawinglayer.hxx>
38 #include <svx/sdr/overlay/overlaymanager.hxx>
39 #include <svx/sdrpagewindow.hxx>
40 #include <unotools/configmgr.hxx>
41 #include <comphelper/lok.hxx>
45 SdrDragView::SdrDragView(SdrModel
& rSdrModel
, OutputDevice
* pOut
)
46 : SdrExchangeView(rSdrModel
, pOut
)
48 , mpInsPointUndo(nullptr)
49 , meDragHdl(SdrHdlKind::Move
)
50 , mnDragThresholdPixels(6)
52 , mbMarkedHitMovesAlways(false)
55 , mbDragStripes(false)
56 , mbSolidDragging(utl::ConfigManager::IsFuzzing() || SvtOptionsDrawinglayer::IsSolidDragCreate())
57 , mbResizeAtCenter(false)
58 , mbCrookAtCenter(false)
59 , mbDragWithCopy(false)
60 , mbInsGluePoint(false)
61 , mbInsObjPointMode(false)
62 , mbInsGluePointMode(false)
63 , mbNoDragXorPolys(false)
65 meDragMode
= SdrDragMode::Move
;
68 SdrDragView::~SdrDragView()
72 bool SdrDragView::IsAction() const
74 return (mpCurrentSdrDragMethod
|| SdrExchangeView::IsAction());
77 void SdrDragView::MovAction(const Point
& rPnt
)
79 SdrExchangeView::MovAction(rPnt
);
80 if (mpCurrentSdrDragMethod
)
86 void SdrDragView::EndAction()
88 if (mpCurrentSdrDragMethod
)
92 SdrExchangeView::EndAction();
95 void SdrDragView::BckAction()
97 SdrExchangeView::BckAction();
101 void SdrDragView::BrkAction()
103 SdrExchangeView::BrkAction();
107 void SdrDragView::TakeActionRect(tools::Rectangle
& rRect
) const
109 if (mpCurrentSdrDragMethod
)
111 rRect
=maDragStat
.GetActionRect();
114 SdrPageView
* pPV
= GetSdrPageView();
116 if(pPV
&& pPV
->HasMarkedObjPageView())
118 // #i95646# is this used..?
119 const basegfx::B2DRange
aBoundRange(mpCurrentSdrDragMethod
->getCurrentRange());
120 if (aBoundRange
.isEmpty())
126 rRect
= tools::Rectangle(
127 basegfx::fround(aBoundRange
.getMinX()), basegfx::fround(aBoundRange
.getMinY()),
128 basegfx::fround(aBoundRange
.getMaxX()), basegfx::fround(aBoundRange
.getMaxY()));
134 rRect
=tools::Rectangle(maDragStat
.GetNow(),maDragStat
.GetNow());
139 SdrExchangeView::TakeActionRect(rRect
);
143 bool SdrDragView::TakeDragObjAnchorPos(Point
& rPos
, bool bTR
) const
147 rPos
= bTR
? aR
.TopRight() : aR
.TopLeft();
148 if (GetMarkedObjectCount()==1 && IsDragObj() && // only on single selection
149 !IsDraggingPoints() && !IsDraggingGluePoints() && // not when moving points
150 dynamic_cast<const SdrDragMovHdl
*>( mpCurrentSdrDragMethod
.get() ) == nullptr) // not when moving handles
152 SdrObject
* pObj
=GetMarkedObjectByIndex(0);
153 if (auto pCaptionObj
= dynamic_cast<SdrCaptionObj
*>(pObj
))
155 Point
aPt(pCaptionObj
->GetTailPos());
156 bool bTail
=meDragHdl
==SdrHdlKind::Poly
; // drag tail
157 bool bOwn
=dynamic_cast<const SdrDragObjOwn
*>( mpCurrentSdrDragMethod
.get() ) != nullptr; // specific to object
159 { // for bTail, TakeActionRect already does the right thing
161 { // bOwn may be MoveTextFrame, ResizeTextFrame, but may not (any more) be DragTail
166 // drag the whole Object (Move, Resize, ...)
167 const basegfx::B2DPoint
aTransformed(mpCurrentSdrDragMethod
->getCurrentTransformation() * basegfx::B2DPoint(aPt
.X(), aPt
.Y()));
168 rPos
.setX( basegfx::fround(aTransformed
.getX()) );
169 rPos
.setY( basegfx::fround(aTransformed
.getY()) );
179 bool SdrDragView::TakeDragLimit(SdrDragMode
/*eMode*/, tools::Rectangle
& /*rRect*/) const
184 bool SdrDragView::BegDragObj(const Point
& rPnt
, OutputDevice
* pOut
, SdrHdl
* pHdl
, short nMinMov
, SdrDragMethod
* _pForcedMeth
)
188 // so we don't leak the object on early return
189 std::unique_ptr
<SdrDragMethod
> pForcedMeth(_pForcedMeth
);
193 SetDragWithCopy(false);
194 //TODO: aAni.Reset();
195 mpCurrentSdrDragMethod
=nullptr;
196 SdrDragMode eTmpMode
=meDragMode
;
197 if (eTmpMode
==SdrDragMode::Move
&& pHdl
!=nullptr && pHdl
->GetKind()!=SdrHdlKind::Move
) {
198 eTmpMode
=SdrDragMode::Resize
;
200 mbDragLimit
=TakeDragLimit(eTmpMode
,maDragLimit
);
201 mbFramDrag
=ImpIsFrameHandles();
203 (mpMarkedObj
==nullptr || !mpMarkedObj
->hasSpecialDrag()) &&
204 (pHdl
==nullptr || pHdl
->GetObj()==nullptr)) {
209 basegfx::B2DVector
aGridOffset(0.0, 0.0);
211 // Coordinate maybe affected by GridOffset, so we may need to
212 // adapt to Model-coordinates here
213 if((comphelper::LibreOfficeKit::isActive() && mpMarkedObj
214 && getPossibleGridOffsetForSdrObject(aGridOffset
, GetMarkedObjectByIndex(0), GetSdrPageView()))
215 || (getPossibleGridOffsetForPosition(
217 basegfx::B2DPoint(aPnt
.X(), aPnt
.Y()),
220 aPnt
.AdjustX(basegfx::fround(-aGridOffset
.getX()));
221 aPnt
.AdjustY(basegfx::fround(-aGridOffset
.getY()));
225 || pHdl
->GetKind() == SdrHdlKind::Move
226 || pHdl
->GetKind() == SdrHdlKind::MirrorAxis
227 || pHdl
->GetKind() == SdrHdlKind::Transparence
228 || pHdl
->GetKind() == SdrHdlKind::Gradient
)
230 maDragStat
.Reset(aPnt
);
234 maDragStat
.Reset(pHdl
->GetPos());
237 maDragStat
.SetView(static_cast<SdrView
*>(this));
238 maDragStat
.SetPageView(mpMarkedPV
); // <<-- DragPV has to go here!!!
239 maDragStat
.SetMinMove(ImpGetMinMovLogic(nMinMov
,pOut
));
240 maDragStat
.SetHdl(pHdl
);
241 maDragStat
.NextPoint();
244 meDragHdl
= pHdl
==nullptr ? SdrHdlKind::Move
: pHdl
->GetKind();
245 mbDragHdl
=meDragHdl
==SdrHdlKind::Ref1
|| meDragHdl
==SdrHdlKind::Ref2
|| meDragHdl
==SdrHdlKind::MirrorAxis
;
247 // Expand test for SdrHdlKind::Anchor_TR
248 bool bNotDraggable
= (SdrHdlKind::Anchor
== meDragHdl
|| SdrHdlKind::Anchor_TR
== meDragHdl
);
250 if(pHdl
&& (pHdl
->GetKind() == SdrHdlKind::SmartTag
) && pForcedMeth
)
252 // just use the forced method for smart tags
256 mpCurrentSdrDragMethod
.reset(new SdrDragMovHdl(*this));
258 else if(!bNotDraggable
)
262 case SdrDragMode::Rotate
: case SdrDragMode::Shear
:
266 case SdrHdlKind::Left
: case SdrHdlKind::Right
:
267 case SdrHdlKind::Upper
: case SdrHdlKind::Lower
:
269 // are 3D objects selected?
270 bool b3DObjSelected
= false;
271 for(size_t a
=0; !b3DObjSelected
&& a
<GetMarkedObjectCount(); ++a
)
273 SdrObject
* pObj
= GetMarkedObjectByIndex(a
);
274 if(DynCastE3dObject(pObj
))
275 b3DObjSelected
= true;
277 // If yes, allow shear even when !IsShearAllowed,
278 // because 3D objects are limited rotations
279 if (!b3DObjSelected
&& !IsShearAllowed())
281 mpCurrentSdrDragMethod
.reset(new SdrDragShear(*this,meDragMode
==SdrDragMode::Rotate
));
283 case SdrHdlKind::UpperLeft
: case SdrHdlKind::UpperRight
:
284 case SdrHdlKind::LowerLeft
: case SdrHdlKind::LowerRight
:
286 if (meDragMode
==SdrDragMode::Shear
)
288 if (!IsDistortAllowed(true) && !IsDistortAllowed()) return false;
289 mpCurrentSdrDragMethod
.reset(new SdrDragDistort(*this));
293 if (!IsRotateAllowed(true)) return false;
294 mpCurrentSdrDragMethod
.reset(new SdrDragRotate(*this));
299 if (IsMarkedHitMovesAlways() && meDragHdl
==SdrHdlKind::Move
)
300 { // SdrHdlKind::Move is true, even if Obj is hit directly
301 if (!IsMoveAllowed()) return false;
302 mpCurrentSdrDragMethod
.reset(new SdrDragMove(*this));
306 if (!IsRotateAllowed(true)) return false;
307 mpCurrentSdrDragMethod
.reset(new SdrDragRotate(*this));
312 case SdrDragMode::Mirror
:
314 if (meDragHdl
==SdrHdlKind::Move
&& IsMarkedHitMovesAlways())
316 if (!IsMoveAllowed()) return false;
317 mpCurrentSdrDragMethod
.reset(new SdrDragMove(*this));
321 if (!IsMirrorAllowed(true,true)) return false;
322 mpCurrentSdrDragMethod
.reset(new SdrDragMirror(*this));
326 case SdrDragMode::Crop
:
328 if (meDragHdl
==SdrHdlKind::Move
&& IsMarkedHitMovesAlways())
330 if (!IsMoveAllowed())
332 mpCurrentSdrDragMethod
.reset(new SdrDragMove(*this));
336 if (!IsCropAllowed())
338 mpCurrentSdrDragMethod
.reset(new SdrDragCrop(*this));
343 case SdrDragMode::Transparence
:
345 if(meDragHdl
== SdrHdlKind::Move
&& IsMarkedHitMovesAlways())
349 mpCurrentSdrDragMethod
.reset(new SdrDragMove(*this));
353 if(!IsTransparenceAllowed())
356 mpCurrentSdrDragMethod
.reset(new SdrDragGradient(*this, false));
360 case SdrDragMode::Gradient
:
362 if(meDragHdl
== SdrHdlKind::Move
&& IsMarkedHitMovesAlways())
366 mpCurrentSdrDragMethod
.reset(new SdrDragMove(*this));
370 if(!IsGradientAllowed())
373 mpCurrentSdrDragMethod
.reset(new SdrDragGradient(*this));
378 case SdrDragMode::Crook
:
380 if (meDragHdl
==SdrHdlKind::Move
&& IsMarkedHitMovesAlways())
382 if (!IsMoveAllowed()) return false;
383 mpCurrentSdrDragMethod
.reset( new SdrDragMove(*this) );
387 if (!IsCrookAllowed(true) && !IsCrookAllowed()) return false;
388 mpCurrentSdrDragMethod
.reset( new SdrDragCrook(*this) );
395 if((meDragHdl
== SdrHdlKind::Move
) && !IsMoveAllowed())
399 else if(meDragHdl
== SdrHdlKind::Glue
)
401 mpCurrentSdrDragMethod
.reset( new SdrDragMove(*this) );
407 if(meDragHdl
== SdrHdlKind::Move
)
409 mpCurrentSdrDragMethod
.reset( new SdrDragMove(*this) );
413 if(!IsResizeAllowed(true))
418 bool bSingleTextObjMark
= false; // SJ: #i100490#
419 if ( GetMarkedObjectCount() == 1 )
421 mpMarkedObj
=GetMarkedObjectByIndex(0);
423 DynCastSdrTextObj( mpMarkedObj
) != nullptr &&
424 static_cast<SdrTextObj
*>(mpMarkedObj
)->IsTextFrame() )
425 bSingleTextObjMark
= true;
427 if ( bSingleTextObjMark
)
428 mpCurrentSdrDragMethod
.reset( new SdrDragObjOwn(*this) );
430 mpCurrentSdrDragMethod
.reset( new SdrDragResize(*this) );
435 if(SdrHdlKind::Move
== meDragHdl
)
437 const bool bCustomShapeSelected(1 == GetMarkedObjectCount() && dynamic_cast<const SdrObjCustomShape
*>(GetMarkedObjectByIndex(0)) != nullptr);
439 if(bCustomShapeSelected
)
441 mpCurrentSdrDragMethod
.reset( new SdrDragMove( *this ) );
444 else if(SdrHdlKind::Poly
== meDragHdl
)
446 const bool bConnectorSelected(1 == GetMarkedObjectCount() && dynamic_cast<const SdrEdgeObj
*>(GetMarkedObjectByIndex(0)) != nullptr);
448 if(bConnectorSelected
)
451 // fallback to old behaviour for connectors (see
452 // text in task description for more details)
454 else if(!IsMoveAllowed() || !IsResizeAllowed())
457 // do not allow move of polygon points if object is move or size protected
462 if(!mpCurrentSdrDragMethod
)
464 // fallback to DragSpecial if no interaction defined
465 mpCurrentSdrDragMethod
.reset( new SdrDragObjOwn(*this) );
474 mpCurrentSdrDragMethod
= std::move(pForcedMeth
);
476 maDragStat
.SetDragMethod(mpCurrentSdrDragMethod
.get());
477 if (mpCurrentSdrDragMethod
)
479 bRet
= mpCurrentSdrDragMethod
->BeginSdrDrag();
482 if (pHdl
==nullptr && dynamic_cast< const SdrDragObjOwn
* >(mpCurrentSdrDragMethod
.get()) != nullptr)
484 // Obj may not Move SpecialDrag, so try with MoveFrameDrag
485 mpCurrentSdrDragMethod
.reset();
487 if (!IsMoveAllowed())
491 mpCurrentSdrDragMethod
.reset( new SdrDragMove(*this) );
492 maDragStat
.SetDragMethod(mpCurrentSdrDragMethod
.get());
493 bRet
= mpCurrentSdrDragMethod
->BeginSdrDrag();
498 mpCurrentSdrDragMethod
.reset();
499 maDragStat
.SetDragMethod(mpCurrentSdrDragMethod
.get());
507 void SdrDragView::MovDragObj(const Point
& rPnt
)
509 if (!mpCurrentSdrDragMethod
)
513 basegfx::B2DVector
aGridOffset(0.0, 0.0);
515 // Coordinate maybe affected by GridOffset, so we may need to
516 // adapt to Model-coordinates here
517 if((comphelper::LibreOfficeKit::isActive() && mpMarkedObj
518 && getPossibleGridOffsetForSdrObject(aGridOffset
, GetMarkedObjectByIndex(0), GetSdrPageView()))
519 || (getPossibleGridOffsetForPosition(
521 basegfx::B2DPoint(aPnt
.X(), aPnt
.Y()),
524 aPnt
.AdjustX(basegfx::fround(-aGridOffset
.getX()));
525 aPnt
.AdjustY(basegfx::fround(-aGridOffset
.getY()));
528 ImpLimitToWorkArea(aPnt
);
529 mpCurrentSdrDragMethod
->MoveSdrDrag(aPnt
); // this call already makes a Hide()/Show combination
532 bool SdrDragView::EndDragObj(bool bCopy
)
536 // #i73341# If inserting GluePoint, do not insist on last points being different
537 if(mpCurrentSdrDragMethod
&& maDragStat
.IsMinMoved() && (IsInsertGluePoint() || maDragStat
.GetNow() != maDragStat
.GetPrev()))
539 sal_Int32 nSavedHdlCount
=0;
541 if (bEliminatePolyPoints
)
543 nSavedHdlCount
=GetMarkablePointCount();
546 const bool bUndo
= IsUndoEnabled();
547 if (IsInsertGluePoint() && bUndo
)
549 BegUndo(maInsPointUndoStr
);
550 AddUndo(std::unique_ptr
<SdrUndoAction
>(mpInsPointUndo
));
553 bRet
= mpCurrentSdrDragMethod
->EndSdrDrag(bCopy
);
555 if( IsInsertGluePoint() && bUndo
)
558 mpCurrentSdrDragMethod
.reset();
560 if (bEliminatePolyPoints
)
562 if (nSavedHdlCount
!=GetMarkablePointCount())
570 SetMarkHandles(nullptr);
571 mbInsPolyPoint
=false;
574 BegUndo(maInsPointUndoStr
);
575 AddUndo(std::unique_ptr
<SdrUndoAction
>(mpInsPointUndo
));
580 meDragHdl
=SdrHdlKind::Move
;
583 if (!mbSomeObjChgdFlag
)
585 // Obj did not broadcast (e. g. Writer FlyFrames)
597 mbInsPolyPoint
=false;
598 SetInsertGluePoint(false);
603 void SdrDragView::BrkDragObj()
605 if (!mpCurrentSdrDragMethod
)
608 mpCurrentSdrDragMethod
->CancelSdrDrag();
610 mpCurrentSdrDragMethod
.reset();
614 mpInsPointUndo
->Undo(); // delete inserted point again
615 delete mpInsPointUndo
;
616 mpInsPointUndo
=nullptr;
617 SetMarkHandles(nullptr);
618 mbInsPolyPoint
=false;
621 if (IsInsertGluePoint())
623 mpInsPointUndo
->Undo(); // delete inserted gluepoint again
624 delete mpInsPointUndo
;
625 mpInsPointUndo
=nullptr;
626 SetInsertGluePoint(false);
629 meDragHdl
=SdrHdlKind::Move
;
633 bool SdrDragView::IsInsObjPointPossible() const
635 return mpMarkedObj
!=nullptr && mpMarkedObj
->IsPolyObj();
638 bool SdrDragView::ImpBegInsObjPoint(bool bIdxZwang
, const Point
& rPnt
, bool bNewObj
, OutputDevice
* pOut
)
642 if(auto pMarkedPath
= dynamic_cast<SdrPathObj
*>( mpMarkedObj
))
645 mpInsPointUndo
= dynamic_cast<SdrUndoGeoObj
*>(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*mpMarkedObj
).release());
646 DBG_ASSERT( mpInsPointUndo
, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" );
648 OUString
aStr(SvxResId(STR_DragInsertPoint
));
650 maInsPointUndoStr
= aStr
.replaceFirst("%1", mpMarkedObj
->TakeObjNameSingul() );
655 aPt
= GetSnapPos(aPt
,mpMarkedPV
);
657 bool bClosed0
= pMarkedPath
->IsClosedObj();
659 const sal_uInt32 nInsPointNum
{ bIdxZwang
660 ? pMarkedPath
->NbcInsPoint(aPt
, bNewObj
)
661 : pMarkedPath
->NbcInsPointOld(aPt
, bNewObj
)
664 if(bClosed0
!= pMarkedPath
->IsClosedObj())
666 // Obj was closed implicitly
668 pMarkedPath
->SetChanged();
669 pMarkedPath
->BroadcastObjectChange();
672 if (nInsPointNum
!= SAL_MAX_UINT32
)
674 mbInsPolyPoint
= true;
678 bRet
= BegDragObj(rPnt
, pOut
, maHdlList
.GetHdl(nInsPointNum
), 0);
682 maDragStat
.SetMinMoved();
688 delete mpInsPointUndo
;
689 mpInsPointUndo
= nullptr;
696 bool SdrDragView::EndInsObjPoint(SdrCreateCmd eCmd
)
700 Point
aPnt(maDragStat
.GetNow());
701 bool bOk
=EndDragObj();
702 if (bOk
&& eCmd
!=SdrCreateCmd::ForceEnd
)
704 // Ret=True means: Action is over.
705 bOk
= ! ImpBegInsObjPoint(true, aPnt
, eCmd
== SdrCreateCmd::NextObject
, mpDragWin
);
712 bool SdrDragView::IsInsGluePointPossible() const
715 if (IsInsGluePointMode() && AreObjectsMarked())
717 if (GetMarkedObjectCount()==1)
719 // return sal_False, if only 1 object which is a connector.
720 const SdrObject
* pObj
=GetMarkedObjectByIndex(0);
721 if (dynamic_cast<const SdrEdgeObj
*>(pObj
) == nullptr)
734 bool SdrDragView::BegInsGluePoint(const Point
& rPnt
)
739 if (PickMarkedObj(rPnt
,pObj
,pPV
,SdrSearchOptions::PASS2BOUND
))
742 UnmarkAllGluePoints();
743 mpInsPointUndo
= dynamic_cast<SdrUndoGeoObj
*>(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pObj
).release());
744 DBG_ASSERT( mpInsPointUndo
, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" );
745 OUString
aStr(SvxResId(STR_DragInsertGluePoint
));
747 maInsPointUndoStr
= aStr
.replaceFirst("%1", pObj
->TakeObjNameSingul() );
749 SdrGluePointList
* pGPL
=pObj
->ForceGluePointList();
752 sal_uInt16 nGlueIdx
=pGPL
->Insert(SdrGluePoint());
753 SdrGluePoint
& rGP
=(*pGPL
)[nGlueIdx
];
754 sal_uInt16 nGlueId
=rGP
.GetId();
755 rGP
.SetAbsolutePos(rPnt
,*pObj
);
757 SdrHdl
* pHdl
=nullptr;
758 if (MarkGluePoint(pObj
,nGlueId
,false))
760 pHdl
=GetGluePointHdl(pObj
,nGlueId
);
762 if (pHdl
!=nullptr && pHdl
->GetKind()==SdrHdlKind::Glue
&& pHdl
->GetObj()==pObj
&& pHdl
->GetObjHdlNum()==nGlueId
)
764 SetInsertGluePoint(true);
765 bRet
=BegDragObj(rPnt
,nullptr,pHdl
,0);
768 maDragStat
.SetMinMoved();
773 SetInsertGluePoint(false);
774 delete mpInsPointUndo
;
775 mpInsPointUndo
=nullptr;
780 OSL_FAIL("BegInsGluePoint(): GluePoint handle not found.");
785 // no gluepoints possible for this object (e. g. Edge)
786 SetInsertGluePoint(false);
787 delete mpInsPointUndo
;
788 mpInsPointUndo
=nullptr;
795 void SdrDragView::ShowDragObj()
797 if(!mpCurrentSdrDragMethod
|| maDragStat
.IsShown())
800 // Changed for the GridOffset stuff: No longer iterate over
801 // SdrPaintWindow(s), but now over SdrPageWindow(s), so doing the
802 // same as the SdrHdl visualizations (see ::CreateB2dIAObject) do.
803 // This is needed to get access to an ObjectContact which is needed
804 // to evtl. process that GridOffset in CreateOverlayGeometry
805 SdrPageView
* pPageView(GetSdrPageView());
807 if(nullptr != pPageView
)
809 for(sal_uInt32
a(0); a
< pPageView
->PageWindowCount(); a
++)
811 const SdrPageWindow
& rPageWindow(*pPageView
->GetPageWindow(a
));
812 const SdrPaintWindow
& rPaintWindow(rPageWindow
.GetPaintWindow());
814 if(rPaintWindow
.OutputToWindow())
816 const rtl::Reference
<sdr::overlay::OverlayManager
>& xOverlayManager(
817 rPaintWindow
.GetOverlayManager());
819 if(xOverlayManager
.is())
821 mpCurrentSdrDragMethod
->CreateOverlayGeometry(
823 rPageWindow
.GetObjectContact());
825 // #i101679# Force changed overlay to be shown
826 xOverlayManager
->flush();
832 maDragStat
.SetShown(true);
835 void SdrDragView::HideDragObj()
837 if(mpCurrentSdrDragMethod
&& maDragStat
.IsShown())
839 mpCurrentSdrDragMethod
->destroyOverlayGeometry();
840 maDragStat
.SetShown(false);
845 void SdrDragView::SetNoDragXorPolys(bool bOn
)
847 if (IsNoDragXorPolys()==bOn
)
850 const bool bDragging(mpCurrentSdrDragMethod
);
851 const bool bShown(bDragging
&& maDragStat
.IsShown());
858 mbNoDragXorPolys
= bOn
;
862 // force recreation of drag content
863 mpCurrentSdrDragMethod
->resetSdrDragEntries();
872 void SdrDragView::SetDragStripes(bool bOn
)
874 if (mpCurrentSdrDragMethod
&& maDragStat
.IsShown())
886 bool SdrDragView::IsOrthoDesired() const
888 if( dynamic_cast< const SdrDragObjOwn
* >( mpCurrentSdrDragMethod
.get() )
889 || dynamic_cast< const SdrDragResize
* >(mpCurrentSdrDragMethod
.get() ))
891 return m_bOrthoDesiredOnMarked
;
897 void SdrDragView::SetMarkHandles(SfxViewShell
* pOtherShell
)
902 SdrExchangeView::SetMarkHandles(pOtherShell
);
905 void SdrDragView::SetSolidDragging(bool bOn
)
907 if(mbSolidDragging
!= bOn
)
909 mbSolidDragging
= bOn
;
913 bool SdrDragView::IsSolidDragging() const
915 // allow each user to disable by having a local setting, but using AND for
916 // checking allowance
917 return mbSolidDragging
&& SvtOptionsDrawinglayer::IsSolidDragCreate();
920 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */