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