LibreOffice Module svx (master) 1
svddrgv.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20
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>
39#include <svx/sdrpagewindow.hxx>
41#include <comphelper/lok.hxx>
42
43using namespace sdr;
44
46 : SdrExchangeView(rSdrModel, pOut)
47 , mpDragHdl(nullptr)
48 , mpInsPointUndo(nullptr)
49 , meDragHdl(SdrHdlKind::Move)
50 , mnDragThresholdPixels(6)
51 , mbFramDrag(false)
52 , mbMarkedHitMovesAlways(false)
53 , mbDragLimit(false)
54 , mbDragHdl(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)
64{
66}
67
69{
70}
71
73{
75}
76
78{
81 {
82 MovDragObj(rPnt);
83 }
84}
85
87{
89 {
90 EndDragObj();
91 }
93}
94
96{
98 BrkDragObj();
99}
100
102{
104 BrkDragObj();
105}
106
108{
110 {
112 if (rRect.IsEmpty())
113 {
115
116 if(pPV&& pPV->HasMarkedObjPageView())
117 {
118 // #i95646# is this used..?
119 const basegfx::B2DRange aBoundRange(mpCurrentSdrDragMethod->getCurrentRange());
120 if (aBoundRange.isEmpty())
121 {
122 rRect.SetEmpty();
123 }
124 else
125 {
126 rRect = tools::Rectangle(
127 basegfx::fround(aBoundRange.getMinX()), basegfx::fround(aBoundRange.getMinY()),
128 basegfx::fround(aBoundRange.getMaxX()), basegfx::fround(aBoundRange.getMaxY()));
129 }
130 }
131 }
132 if (rRect.IsEmpty())
133 {
135 }
136 }
137 else
138 {
140 }
141}
142
143bool SdrDragView::TakeDragObjAnchorPos(Point& rPos, bool bTR ) const
144{
146 TakeActionRect(aR);
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
151 {
153 if (auto pCaptionObj = dynamic_cast<SdrCaptionObj*>(pObj))
154 {
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
158 if (!bTail)
159 { // for bTail, TakeActionRect already does the right thing
160 if (bOwn)
161 { // bOwn may be MoveTextFrame, ResizeTextFrame, but may not (any more) be DragTail
162 rPos=aPt;
163 }
164 else
165 {
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()) );
170 }
171 }
172 }
173 return true;
174 }
175 return false;
176}
177
178
180{
181 return false;
182}
183
184bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl, short nMinMov, SdrDragMethod* _pForcedMeth)
185{
186 BrkAction();
187
188 // so we don't leak the object on early return
189 std::unique_ptr<SdrDragMethod> pForcedMeth(_pForcedMeth);
190
191 bool bRet=false;
192 {
193 SetDragWithCopy(false);
194 //TODO: aAni.Reset();
196 SdrDragMode eTmpMode=meDragMode;
197 if (eTmpMode==SdrDragMode::Move && pHdl!=nullptr && pHdl->GetKind()!=SdrHdlKind::Move) {
198 eTmpMode=SdrDragMode::Resize;
199 }
202 if (!mbFramDrag &&
203 (mpMarkedObj==nullptr || !mpMarkedObj->hasSpecialDrag()) &&
204 (pHdl==nullptr || pHdl->GetObj()==nullptr)) {
205 mbFramDrag=true;
206 }
207
208 Point aPnt(rPnt);
209 basegfx::B2DVector aGridOffset(0.0, 0.0);
210
211 // Coordinate maybe affected by GridOffset, so we may need to
212 // adapt to Model-coordinates here
216 aGridOffset,
217 basegfx::B2DPoint(aPnt.X(), aPnt.Y()),
218 GetSdrPageView())))
219 {
220 aPnt.AdjustX(basegfx::fround(-aGridOffset.getX()));
221 aPnt.AdjustY(basegfx::fround(-aGridOffset.getY()));
222 }
223
224 if(pHdl == nullptr
225 || pHdl->GetKind() == SdrHdlKind::Move
226 || pHdl->GetKind() == SdrHdlKind::MirrorAxis
228 || pHdl->GetKind() == SdrHdlKind::Gradient)
229 {
230 maDragStat.Reset(aPnt);
231 }
232 else
233 {
234 maDragStat.Reset(pHdl->GetPos());
235 }
236
237 maDragStat.SetView(static_cast<SdrView*>(this));
238 maDragStat.SetPageView(mpMarkedPV); // <<-- DragPV has to go here!!!
240 maDragStat.SetHdl(pHdl);
243 mpDragHdl=pHdl;
244 meDragHdl= pHdl==nullptr ? SdrHdlKind::Move : pHdl->GetKind();
246
247 // Expand test for SdrHdlKind::Anchor_TR
248 bool bNotDraggable = (SdrHdlKind::Anchor == meDragHdl || SdrHdlKind::Anchor_TR == meDragHdl);
249
250 if(pHdl && (pHdl->GetKind() == SdrHdlKind::SmartTag) && pForcedMeth )
251 {
252 // just use the forced method for smart tags
253 }
254 else if(mbDragHdl)
255 {
256 mpCurrentSdrDragMethod.reset(new SdrDragMovHdl(*this));
257 }
258 else if(!bNotDraggable)
259 {
260 switch (meDragMode)
261 {
263 {
264 switch (meDragHdl)
265 {
268 {
269 // are 3D objects selected?
270 bool b3DObjSelected = false;
271 for(size_t a=0; !b3DObjSelected && a<GetMarkedObjectCount(); ++a)
272 {
274 if(DynCastE3dObject(pObj))
275 b3DObjSelected = true;
276 }
277 // If yes, allow shear even when !IsShearAllowed,
278 // because 3D objects are limited rotations
279 if (!b3DObjSelected && !IsShearAllowed())
280 return false;
282 } break;
285 {
287 {
288 if (!IsDistortAllowed(true) && !IsDistortAllowed()) return false;
289 mpCurrentSdrDragMethod.reset(new SdrDragDistort(*this));
290 }
291 else
292 {
293 if (!IsRotateAllowed(true)) return false;
294 mpCurrentSdrDragMethod.reset(new SdrDragRotate(*this));
295 }
296 } break;
297 default:
298 {
300 { // SdrHdlKind::Move is true, even if Obj is hit directly
301 if (!IsMoveAllowed()) return false;
302 mpCurrentSdrDragMethod.reset(new SdrDragMove(*this));
303 }
304 else
305 {
306 if (!IsRotateAllowed(true)) return false;
307 mpCurrentSdrDragMethod.reset(new SdrDragRotate(*this));
308 }
309 }
310 }
311 } break;
313 {
315 {
316 if (!IsMoveAllowed()) return false;
317 mpCurrentSdrDragMethod.reset(new SdrDragMove(*this));
318 }
319 else
320 {
321 if (!IsMirrorAllowed(true,true)) return false;
322 mpCurrentSdrDragMethod.reset(new SdrDragMirror(*this));
323 }
324 } break;
325
327 {
329 {
330 if (!IsMoveAllowed())
331 return false;
332 mpCurrentSdrDragMethod.reset(new SdrDragMove(*this));
333 }
334 else
335 {
336 if (!IsCropAllowed())
337 return false;
338 mpCurrentSdrDragMethod.reset(new SdrDragCrop(*this));
339 }
340 }
341 break;
342
344 {
346 {
347 if(!IsMoveAllowed())
348 return false;
349 mpCurrentSdrDragMethod.reset(new SdrDragMove(*this));
350 }
351 else
352 {
354 return false;
355
356 mpCurrentSdrDragMethod.reset(new SdrDragGradient(*this, false));
357 }
358 break;
359 }
361 {
363 {
364 if(!IsMoveAllowed())
365 return false;
366 mpCurrentSdrDragMethod.reset(new SdrDragMove(*this));
367 }
368 else
369 {
370 if(!IsGradientAllowed())
371 return false;
372
373 mpCurrentSdrDragMethod.reset(new SdrDragGradient(*this));
374 }
375 break;
376 }
377
378 case SdrDragMode::Crook :
379 {
381 {
382 if (!IsMoveAllowed()) return false;
383 mpCurrentSdrDragMethod.reset( new SdrDragMove(*this) );
384 }
385 else
386 {
387 if (!IsCrookAllowed(true) && !IsCrookAllowed()) return false;
388 mpCurrentSdrDragMethod.reset( new SdrDragCrook(*this) );
389 }
390 } break;
391
392 default:
393 {
394 // SdrDragMode::Move
396 {
397 return false;
398 }
399 else if(meDragHdl == SdrHdlKind::Glue)
400 {
401 mpCurrentSdrDragMethod.reset( new SdrDragMove(*this) );
402 }
403 else
404 {
405 if(mbFramDrag)
406 {
408 {
409 mpCurrentSdrDragMethod.reset( new SdrDragMove(*this) );
410 }
411 else
412 {
413 if(!IsResizeAllowed(true))
414 {
415 return false;
416 }
417
418 bool bSingleTextObjMark = false; // SJ: #i100490#
419 if ( GetMarkedObjectCount() == 1 )
420 {
422 if ( mpMarkedObj &&
423 DynCastSdrTextObj( mpMarkedObj) != nullptr &&
424 static_cast<SdrTextObj*>(mpMarkedObj)->IsTextFrame() )
425 bSingleTextObjMark = true;
426 }
427 if ( bSingleTextObjMark )
428 mpCurrentSdrDragMethod.reset( new SdrDragObjOwn(*this) );
429 else
430 mpCurrentSdrDragMethod.reset( new SdrDragResize(*this) );
431 }
432 }
433 else
434 {
436 {
437 const bool bCustomShapeSelected(1 == GetMarkedObjectCount() && dynamic_cast<const SdrObjCustomShape*>(GetMarkedObjectByIndex(0)) != nullptr);
438
439 if(bCustomShapeSelected)
440 {
441 mpCurrentSdrDragMethod.reset( new SdrDragMove( *this ) );
442 }
443 }
444 else if(SdrHdlKind::Poly == meDragHdl)
445 {
446 const bool bConnectorSelected(1 == GetMarkedObjectCount() && dynamic_cast<const SdrEdgeObj*>(GetMarkedObjectByIndex(0)) != nullptr);
447
448 if(bConnectorSelected)
449 {
450 // #i97784#
451 // fallback to old behaviour for connectors (see
452 // text in task description for more details)
453 }
454 else if(!IsMoveAllowed() || !IsResizeAllowed())
455 {
456 // #i77187#
457 // do not allow move of polygon points if object is move or size protected
458 return false;
459 }
460 }
461
463 {
464 // fallback to DragSpecial if no interaction defined
465 mpCurrentSdrDragMethod.reset( new SdrDragObjOwn(*this) );
466 }
467 }
468 }
469 }
470 }
471 }
472 if (pForcedMeth)
473 {
474 mpCurrentSdrDragMethod = std::move(pForcedMeth);
475 }
478 {
479 bRet = mpCurrentSdrDragMethod->BeginSdrDrag();
480 if (!bRet)
481 {
482 if (pHdl==nullptr && dynamic_cast< const SdrDragObjOwn* >(mpCurrentSdrDragMethod.get()) != nullptr)
483 {
484 // Obj may not Move SpecialDrag, so try with MoveFrameDrag
486
487 if (!IsMoveAllowed())
488 return false;
489
490 mbFramDrag=true;
491 mpCurrentSdrDragMethod.reset( new SdrDragMove(*this) );
493 bRet = mpCurrentSdrDragMethod->BeginSdrDrag();
494 }
495 }
496 if (!bRet)
497 {
500 }
501 }
502 }
503
504 return bRet;
505}
506
508{
510 return;
511
512 Point aPnt(rPnt);
513 basegfx::B2DVector aGridOffset(0.0, 0.0);
514
515 // Coordinate maybe affected by GridOffset, so we may need to
516 // adapt to Model-coordinates here
520 aGridOffset,
521 basegfx::B2DPoint(aPnt.X(), aPnt.Y()),
522 GetSdrPageView())))
523 {
524 aPnt.AdjustX(basegfx::fround(-aGridOffset.getX()));
525 aPnt.AdjustY(basegfx::fround(-aGridOffset.getY()));
526 }
527
528 ImpLimitToWorkArea(aPnt);
529 mpCurrentSdrDragMethod->MoveSdrDrag(aPnt); // this call already makes a Hide()/Show combination
530}
531
533{
534 bool bRet(false);
535
536 // #i73341# If inserting GluePoint, do not insist on last points being different
538 {
539 sal_Int32 nSavedHdlCount=0;
540
542 {
543 nSavedHdlCount=GetMarkablePointCount();
544 }
545
546 const bool bUndo = IsUndoEnabled();
547 if (IsInsertGluePoint() && bUndo)
548 {
550 AddUndo(std::unique_ptr<SdrUndoAction>(mpInsPointUndo));
551 }
552
553 bRet = mpCurrentSdrDragMethod->EndSdrDrag(bCopy);
554
555 if( IsInsertGluePoint() && bUndo)
556 EndUndo();
557
559
561 {
562 if (nSavedHdlCount!=GetMarkablePointCount())
563 {
565 }
566 }
567
568 if (mbInsPolyPoint)
569 {
570 SetMarkHandles(nullptr);
571 mbInsPolyPoint=false;
572 if( bUndo )
573 {
575 AddUndo(std::unique_ptr<SdrUndoAction>(mpInsPointUndo));
576 EndUndo();
577 }
578 }
579
581 mpDragHdl=nullptr;
582
584 {
585 // Obj did not broadcast (e. g. Writer FlyFrames)
586 if(!mbDragHdl)
587 {
589 }
590 }
591 }
592 else
593 {
594 BrkDragObj();
595 }
596
597 mbInsPolyPoint=false;
598 SetInsertGluePoint(false);
599
600 return bRet;
601}
602
604{
606 return;
607
608 mpCurrentSdrDragMethod->CancelSdrDrag();
609
611
612 if (mbInsPolyPoint)
613 {
614 mpInsPointUndo->Undo(); // delete inserted point again
615 delete mpInsPointUndo;
616 mpInsPointUndo=nullptr;
617 SetMarkHandles(nullptr);
618 mbInsPolyPoint=false;
619 }
620
621 if (IsInsertGluePoint())
622 {
623 mpInsPointUndo->Undo(); // delete inserted gluepoint again
624 delete mpInsPointUndo;
625 mpInsPointUndo=nullptr;
626 SetInsertGluePoint(false);
627 }
628
630 mpDragHdl=nullptr;
631}
632
634{
635 return mpMarkedObj!=nullptr && mpMarkedObj->IsPolyObj();
636}
637
638bool SdrDragView::ImpBegInsObjPoint(bool bIdxZwang, const Point& rPnt, bool bNewObj, OutputDevice* pOut)
639{
640 bool bRet(false);
641
642 if(auto pMarkedPath = dynamic_cast<SdrPathObj*>( mpMarkedObj))
643 {
644 BrkAction();
645 mpInsPointUndo = dynamic_cast<SdrUndoGeoObj*>(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*mpMarkedObj).release());
646 DBG_ASSERT( mpInsPointUndo, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" );
647
648 OUString aStr(SvxResId(STR_DragInsertPoint));
649
650 maInsPointUndoStr = aStr.replaceFirst("%1", mpMarkedObj->TakeObjNameSingul() );
651
652 Point aPt(rPnt);
653
654 if(bNewObj)
655 aPt = GetSnapPos(aPt,mpMarkedPV);
656
657 bool bClosed0 = pMarkedPath->IsClosedObj();
658
659 const sal_uInt32 nInsPointNum { bIdxZwang
660 ? pMarkedPath->NbcInsPoint(aPt, bNewObj)
661 : pMarkedPath->NbcInsPointOld(aPt, bNewObj)
662 };
663
664 if(bClosed0 != pMarkedPath->IsClosedObj())
665 {
666 // Obj was closed implicitly
667 // object changed
668 pMarkedPath->SetChanged();
669 pMarkedPath->BroadcastObjectChange();
670 }
671
672 if (nInsPointNum != SAL_MAX_UINT32)
673 {
674 mbInsPolyPoint = true;
677
678 bRet = BegDragObj(rPnt, pOut, maHdlList.GetHdl(nInsPointNum), 0);
679
680 if (bRet)
681 {
683 MovDragObj(rPnt);
684 }
685 }
686 else
687 {
688 delete mpInsPointUndo;
689 mpInsPointUndo = nullptr;
690 }
691 }
692
693 return bRet;
694}
695
697{
698 if(IsInsObjPoint())
699 {
700 Point aPnt(maDragStat.GetNow());
701 bool bOk=EndDragObj();
702 if (bOk && eCmd!=SdrCreateCmd::ForceEnd)
703 {
704 // Ret=True means: Action is over.
705 bOk = ! ImpBegInsObjPoint(true, aPnt, eCmd == SdrCreateCmd::NextObject, mpDragWin);
706 }
707
708 return bOk;
709 } else return false;
710}
711
713{
714 bool bRet=false;
716 {
717 if (GetMarkedObjectCount()==1)
718 {
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)
722 {
723 bRet=true;
724 }
725 }
726 else
727 {
728 bRet=true;
729 }
730 }
731 return bRet;
732}
733
735{
736 bool bRet=false;
737 SdrObject* pObj;
738 SdrPageView* pPV;
740 {
741 BrkAction();
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));
746
747 maInsPointUndoStr = aStr.replaceFirst("%1", pObj->TakeObjNameSingul() );
748
750 if (pGPL!=nullptr)
751 {
752 sal_uInt16 nGlueIdx=pGPL->Insert(SdrGluePoint());
753 SdrGluePoint& rGP=(*pGPL)[nGlueIdx];
754 sal_uInt16 nGlueId=rGP.GetId();
755 rGP.SetAbsolutePos(rPnt,*pObj);
756
757 SdrHdl* pHdl=nullptr;
758 if (MarkGluePoint(pObj,nGlueId,false))
759 {
760 pHdl=GetGluePointHdl(pObj,nGlueId);
761 }
762 if (pHdl!=nullptr && pHdl->GetKind()==SdrHdlKind::Glue && pHdl->GetObj()==pObj && pHdl->GetObjHdlNum()==nGlueId)
763 {
764 SetInsertGluePoint(true);
765 bRet=BegDragObj(rPnt,nullptr,pHdl,0);
766 if (bRet)
767 {
769 MovDragObj(rPnt);
770 }
771 else
772 {
773 SetInsertGluePoint(false);
774 delete mpInsPointUndo;
775 mpInsPointUndo=nullptr;
776 }
777 }
778 else
779 {
780 OSL_FAIL("BegInsGluePoint(): GluePoint handle not found.");
781 }
782 }
783 else
784 {
785 // no gluepoints possible for this object (e. g. Edge)
786 SetInsertGluePoint(false);
787 delete mpInsPointUndo;
788 mpInsPointUndo=nullptr;
789 }
790 }
791
792 return bRet;
793}
794
796{
798 return;
799
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());
806
807 if(nullptr != pPageView)
808 {
809 for(sal_uInt32 a(0); a < pPageView->PageWindowCount(); a++)
810 {
811 const SdrPageWindow& rPageWindow(*pPageView->GetPageWindow(a));
812 const SdrPaintWindow& rPaintWindow(rPageWindow.GetPaintWindow());
813
814 if(rPaintWindow.OutputToWindow())
815 {
817 rPaintWindow.GetOverlayManager());
818
819 if(xOverlayManager.is())
820 {
821 mpCurrentSdrDragMethod->CreateOverlayGeometry(
822 *xOverlayManager,
823 rPageWindow.GetObjectContact());
824
825 // #i101679# Force changed overlay to be shown
826 xOverlayManager->flush();
827 }
828 }
829 }
830 }
831
832 maDragStat.SetShown(true);
833}
834
836{
838 {
839 mpCurrentSdrDragMethod->destroyOverlayGeometry();
840 maDragStat.SetShown(false);
841 }
842}
843
844
846{
847 if (IsNoDragXorPolys()==bOn)
848 return;
849
850 const bool bDragging(mpCurrentSdrDragMethod);
851 const bool bShown(bDragging && maDragStat.IsShown());
852
853 if(bShown)
854 {
855 HideDragObj();
856 }
857
858 mbNoDragXorPolys = bOn;
859
860 if(bDragging)
861 {
862 // force recreation of drag content
863 mpCurrentSdrDragMethod->resetSdrDragEntries();
864 }
865
866 if(bShown)
867 {
868 ShowDragObj();
869 }
870}
871
873{
875 {
876 HideDragObj();
877 mbDragStripes=bOn;
878 ShowDragObj();
879 }
880 else
881 {
882 mbDragStripes=bOn;
883 }
884}
885
887{
888 if( dynamic_cast< const SdrDragObjOwn* >( mpCurrentSdrDragMethod.get() )
889 || dynamic_cast< const SdrDragResize* >(mpCurrentSdrDragMethod.get() ))
890 {
892 }
893
894 return false;
895}
896
898{
899 if( mpDragHdl )
900 mpDragHdl = nullptr;
901
903}
904
906{
907 if(mbSolidDragging != bOn)
908 {
909 mbSolidDragging = bOn;
910 }
911}
912
914{
915 // allow each user to disable by having a local setting, but using AND for
916 // checking allowance
918}
919
920/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
void SetView(SdrView *pV)
Definition: svddrag.hxx:97
void SetDragMethod(SdrDragMethod *pMth)
Definition: svddrag.hxx:164
bool IsMinMoved() const
Definition: svddrag.hxx:118
void SetMinMoved()
Definition: svddrag.hxx:119
void SetPageView(SdrPageView *pPV)
Definition: svddrag.hxx:99
void Reset()
Definition: svddrag.cxx:36
const Point & GetNow() const
Definition: svddrag.hxx:105
void SetHdl(SdrHdl *pH)
Definition: svddrag.hxx:112
const tools::Rectangle & GetActionRect() const
Definition: svddrag.hxx:166
const Point & GetPrev() const
Definition: svddrag.hxx:103
void NextPoint()
Definition: svddrag.cxx:73
void SetShown(bool bOn)
Definition: svddrag.hxx:116
bool IsShown() const
Definition: svddrag.hxx:115
void SetMinMove(sal_uInt16 nDist)
Definition: svddrag.hxx:121
bool EndDragObj(bool bCopy=false)
Definition: svddrgv.cxx:532
SdrDragView(SdrModel &rSdrModel, OutputDevice *pOut)
Definition: svddrgv.cxx:45
virtual void EndAction() override
Definition: svddrgv.cxx:86
bool mbDragLimit
Definition: svddrgv.hxx:51
void SetDragStripes(bool bOn)
Definition: svddrgv.cxx:872
OUString maInsPointUndoStr
Definition: svddrgv.hxx:45
void SetNoDragXorPolys(bool bOn)
Definition: svddrgv.cxx:845
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr)
Definition: svddrgv.cxx:184
bool mbFramDrag
Definition: svddrgv.hxx:49
SdrUndoGeoObj * mpInsPointUndo
Definition: svddrgv.hxx:43
void BrkDragObj()
Definition: svddrgv.cxx:603
bool IsOrthoDesired() const
Definition: svddrgv.cxx:886
bool IsSolidDragging() const
Definition: svddrgv.cxx:913
bool IsNoDragXorPolys() const
Definition: svddrgv.hxx:156
bool IsInsGluePointMode() const
Definition: svddrgv.hxx:141
bool BegInsGluePoint(const Point &rPnt)
Definition: svddrgv.cxx:734
bool IsInsObjPointPossible() const
Definition: svddrgv.cxx:633
virtual void MovAction(const Point &rPnt) override
Definition: svddrgv.cxx:77
void SetDragWithCopy(bool bOn)
Definition: svddrgv.hxx:113
virtual void BckAction() override
Definition: svddrgv.cxx:95
bool TakeDragObjAnchorPos(Point &rPos, bool bTopRight) const
Definition: svddrgv.cxx:143
SdrHdl * mpDragHdl
Definition: svddrgv.hxx:41
bool mbSolidDragging
Definition: svddrgv.hxx:54
bool IsInsertGluePoint() const
Definition: svddrgv.hxx:120
SdrHdlKind meDragHdl
Definition: svddrgv.hxx:46
bool IsDraggingGluePoints() const
Definition: svddrgv.hxx:108
tools::Rectangle maDragLimit
Definition: svddrgv.hxx:44
bool mbNoDragXorPolys
Definition: svddrgv.hxx:61
virtual bool IsAction() const override
Definition: svddrgv.cxx:72
void ShowDragObj()
Definition: svddrgv.cxx:795
virtual void BrkAction() override
Definition: svddrgv.cxx:101
virtual void TakeActionRect(tools::Rectangle &rRect) const override
Definition: svddrgv.cxx:107
bool IsInsObjPoint() const
Definition: svddrgv.hxx:127
bool mbDragHdl
Definition: svddrgv.hxx:52
void SetSolidDragging(bool bOn)
Definition: svddrgv.cxx:905
bool IsInsGluePointPossible() const
Definition: svddrgv.cxx:712
virtual bool TakeDragLimit(SdrDragMode eMode, tools::Rectangle &rRect) const
Definition: svddrgv.cxx:179
bool mbDragStripes
Definition: svddrgv.hxx:53
virtual void SetMarkHandles(SfxViewShell *pOtherShell) override
Definition: svddrgv.cxx:897
void MovDragObj(const Point &rPnt)
Definition: svddrgv.cxx:507
bool ImpBegInsObjPoint(bool bIdxZwang, const Point &rPnt, bool bNewObj, OutputDevice *pOut)
Definition: svddrgv.cxx:638
void HideDragObj()
Definition: svddrgv.cxx:835
bool IsMarkedHitMovesAlways() const
Definition: svddrgv.hxx:187
bool EndInsObjPoint(SdrCreateCmd eCmd)
Definition: svddrgv.cxx:696
void SetInsertGluePoint(bool bOn)
Definition: svddrgv.hxx:119
bool IsDraggingPoints() const
Definition: svddrgv.hxx:107
bool IsDragObj() const
Definition: svddrgv.hxx:104
std::unique_ptr< SdrDragMethod > mpCurrentSdrDragMethod
Definition: svddrgv.hxx:42
virtual ~SdrDragView() override
Definition: svddrgv.cxx:68
Utility class SdrEdgeObj.
Definition: svdoedge.hxx:130
bool IsResizeAllowed(bool bProp=false) const
Definition: svdedtv.cxx:383
bool IsUndoEnabled() const
Definition: svdedtv.cxx:1056
bool IsMoveAllowed() const
Definition: svdedtv.hxx:258
bool IsTransparenceAllowed() const
Definition: svdedtv.cxx:408
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdedtv.hxx:196
void BegUndo()
Definition: svdedtv.hxx:178
bool IsDistortAllowed(bool bNoContortion=false) const
Definition: svdedtv.cxx:451
bool IsCrookAllowed(bool bNoContortion=false) const
Definition: svdedtv.cxx:439
bool IsGradientAllowed() const
Definition: svdedtv.cxx:420
bool IsCropAllowed() const
Definition: svdedtv.cxx:414
friend class SdrDragDistort
Definition: svdedtv.hxx:74
bool IsShearAllowed() const
Definition: svdedtv.cxx:426
bool m_bOrthoDesiredOnMarked
Definition: svdedtv.hxx:93
bool IsRotateAllowed(bool b90Deg=false) const
Definition: svdedtv.cxx:391
bool IsMirrorAllowed(bool b45Deg=false, bool b90Deg=false) const
Definition: svdedtv.cxx:399
void EndUndo()
Definition: svdedtv.cxx:295
friend class SdrDragCrook
Definition: svdedtv.hxx:75
bool ImpLimitToWorkArea(Point &rPt) const
Definition: svdxcgv.cxx:65
sal_uInt16 Insert(const SdrGluePoint &rGP)
Definition: svdglue.cxx:295
sal_uInt16 GetId() const
Definition: svdglue.hxx:112
void SetAbsolutePos(const Point &rNewPos, const SdrObject &rObj)
Definition: svdglue.cxx:89
SdrHdl * GetHdl(size_t nNum) const
Definition: svdhdl.hxx:460
SdrHdlKind GetKind() const
Definition: svdhdl.hxx:194
sal_uInt32 GetObjHdlNum() const
Definition: svdhdl.hxx:216
SdrObject * GetObj() const
Definition: svdhdl.hxx:203
const Point & GetPos() const
Definition: svdhdl.hxx:197
virtual sal_Int32 GetMarkablePointCount() const
Definition: svdmrkv1.cxx:46
bool mbInsPolyPoint
Definition: svdmrkv.hxx:125
virtual void SetMarkHandles(SfxViewShell *pOtherShell)
Definition: svdmrkv.cxx:1170
SdrPageView * mpMarkedPV
Definition: svdmrkv.hxx:103
bool ImpIsFrameHandles() const
Definition: svdmrkv.cxx:602
bool AreObjectsMarked() const
Definition: svdmrkv.hxx:266
SdrObject * GetMarkedObjectByIndex(size_t nNum) const
Definition: svdmrkv.hxx:263
SdrHdlList maHdlList
Definition: svdmrkv.hxx:107
size_t GetMarkedObjectCount() const
Definition: svdmrkv.hxx:264
SdrDragMode meDragMode
Definition: svdmrkv.hxx:118
SdrHdl * GetGluePointHdl(const SdrObject *pObj, sal_uInt16 nId) const
Definition: svdmrkv1.cxx:521
SdrObject * mpMarkedObj
Definition: svdmrkv.hxx:102
bool UnmarkAllPoints()
Definition: svdmrkv.hxx:348
bool getPossibleGridOffsetForPosition(basegfx::B2DVector &rOffset, const basegfx::B2DPoint &rPoint, const SdrPageView *pPV) const
Definition: svdmrkv.cxx:2266
bool getPossibleGridOffsetForSdrObject(basegfx::B2DVector &rOffset, const SdrObject *pObj, const SdrPageView *pPV) const
Definition: svdmrkv.cxx:2227
bool UnmarkAllGluePoints()
Definition: svdmrkv.hxx:398
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
Definition: svdmrkv.cxx:2614
bool PickMarkedObj(const Point &rPnt, SdrObject *&rpObj, SdrPageView *&rpPV, SdrSearchOptions nOptions) const
Definition: svdmrkv.cxx:2527
bool MarkGluePoint(const SdrObject *pObj, sal_uInt16 nId, bool bUnmark)
Definition: svdmrkv1.cxx:478
SdrUndoFactory & GetSdrUndoFactory() const
returns the models undo factory.
Definition: svdmodel.cxx:1915
virtual void BrkAction() override
Definition: svdedxv.cxx:125
virtual void MovAction(const Point &rPnt) override
Definition: svdedxv.cxx:105
virtual bool IsAction() const override
Definition: svdedxv.cxx:103
virtual void EndAction() override
Definition: svdedxv.cxx:112
virtual void TakeActionRect(tools::Rectangle &rRect) const override
Definition: svdedxv.cxx:208
virtual void BckAction() override
Definition: svdedxv.cxx:119
Abstract DrawObject.
Definition: svdobj.hxx:260
virtual SdrGluePointList * ForceGluePointList()
Definition: svdobj.cxx:2319
virtual bool IsPolyObj() const
Definition: svdobj.cxx:1725
virtual OUString TakeObjNameSingul() const
Definition: svdobj.cxx:1087
virtual bool hasSpecialDrag() const
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdobj.cxx:1331
bool HasMarkedObjPageView() const
Definition: svdpagv.hxx:177
sal_uInt32 PageWindowCount() const
Definition: svdpagv.hxx:89
SdrPageWindow * GetPageWindow(sal_uInt32 nIndex) const
Definition: svdpagv.cxx:83
SdrPaintWindow & GetPaintWindow() const
const sdr::contact::ObjectContact & GetObjectContact() const
sal_uInt16 ImpGetMinMovLogic(short nMinMov, const OutputDevice *pOut) const
Definition: svdpntv.cxx:304
SdrDragStat maDragStat
Definition: svdpntv.hxx:139
bool mbSomeObjChgdFlag
Definition: svdpntv.hxx:163
SdrPageView * GetSdrPageView() const
Definition: svdpntv.hxx:323
VclPtr< OutputDevice > mpDragWin
Definition: svdpntv.hxx:126
SdrModel & GetModel() const
Definition: svdpntv.hxx:282
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
bool OutputToWindow() const
bool bEliminatePolyPoints
Definition: svdsnpv.hxx:126
Point GetSnapPos(const Point &rPnt, const SdrPageView *pPV) const
Definition: svdsnpv.cxx:254
virtual std::unique_ptr< SdrUndoAction > CreateUndoGeoObject(SdrObject &rObject)
Definition: svdundo.cxx:1668
Changing the geometry of an object.
Definition: svdundo.hxx:213
virtual void Undo() override
Definition: svdundo.cxx:587
TYPE getMaxX() const
TYPE getMinX() const
TYPE getMinY() const
TYPE getMaxY() const
bool isEmpty() const
TYPE getX() const
TYPE getY() const
constexpr Point TopLeft() const
constexpr Point TopRight() const
constexpr bool IsEmpty() const
#define DBG_ASSERT(sCon, aError)
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
uno_Any a
aStr
bool IsSolidDragCreate()
B2IRange fround(const B2DRange &rRange)
SdrHdlKind
Definition: svdhdl.hxx:53
E3dObject * DynCastE3dObject(SdrObject *pObj)
Definition: svdobj.cxx:3205
SdrTextObj * DynCastSdrTextObj(SdrObject *pObj)
Definition: svdobj.cxx:3212
SdrDragMode
Definition: svdtypes.hxx:34
SdrCreateCmd
Definition: svdtypes.hxx:27
#define SAL_MAX_UINT32
oslFileHandle & pOut