LibreOffice Module svx (master)  1
svdview.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 #include <editeng/outlobj.hxx>
21 
22 #include <svx/strings.hrc>
23 #include <svx/dialmgr.hxx>
24 #include <svx/svdpagv.hxx>
25 #include <svx/svdmrkv.hxx>
26 #include <svx/svdedxv.hxx>
27 #include <svx/svdobj.hxx>
28 #include <svx/svdopath.hxx>
29 #include <svx/svdograf.hxx>
30 #include <svx/svdomedia.hxx>
31 #include <svx/svdetc.hxx>
32 
34 #include <svx/svdoutl.hxx>
35 #include <svx/svdview.hxx>
36 #include <editeng/flditem.hxx>
37 #include <svx/obj3d.hxx>
38 #include <svx/svddrgmt.hxx>
39 #include <svx/svdotable.hxx>
40 #include <tools/debug.hxx>
43 #include <svx/sdrpaintwindow.hxx>
44 #include <svx/sdrpagewindow.hxx>
45 #include <svx/sdrhittesthelper.hxx>
49 #include <sal/log.hxx>
50 #include <vcl/ptrstyle.hxx>
51 #include <vcl/window.hxx>
52 #include <comphelper/lok.hxx>
53 
54 
56  : mpHdl(nullptr),
57  mpObj(nullptr),
58  mpRootObj(nullptr),
59  mpPV(nullptr),
60  mpURLField(nullptr),
61  meHit(SdrHitKind::NONE),
62  meEvent(SdrEventKind::NONE),
63  mnMouseClicks(0),
64  mnMouseMode(MouseEventModifiers::NONE),
65  mnMouseCode(0),
66  mnHlplIdx(0),
67  mnGlueId(0),
68  mbMouseDown(false),
69  mbMouseUp(false),
70  mbIsAction(false),
71  mbIsTextEdit(false),
72  mbAddMark(false),
73  mbUnmark(false),
74  mbPrevNextMark(false),
75  mbMarkPrev(false)
76 {
77 }
78 
80 {
81 }
82 
83 
84 // helper class for all D&D overlays
85 
87  const SdrView& rView,
88  const basegfx::B2DPolyPolygon& rLinePolyPolygon)
89 {
90  for(sal_uInt32 a(0); a < rView.PaintWindowCount(); a++)
91  {
92  SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
93  const rtl::Reference< sdr::overlay::OverlayManager >& xTargetOverlay = pCandidate->GetOverlayManager();
94 
95  if (xTargetOverlay.is())
96  {
97  std::unique_ptr<sdr::overlay::OverlayPolyPolygonStripedAndFilled> pNew(new sdr::overlay::OverlayPolyPolygonStripedAndFilled(
98  rLinePolyPolygon));
99 
100  xTargetOverlay->add(*pNew);
101  maObjects.append(std::move(pNew));
102  }
103  }
104 }
105 
107 {
109  rView,
110  rObject.TakeXorPoly());
111 }
112 
114 {
115  basegfx::B2DPolygon aB2DPolygon;
116 
117  aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Top()));
118  aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Right(), rRectangle.Top()));
119  aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Right(), rRectangle.Bottom()));
120  aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
121  aB2DPolygon.setClosed(true);
122 
124  rView,
125  basegfx::B2DPolyPolygon(aB2DPolygon));
126 }
127 
128 SdrDropMarkerOverlay::SdrDropMarkerOverlay(const SdrView& rView, const Point& rStart, const Point& rEnd)
129 {
130  basegfx::B2DPolygon aB2DPolygon;
131 
132  aB2DPolygon.append(basegfx::B2DPoint(rStart.X(), rStart.Y()));
133  aB2DPolygon.append(basegfx::B2DPoint(rEnd.X(), rEnd.Y()));
134  aB2DPolygon.setClosed(true);
135 
137  rView,
138  basegfx::B2DPolyPolygon(aB2DPolygon));
139 }
140 
142 {
143  // The OverlayObjects are cleared using the destructor of OverlayObjectList.
144  // That destructor calls clear() at the list which removes all objects from the
145  // OverlayManager and deletes them.
146 }
147 
149  SdrModel& rSdrModel,
150  OutputDevice* pOut)
151 : SdrCreateView(rSdrModel, pOut),
152  mbNoExtendedMouseDispatcher(false),
153  mbNoExtendedKeyDispatcher(false),
154  mbMasterPagePaintCaching(false)
155 {
156  maAccessibilityOptions.AddListener(this);
158 }
159 
161 {
162  maAccessibilityOptions.RemoveListener(this);
163 }
164 
165 bool SdrView::KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin)
166 {
167  SetActualWin(pWin ? pWin->GetOutDev() : nullptr);
168  bool bRet = SdrCreateView::KeyInput(rKEvt,pWin);
169  if (!bRet && !IsExtendedKeyInputDispatcherEnabled()) {
170  bRet = true;
171  switch (rKEvt.GetKeyCode().GetFullFunction()) {
172  case KeyFuncType::DELETE: DeleteMarked(); break;
173  case KeyFuncType::UNDO: mpModel->Undo(); break;
174  case KeyFuncType::REDO: mpModel->Redo(); break;
175  default: {
176  switch (rKEvt.GetKeyCode().GetFullCode()) {
177  case KEY_ESCAPE: {
178  if (IsTextEdit()) SdrEndTextEdit();
179  if (IsAction()) BrkAction();
180  if (pWin!=nullptr) pWin->ReleaseMouse();
181  } break;
182  case KEY_DELETE: DeleteMarked(); break;
183  case KEY_UNDO: case KEY_BACKSPACE+KEY_MOD2: mpModel->Undo(); break;
184  case KEY_BACKSPACE+KEY_MOD2+KEY_SHIFT: mpModel->Redo(); break;
185  case KEY_REPEAT: case KEY_BACKSPACE+KEY_MOD2+KEY_MOD1: mpModel->Repeat(*this); break;
186  case KEY_MOD1+KEY_A: MarkAll(); break;
187  default: bRet=false;
188  } // switch
189  }
190  } // switch
191  if (bRet && pWin!=nullptr) {
193  pWin->PixelToLogic(pWin->ScreenToOutputPixel( pWin->GetPointerPosPixel() ) ),
194  pWin->GetOutDev(),
195  rKEvt.GetKeyCode().GetModifier()));
196  }
197  }
198  return bRet;
199 }
200 
202 {
203  SetActualWin(pWin);
204  if (rMEvt.IsLeft()) maDragStat.SetMouseDown(true);
205  bool bRet = SdrCreateView::MouseButtonDown(rMEvt,pWin);
206  if (!bRet && !IsExtendedMouseEventDispatcherEnabled()) {
207  SdrViewEvent aVEvt;
209  bRet = DoMouseEvent(aVEvt);
210  }
211  return bRet;
212 }
213 
215 {
216  SetActualWin(pWin);
217  if (rMEvt.IsLeft()) maDragStat.SetMouseDown(false);
218  bool bAction = IsAction();
219  bool bRet = !bAction && SdrCreateView::MouseButtonUp(rMEvt,pWin);
220  if (!bRet && !IsExtendedMouseEventDispatcherEnabled()) {
221  SdrViewEvent aVEvt;
223  bRet = DoMouseEvent(aVEvt);
224  }
225  return bRet;
226 }
227 
228 bool SdrView::MouseMove(const MouseEvent& rMEvt, OutputDevice* pWin)
229 {
230  SetActualWin(pWin);
231  maDragStat.SetMouseDown(rMEvt.IsLeft());
232  bool bRet = SdrCreateView::MouseMove(rMEvt,pWin);
234  SdrViewEvent aVEvt;
236  if (DoMouseEvent(aVEvt)) bRet=true;
237  }
238 
239  return bRet;
240 }
241 
242 bool SdrView::Command(const CommandEvent& rCEvt, vcl::Window* pWin)
243 {
244  SetActualWin(pWin->GetOutDev());
245  bool bRet = SdrCreateView::Command(rCEvt,pWin);
246  return bRet;
247 }
248 
249 void SdrView::GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const
250 {
251  SdrCreateView::GetAttributes(rTargetSet, bOnlyHardAttr);
252 }
253 
255 {
256  rVEvt.mbMouseDown = nEventKind==SdrMouseEventKind::BUTTONDOWN;
257  rVEvt.mbMouseUp = nEventKind==SdrMouseEventKind::BUTTONUP;
258  rVEvt.mnMouseClicks = rMEvt.GetClicks();
259  rVEvt.mnMouseMode = rMEvt.GetMode();
260  rVEvt.mnMouseCode = rMEvt.GetButtons() | rMEvt.GetModifier();
262  if (pOut==nullptr)
263  {
264  pOut = GetFirstOutputDevice();
265  }
266  Point aPnt(rMEvt.GetPosPixel());
267  if (pOut!=nullptr) aPnt=pOut->PixelToLogic(aPnt);
268  rVEvt.maLogicPos = aPnt;
269  return PickAnything(aPnt,rVEvt);
270 }
271 
272 // Dragging with the Mouse (Move)
273 // Example when creating a rectangle: MouseDown has to happen without a ModKey,
274 // else we usually force a selection (see below).
275 // When pressing Shift, Ctrl and Alt at the same time while doing a MouseMove,
276 // a centered, not snapped square is created.
277 // The dual allocation of Ortho and Shift won't usually create a problem, as the
278 // two functions are in most cases mutually exclusive. Only shearing (the kind
279 // that happens when contorting, not when rotating) can use both functions at
280 // the same time. To get around this, the user can use e. g. help lines.
281 #define MODKEY_NoSnap bCtrl /* temporarily disable snapping */
282 #define MODKEY_Ortho bShift /* ortho */
283 #define MODKEY_Center bAlt /* create/resize centeredly */
284 #define MODKEY_AngleSnap bShift
285 #define MODKEY_CopyDrag bCtrl /* drag and copy */
286 
287 // click somewhere (MouseDown)
288 #define MODKEY_PolyPoly bAlt /* new Poly at InsPt and at Create */
289 #define MODKEY_MultiMark bShift /* MarkObj without doing UnmarkAll first */
290 #define MODKEY_Unmark bAlt /* deselect with a dragged frame */
291 #define MODKEY_ForceMark bCtrl /* force dragging a frame, even if there's an object at cursor position */
292 #define MODKEY_DeepMark bAlt /* MarkNextObj */
293 #define MODKEY_DeepBackw bShift /* MarkNextObj but backwards */
294 
295 SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) const
296 {
298  if (pOut==nullptr)
299  {
300  pOut = GetFirstOutputDevice();
301  }
302 
303  // #i73628# Use a non-changeable copy of he logic position
304  const Point aLocalLogicPosition(rLogicPos);
305 
306  bool bEditMode=IsEditMode();
307  bool bPointMode=bEditMode && HasMarkablePoints();
308  bool bGluePointMode=IsGluePointEditMode();
309  bool bInsPolyPt=bPointMode && IsInsObjPointMode() && IsInsObjPointPossible();
310  bool bInsGluePt=bGluePointMode && IsInsGluePointMode() && IsInsGluePointPossible();
311  bool bIsTextEdit=IsTextEdit();
312  bool bTextEditHit=IsTextEditHit(aLocalLogicPosition);
313  bool bTextEditSel=IsTextEditInSelectionMode();
314  bool bShift = (rVEvt.mnMouseCode & KEY_SHIFT) != 0;
315  bool bCtrl = (rVEvt.mnMouseCode & KEY_MOD1) != 0;
316  bool bAlt = (rVEvt.mnMouseCode & KEY_MOD2) != 0;
318  SdrHdl* pHdl=pOut!=nullptr && !bTextEditSel ? PickHandle(aLocalLogicPosition) : nullptr;
319  SdrPageView* pPV=nullptr;
320  SdrObject* pObj=nullptr;
321  SdrObject* pHitObj=nullptr;
322  bool bHitPassDirect=true;
323  sal_uInt16 nHlplIdx=0;
324  sal_uInt16 nGlueId=0;
325  if (bTextEditHit || bTextEditSel)
326  {
328  }
329  else if (pHdl!=nullptr)
330  {
331  eHit=SdrHitKind::Handle; // handle is hit: highest priority
332  }
333  else if (bEditMode && IsHlplVisible() && IsHlplFront() && pOut!=nullptr && PickHelpLine(aLocalLogicPosition,mnHitTolLog,*pOut,nHlplIdx,pPV))
334  {
335  eHit=SdrHitKind::HelpLine; // help line in the foreground hit: can be moved now
336  }
337  else if (bGluePointMode && PickGluePoint(aLocalLogicPosition,pObj,nGlueId,pPV))
338  {
339  eHit=SdrHitKind::Gluepoint; // deselected gluepoint hit
340  }
341  else if ((pHitObj = PickObj(aLocalLogicPosition,mnHitTolLog,pPV,SdrSearchOptions::DEEP|SdrSearchOptions::MARKED,&pObj,&bHitPassDirect)))
342  {
344  sdr::table::SdrTableObj* pTableObj = dynamic_cast< sdr::table::SdrTableObj* >( pObj );
345  if( pTableObj )
346  {
347  sal_Int32 nX = 0, nY = 0;
348  switch( pTableObj->CheckTableHit( aLocalLogicPosition, nX, nY ) )
349  {
351  eHit = SdrHitKind::Cell;
352  break;
355  break;
356  default:
357  break;
358  }
359  }
360  }
361  else if ((pHitObj = PickObj(aLocalLogicPosition,mnHitTolLog,pPV,SdrSearchOptions::DEEP|SdrSearchOptions::ALSOONMASTER|SdrSearchOptions::WHOLEPAGE,&pObj,&bHitPassDirect)))
362  {
363  // MasterPages and WholePage for Macro and URL
365  sdr::table::SdrTableObj* pTableObj = dynamic_cast< sdr::table::SdrTableObj* >( pObj );
366  if( pTableObj )
367  {
368  sal_Int32 nX = 0, nY = 0;
369  switch( pTableObj->CheckTableHit( aLocalLogicPosition, nX, nY, mnHitTolLog ) )
370  {
372  eHit = SdrHitKind::Cell;
373  break;
375  // Keep state on UnmarkedObject to allow the below
376  // 'check for URL field' to be executed, else popups
377  // for e.g. URL links when hoovering and clicking
378  // them will not work. Tried several other changes,
379  // but this one safely keeps existing behaviour as-is.
380  // Except for the LOK. LOK doesn't have hoovering popup
381  // feature.
383  break;
384  default:
385  break;
386  }
387  }
388  }
389  else if (bEditMode && IsHlplVisible() && !IsHlplFront() && pOut!=nullptr && PickHelpLine(aLocalLogicPosition,mnHitTolLog,*pOut,nHlplIdx,pPV))
390  {
391  eHit=SdrHitKind::HelpLine; // help line in foreground hit: can be moved now
392  }
393  if (eHit==SdrHitKind::UnmarkedObject)
394  {
395  bool bRoot=pObj->HasMacro();
396  bool bDeep=pObj!=pHitObj && pHitObj->HasMacro();
397  bool bMid=false; // Have we hit upon a grouped group with a macro?
398  SdrObject* pMidObj=nullptr;
399  if (pObj!=pHitObj)
400  {
401  SdrObject* pObjTmp=pHitObj->getParentSdrObjectFromSdrObject();
402  if (pObjTmp==pObj) pObjTmp=nullptr;
403  while (pObjTmp!=nullptr)
404  {
405  if (pObjTmp->HasMacro())
406  {
407  bMid=true;
408  pMidObj=pObjTmp;
409  }
410  pObjTmp=pObjTmp->getParentSdrObjectFromSdrObject();
411  if (pObjTmp==pObj) pObjTmp=nullptr;
412  }
413  }
414 
415  if (bDeep || bMid || bRoot)
416  {
417  SdrObjMacroHitRec aHitRec;
418  aHitRec.aPos=aLocalLogicPosition;
419  aHitRec.nTol=mnHitTolLog;
420  aHitRec.pVisiLayer=&pPV->GetVisibleLayers();
421  aHitRec.pPageView=pPV;
422  if (bDeep) bDeep=pHitObj->IsMacroHit(aHitRec);
423  if (bMid ) bMid =pMidObj->IsMacroHit(aHitRec);
424  if (bRoot) bRoot=pObj->IsMacroHit(aHitRec);
425  if (bRoot || bMid || bDeep)
426  {
427  // Priorities: 1. Root, 2. Mid, 3. Deep
428  rVEvt.mpRootObj = pObj;
429  if (!bRoot) pObj=pMidObj;
430  if (!bRoot && !bMid) pObj=pHitObj;
431  eHit=SdrHitKind::Macro;
432  }
433  }
434  }
435  // check for URL field
436  if (eHit==SdrHitKind::UnmarkedObject)
437  {
438  SdrTextObj* pTextObj=dynamic_cast<SdrTextObj*>( pHitObj );
439  if (pTextObj!=nullptr && pTextObj->HasText())
440  {
441  // use the primitive-based HitTest which is more accurate anyways. It
442  // will correctly handle rotated/mirrored/sheared/scaled text and can
443  // now return a HitContainer containing the primitive hierarchy of the
444  // primitive that triggered the hit. The first entry is that primitive,
445  // the others are the full stack of primitives leading to that one which
446  // includes grouping primitives (like TextHierarchyPrimitives we deed here)
447  // but also all decomposed ones which lead to the creation of that primitive
449  const bool bTEHit(pPV && SdrObjectPrimitiveHit(*pTextObj, aLocalLogicPosition, 0, *pPV, &pPV->GetVisibleLayers(), true, &aHitContainer));
450 
451  if (bTEHit && !aHitContainer.empty())
452  {
453  // search for TextHierarchyFieldPrimitive2D which contains the needed information
454  // about a possible URLField
455  const drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D* pTextHierarchyFieldPrimitive2D = nullptr;
456 
457  for (const drawinglayer::primitive2d::Primitive2DReference& xReference : aHitContainer)
458  {
459  if (xReference.is())
460  {
461  auto pBasePrimitive = static_cast<const drawinglayer::primitive2d::BasePrimitive2D*>(xReference.get());
462  if (pBasePrimitive->getPrimitive2DID() == PRIMITIVE2D_ID_TEXTHIERARCHYFIELDPRIMITIVE2D)
463  {
464  pTextHierarchyFieldPrimitive2D = static_cast<const drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D*>(xReference.get());
465  break;
466  }
467  }
468  }
469 
470  if (nullptr != pTextHierarchyFieldPrimitive2D)
471  {
472  if (drawinglayer::primitive2d::FieldType::FIELD_TYPE_URL == pTextHierarchyFieldPrimitive2D->getType())
473  {
474  // problem with the old code is that a *pointer* to an instance of
475  // SvxURLField is set in the Event which is per se not good since that
476  // data comes from a temporary EditEngine's data and could vanish any
477  // moment. Have to replace for now with a static instance that gets
478  // filled/initialized from the original data held in the TextHierarchyField-
479  // Primitive2D (see impTextBreakupHandler::impCheckFieldPrimitive).
480  // Unfortunately things like 'TargetFrame' are still used in Calc, so this
481  // can currently not get replaced. For the future the Name/Value vector or
482  // the TextHierarchyFieldPrimitive2D itself should/will be used for handling
483  // that data
484  static SvxURLField aSvxURLField;
485 
486  aSvxURLField.SetURL(pTextHierarchyFieldPrimitive2D->getValue("URL"));
487  aSvxURLField.SetRepresentation(pTextHierarchyFieldPrimitive2D->getValue("Representation"));
488  aSvxURLField.SetTargetFrame(pTextHierarchyFieldPrimitive2D->getValue("TargetFrame"));
489  const OUString aFormat(pTextHierarchyFieldPrimitive2D->getValue("SvxURLFormat"));
490 
491  if (!aFormat.isEmpty())
492  {
493  aSvxURLField.SetFormat(static_cast<SvxURLFormat>(aFormat.toInt32()));
494  }
495 
496  // set HitKind and pointer to local static instance in the Event
497  // to comply to old stuff
498  eHit = SdrHitKind::UrlField;
499  rVEvt.mpURLField = &aSvxURLField;
500  }
501  }
502  }
503  }
504  if (eHit==SdrHitKind::UnmarkedObject && !pHitObj->getHyperlink().isEmpty())
505  {
506  static SvxURLField aSvxURLField;
507  aSvxURLField.SetURL(pHitObj->getHyperlink());
508  rVEvt.mpURLField = &aSvxURLField;
509  eHit = SdrHitKind::UrlField;
510  }
511  }
512 
513  if (bHitPassDirect &&
515  (IsTextTool() || (IsEditMode() && IsQuickTextEditMode())) && pHitObj->HasTextEdit())
516  {
517  // Around the TextEditArea there's a border to select without going into text edit mode.
518  tools::Rectangle aBoundRect(pHitObj->GetCurrentBoundRect());
519 
520  // Force to SnapRect when Fontwork
521  if( auto pTextObj = dynamic_cast<const SdrTextObj*>(pHitObj) )
522  if( pTextObj->IsFontwork() )
523  aBoundRect = pHitObj->GetSnapRect();
524 
525  sal_Int32 nTolerance(mnHitTolLog);
526  bool bBoundRectHit(false);
527 
528  if(pOut)
529  {
530  nTolerance = pOut->PixelToLogic(Size(2, 0)).Width();
531  }
532 
533  if( (aLocalLogicPosition.X() >= aBoundRect.Left() - nTolerance && aLocalLogicPosition.X() <= aBoundRect.Left() + nTolerance)
534  || (aLocalLogicPosition.X() >= aBoundRect.Right() - nTolerance && aLocalLogicPosition.X() <= aBoundRect.Right() + nTolerance)
535  || (aLocalLogicPosition.Y() >= aBoundRect.Top() - nTolerance && aLocalLogicPosition.Y() <= aBoundRect.Top() + nTolerance)
536  || (aLocalLogicPosition.Y() >= aBoundRect.Bottom() - nTolerance && aLocalLogicPosition.Y() <= aBoundRect.Bottom() + nTolerance))
537  {
538  bBoundRectHit = true;
539  }
540 
541  if(!bBoundRectHit)
542  {
543  bool bTEHit(pPV &&
544  SdrObjectPrimitiveHit(*pHitObj, aLocalLogicPosition, 0, *pPV, &pPV->GetVisibleLayers(), true));
545 
546  // TextEdit attached to an object in a locked layer
547  if (pPV->GetLockedLayers().IsSet(pHitObj->GetLayer()))
548  {
549  bTEHit=false;
550  }
551 
552  if (bTEHit)
553  {
554  rVEvt.mpRootObj=pObj;
555  pObj=pHitObj;
557  }
558  }
559  }
560  if (!bHitPassDirect && eHit==SdrHitKind::UnmarkedObject) {
561  eHit=SdrHitKind::NONE;
562  pObj=nullptr;
563  pPV=nullptr;
564  }
565  bool bMouseLeft = (rVEvt.mnMouseCode & MOUSE_LEFT) != 0;
566  bool bMouseRight = (rVEvt.mnMouseCode & MOUSE_RIGHT) != 0;
567  bool bMouseDown = rVEvt.mbMouseDown;
568  bool bMouseUp = rVEvt.mbMouseUp;
570  bool bIsAction=IsAction();
571 
572  if (bIsAction)
573  {
574  if (bMouseDown)
575  {
576  if (bMouseRight) eEvent=SdrEventKind::BackAction;
577  }
578  else if (bMouseUp)
579  {
580  if (bMouseLeft)
581  {
583  if (IsDragObj())
584  {
585  eEvent=SdrEventKind::EndDrag;
586  }
587  else if (IsCreateObj() || IsInsObjPoint())
588  {
590  }
591  else if (IsMarking())
592  {
593  eEvent=SdrEventKind::EndMark;
594  if (!maDragStat.IsMinMoved())
595  {
596  eEvent=SdrEventKind::BrkMark;
597  rVEvt.mbAddMark = MODKEY_MultiMark;
598  }
599  }
600  }
601  }
602  else
603  {
605  }
606  }
607  else if (eHit==SdrHitKind::TextEdit)
608  {
609  eEvent=SdrEventKind::TextEdit;
610  }
611  else if (bMouseDown && bMouseLeft)
612  {
613  if (rVEvt.mnMouseClicks == 2 && rVEvt.mnMouseCode == MOUSE_LEFT && pObj!=nullptr && pHitObj!=nullptr && pHitObj->HasTextEdit() && eHit==SdrHitKind::MarkedObject)
614  {
615  rVEvt.mpRootObj = pObj;
616  pObj=pHitObj;
618  }
619  else if (MODKEY_ForceMark && eHit!=SdrHitKind::UrlField)
620  {
621  eEvent=SdrEventKind::BeginMark; // AddMark,Unmark */
622  }
623  else if (eHit==SdrHitKind::HelpLine)
624  {
625  eEvent=SdrEventKind::BeginDragHelpline; // nothing, actually
626  }
627  else if (eHit==SdrHitKind::Gluepoint)
628  {
629  eEvent=SdrEventKind::MarkGluePoint; // AddMark+Drag
630  rVEvt.mbAddMark = MODKEY_MultiMark || MODKEY_DeepMark; // if not hit with Deep
631  }
632  else if (eHit==SdrHitKind::Handle)
633  {
634  eEvent=SdrEventKind::BeginDragObj; // Mark+Drag,AddMark+Drag,DeepMark+Drag,Unmark
635  bool bGlue=pHdl->GetKind()==SdrHdlKind::Glue;
636  bool bPoly=!bGlue && IsPointMarkable(*pHdl);
637  bool bMarked=bGlue || (bPoly && pHdl->IsSelected());
638  if (bGlue || bPoly)
639  {
641  if (MODKEY_DeepMark)
642  {
643  rVEvt.mbAddMark = true;
644  rVEvt.mbPrevNextMark = true;
646  }
647  else if (MODKEY_MultiMark)
648  {
649  rVEvt.mbAddMark = true;
650  rVEvt.mbUnmark = bMarked; // Toggle
651  if (bGlue)
652  {
653  pObj=pHdl->GetObj();
654  nGlueId=static_cast<sal_uInt16>(pHdl->GetObjHdlNum());
655  }
656  }
657  else if (bMarked)
658  {
659  eEvent=SdrEventKind::BeginDragObj; // don't change MarkState, only change Drag
660  }
661  }
662  }
663  else if (bInsPolyPt && (MODKEY_PolyPoly || (!MODKEY_MultiMark && !MODKEY_DeepMark)))
664  {
666  }
667  else if (bInsGluePt && !MODKEY_MultiMark && !MODKEY_DeepMark)
668  {
670  }
671  else if (eHit==SdrHitKind::TextEditObj)
672  {
673  eEvent=SdrEventKind::BeginTextEdit; // AddMark+Drag,DeepMark+Drag,Unmark
675  { // if not hit with Deep
676  eEvent=SdrEventKind::MarkObj;
677  }
678  }
679  else if (eHit==SdrHitKind::Macro)
680  {
681  eEvent=SdrEventKind::BeginMacroObj; // AddMark+Drag
683  { // if not hit with Deep
684  eEvent=SdrEventKind::MarkObj;
685  }
686  }
687  else if (eHit==SdrHitKind::UrlField)
688  {
689  eEvent=SdrEventKind::ExecuteUrl; // AddMark+Drag
691  { // if not hit with Deep
692  eEvent=SdrEventKind::MarkObj;
693  }
694  }
695  else if (eHit==SdrHitKind::MarkedObject)
696  {
697  eEvent=SdrEventKind::BeginDragObj; // DeepMark+Drag,Unmark
698 
700  { // if not hit with Deep
701  eEvent=SdrEventKind::MarkObj;
702  }
703  }
704  else if (IsCreateMode())
705  {
706  eEvent=SdrEventKind::BeginCreateObj; // nothing, actually
707  }
708  else if (eHit==SdrHitKind::UnmarkedObject)
709  {
710  eEvent=SdrEventKind::MarkObj; // AddMark+Drag
711  }
712  else
713  {
715  }
716 
717  if (eEvent==SdrEventKind::MarkObj)
718  {
719  rVEvt.mbAddMark = MODKEY_MultiMark || MODKEY_DeepMark; // if not hit with Deep
722  }
723  if (eEvent==SdrEventKind::BeginMark)
724  {
725  rVEvt.mbAddMark = MODKEY_MultiMark;
726  rVEvt.mbUnmark = MODKEY_Unmark;
727  }
728  }
729  rVEvt.mbIsAction = bIsAction;
730  rVEvt.mbIsTextEdit = bIsTextEdit;
731  rVEvt.maLogicPos = aLocalLogicPosition;
732  rVEvt.mpHdl = pHdl;
733  rVEvt.mpObj = pObj;
734  if (rVEvt.mpRootObj == nullptr)
735  rVEvt.mpRootObj = pObj;
736  rVEvt.mpPV = pPV;
737  rVEvt.mnHlplIdx = nHlplIdx;
738  rVEvt.mnGlueId = nGlueId;
739  rVEvt.meHit = eHit;
740  rVEvt.meEvent = eEvent;
741 #ifdef DGB_UTIL
742  if (rVEvt.mpRootObj != nullptr)
743  {
745  {
746  OSL_FAIL("SdrView::PickAnything(): pRootObj->getParentSdrObjListFromSdrObject()!=pPV->GetObjList() !");
747  }
748  }
749 #endif
750  return eHit;
751 }
752 
754 {
755  bool bRet=false;
756  SdrHitKind eHit = rVEvt.meHit;
757  Point aLogicPos(rVEvt.maLogicPos);
758 
759  bool bShift = (rVEvt.mnMouseCode & KEY_SHIFT) != 0;
760  bool bCtrl = (rVEvt.mnMouseCode & KEY_MOD1) != 0;
761  bool bAlt = (rVEvt.mnMouseCode & KEY_MOD2) != 0;
762  bool bMouseLeft = (rVEvt.mnMouseCode & MOUSE_LEFT) != 0;
763  bool bMouseDown = rVEvt.mbMouseDown;
764  bool bMouseUp = rVEvt.mbMouseUp;
765  if (bMouseDown) {
766  if (bMouseLeft) maDragStat.SetMouseDown(true);
767  } else if (bMouseUp) {
768  if (bMouseLeft) maDragStat.SetMouseDown(false);
769  } else { // else, MouseMove
770  maDragStat.SetMouseDown(bMouseLeft);
771  }
772 
773 #ifdef MODKEY_NoSnap
775 #endif
776 #ifdef MODKEY_Ortho
778 #endif
779 #ifdef MODKEY_AngleSnap
781 #endif
782 #ifdef MODKEY_CopyDrag
784 #endif
785 #ifdef MODKEY_Center
789 #endif
790  if (bMouseLeft && bMouseDown && rVEvt.mbIsTextEdit && (eHit==SdrHitKind::UnmarkedObject || eHit==SdrHitKind::NONE)) {
791  SdrEndTextEdit(); // User has clicked beneath object, exit edit mode.
792  // pHdl is invalid, then, that shouldn't matter, though, as we expect
793  // pHdl==NULL (because of eHit).
794  }
795  switch (rVEvt.meEvent)
796  {
797  case SdrEventKind::NONE: bRet=false; break;
798  case SdrEventKind::TextEdit: bRet=false; break; // Events handled by the OutlinerView are not taken into account here.
799  case SdrEventKind::MoveAction: MovAction(aLogicPos); bRet=true; break;
800  case SdrEventKind::EndAction: EndAction(); bRet=true; break;
801  case SdrEventKind::BackAction: BckAction(); bRet=true; break;
802  case SdrEventKind::EndMark : EndAction(); bRet=true; break;
803  case SdrEventKind::BrkMark : {
804  BrkAction();
805  if (!MarkObj(aLogicPos, mnHitTolLog, rVEvt.mbAddMark))
806  {
807  // No object hit. Do the following:
808  // 1. deselect any selected gluepoints
809  // 2. deselect any selected polygon points
810  // 3. deselect any selected objects
811  if (!rVEvt.mbAddMark) UnmarkAll();
812  }
813  bRet=true;
814  } break;
815  case SdrEventKind::EndCreate: { // if necessary, MarkObj
818  if (rVEvt.mnMouseClicks > 1) eCmd=SdrCreateCmd::ForceEnd;
819  if (!EndCreateObj(eCmd)) { // Don't evaluate event for Create? -> Select
821  MarkObj(rVEvt.mpRootObj, rVEvt.mpPV);
822  if (eHit==SdrHitKind::TextEdit)
823  {
826 
827  if(bRet2)
828  {
829  MouseEvent aMEvt(mpActualOutDev->LogicToPixel(aLogicPos), 1,
830  rVEvt.mnMouseMode,rVEvt.mnMouseCode,rVEvt.mnMouseCode);
831 
833  if (pOLV!=nullptr) {
834  pOLV->MouseButtonDown(aMEvt); // event for the Outliner, but without double-click
835  pOLV->MouseButtonUp(aMEvt); // event for the Outliner, but without double-click
836  }
837  }
838  }
839  bRet=true; // object is selected and (if necessary) TextEdit is started
840  } else bRet=false; // canceled Create, nothing else
841  } else bRet=true; // return true for EndCreate
842  } break;
843  case SdrEventKind::EndDrag: {
844  bRet=EndDragObj(IsDragWithCopy());
845  ForceMarkedObjToAnotherPage(); // TODO: Undo+bracing missing!
846  } break;
847  case SdrEventKind::MarkObj: { // + (if applicable) BegDrag
848  if (!rVEvt.mbAddMark) UnmarkAllObj();
849  bool bUnmark = rVEvt.mbUnmark;
850  if (rVEvt.mbPrevNextMark) {
851  bRet=MarkNextObj(aLogicPos, mnHitTolLog, rVEvt.mbMarkPrev);
852  } else {
854  const size_t nCount0=GetMarkedObjectCount();
855  bRet=MarkObj(aLogicPos, mnHitTolLog, rVEvt.mbAddMark);
857  const size_t nCount1=GetMarkedObjectCount();
858  bUnmark=nCount1<nCount0;
859  }
860  if (!bUnmark) {
861  BegDragObj(aLogicPos,nullptr,nullptr,mnMinMovLog);
862  bRet=true;
863  }
864  } break;
865  case SdrEventKind::MarkPoint: { // + (if applicable) BegDrag
866  if (!rVEvt.mbAddMark) UnmarkAllPoints();
867  if (rVEvt.mbPrevNextMark) {
868  MarkNextPoint();
869  bRet=false;
870  } else {
871  bRet = MarkPoint(*rVEvt.mpHdl, rVEvt.mbUnmark);
872  }
873  if (!rVEvt.mbUnmark && !rVEvt.mbPrevNextMark) {
874  BegDragObj(aLogicPos, nullptr, rVEvt.mpHdl, mnMinMovLog);
875  bRet=true;
876  }
877  } break;
878  case SdrEventKind::MarkGluePoint: { // + (if applicable) BegDrag
879  if (!rVEvt.mbAddMark) UnmarkAllGluePoints();
880  if (rVEvt.mbPrevNextMark) {
882  bRet=false;
883  } else {
884  bRet=MarkGluePoint(rVEvt.mpObj,rVEvt.mnGlueId,rVEvt.mbUnmark);
885  }
886  if (!rVEvt.mbUnmark && !rVEvt.mbPrevNextMark) {
887  SdrHdl* pHdl = GetGluePointHdl(rVEvt.mpObj, rVEvt.mnGlueId);
888  BegDragObj(aLogicPos,nullptr,pHdl,mnMinMovLog);
889  bRet=true;
890  }
891  } break;
892  case SdrEventKind::BeginMark: bRet = BegMark(aLogicPos,rVEvt.mbAddMark,rVEvt.mbUnmark); break;
893  case SdrEventKind::BeginInsertObjPoint: bRet = BegInsObjPoint(aLogicPos, MODKEY_PolyPoly); break;
897  if (rVEvt.mnMouseClicks > 1) eCmd = SdrCreateCmd::ForceEnd;
898  EndInsObjPoint(eCmd);
899  bRet=true;
900  } break;
901  case SdrEventKind::BeginInsertGluePoint: bRet=BegInsGluePoint(aLogicPos); break;
902  case SdrEventKind::BeginDragHelpline: bRet = BegDragHelpLine(rVEvt.mnHlplIdx,rVEvt.mpPV); break;
903  case SdrEventKind::BeginDragObj: bRet=BegDragObj(aLogicPos, nullptr, rVEvt.mpHdl, mnMinMovLog); break;
907  bRet=BegCreateCaptionObj(aLogicPos,Size(5*nHgt,2*nHgt));
908  } else bRet=BegCreateObj(aLogicPos);
909  } break;
911  BegMacroObj(aLogicPos, mnHitTolLog, rVEvt.mpObj, rVEvt.mpPV, mpActualOutDev->GetOwnerWindow());
912  bRet=false;
913  } break;
915  if (!IsObjMarked(rVEvt.mpObj)) {
916  UnmarkAllObj();
917  MarkObj(rVEvt.mpRootObj,rVEvt.mpPV);
918  }
919 
922 
923  if(bRet)
924  {
925  MouseEvent aMEvt(mpActualOutDev->LogicToPixel(aLogicPos),
926  1, rVEvt.mnMouseMode, rVEvt.mnMouseCode, rVEvt.mnMouseCode);
928  if (pOLV!=nullptr) pOLV->MouseButtonDown(aMEvt); // event for the Outliner, but without double-click
929  }
930  } break;
931  default: break;
932  } // switch
935  // left mouse button pressed?
936  bool bLeftDown = (rVEvt.mnMouseCode & MOUSE_LEFT) != 0 && rVEvt.mbMouseDown;
937  // left mouse button released?
938  bool bLeftUp = (rVEvt.mnMouseCode & MOUSE_LEFT) != 0 && rVEvt.mbMouseUp;
939  // left mouse button pressed or held?
940  bool bLeftDown1=(rVEvt.mnMouseCode & MOUSE_LEFT) != 0 && !rVEvt.mbMouseUp;
941  pWin->SetPointer(GetPreferredPointer(rVEvt.maLogicPos, pWin->GetOutDev(),
942  rVEvt.mnMouseCode & (KEY_SHIFT|KEY_MOD1|KEY_MOD2),bLeftDown1));
943  bool bAction=IsAction();
944  if (bLeftDown && bAction)
945  pWin->CaptureMouse();
946  else if (bLeftUp || (rVEvt.mbIsAction && !bAction))
947  pWin->ReleaseMouse();
948  }
949  return bRet;
950 }
951 
952 PointerStyle SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDevice* pOut, sal_uInt16 nModifier, bool bLeftDown) const
953 {
954  // Actions
955  if (IsCreateObj())
956  {
958  }
960  {
961  return mpCurrentSdrDragMethod->GetSdrDragPointer();
962  }
963  if (IsMarkObj() || IsMarkPoints() || IsMarkGluePoints() || IsSetPageOrg()) return PointerStyle::Arrow;
965  if (IsMacroObj()) {
966  SdrObjMacroHitRec aHitRec;
967  aHitRec.aPos=pOut->LogicToPixel(rMousePos);
968  aHitRec.nTol=nMacroTol;
970  aHitRec.pPageView=pMacroPV;
971  return pMacroObj->GetMacroPointer(aHitRec);
972  }
973 
974  // TextEdit, ObjEdit, Macro
975  if (IsTextEdit() && (IsTextEditInSelectionMode() || IsTextEditHit(rMousePos)))
976  {
977  if(!pOut || IsTextEditInSelectionMode())
978  {
979  if(pTextEditOutliner->IsVertical())
980  return PointerStyle::TextVertical;
981  else
982  return PointerStyle::Text;
983  }
984  // Outliner should return something here...
985  Point aPos(pOut->LogicToPixel(rMousePos));
987  if (aPointer==PointerStyle::Arrow)
988  {
989  if(pTextEditOutliner->IsVertical())
990  aPointer = PointerStyle::TextVertical;
991  else
992  aPointer = PointerStyle::Text;
993  }
994  return aPointer;
995  }
996 
997  SdrViewEvent aVEvt;
998  aVEvt.mnMouseCode = (nModifier&(KEY_SHIFT|KEY_MOD1|KEY_MOD2))|MOUSE_LEFT; // to see what would happen on MouseLeftDown
999  aVEvt.mbMouseDown = !bLeftDown; // What if ..?
1000  aVEvt.mbMouseUp = bLeftDown; // What if ..?
1001  if (pOut!=nullptr)
1002  const_cast<SdrView*>(this)->SetActualWin(pOut);
1003  SdrHitKind eHit=PickAnything(rMousePos,aVEvt);
1004  SdrEventKind eEvent = aVEvt.meEvent;
1005  switch (eEvent)
1006  {
1008  return maCurrentCreatePointer;
1009  case SdrEventKind::MarkObj:
1010  return PointerStyle::Move;
1012  return PointerStyle::Arrow;
1015  return PointerStyle::MovePoint;
1018  return PointerStyle::Cross;
1020  return PointerStyle::RefHand;
1022  {
1023  SdrObjMacroHitRec aHitRec;
1024  aHitRec.aPos = aVEvt.maLogicPos;
1025  aHitRec.nTol=mnHitTolLog;
1026  aHitRec.pVisiLayer = &aVEvt.mpPV->GetVisibleLayers();
1027  aHitRec.pPageView = aVEvt.mpPV;
1028  return aVEvt.mpObj->GetMacroPointer(aHitRec);
1029  }
1030  default: break;
1031  } // switch
1032 
1033  switch(eHit)
1034  {
1035  case SdrHitKind::Cell:
1036  return PointerStyle::Arrow;
1037  case SdrHitKind::HelpLine :
1038  return aVEvt.mpPV->GetHelpLines()[aVEvt.mnHlplIdx].GetPointer();
1039  case SdrHitKind::Gluepoint:
1040  return PointerStyle::MovePoint;
1041  case SdrHitKind::TextEdit :
1043  {
1044  SdrTextObj* pText = dynamic_cast< SdrTextObj* >(aVEvt.mpObj);
1045  if(pText && pText->HasText())
1046  {
1047  OutlinerParaObject* pParaObj = pText->GetOutlinerParaObject();
1048  if(pParaObj && pParaObj->IsEffectivelyVertical())
1049  return PointerStyle::TextVertical;
1050  }
1051  return PointerStyle::Text;
1052  }
1053  default: break;
1054  }
1055 
1056  bool bMarkHit=eHit==SdrHitKind::MarkedObject;
1057  SdrHdl* pHdl = aVEvt.mpHdl;
1058  // now check the pointers for dragging
1059  if (pHdl!=nullptr || bMarkHit) {
1060  SdrHdlKind eHdl= pHdl!=nullptr ? pHdl->GetKind() : SdrHdlKind::Move;
1061  bool bCorner=pHdl!=nullptr && pHdl->IsCornerHdl();
1062  bool bVertex=pHdl!=nullptr && pHdl->IsVertexHdl();
1063  bool bMov=eHdl==SdrHdlKind::Move;
1065  if (!IsMoveAllowed()) return PointerStyle::Arrow; // because double click or drag & drop is possible
1066  return PointerStyle::Move;
1067  }
1068  switch (meDragMode) {
1069  case SdrDragMode::Rotate: {
1070  if ((bCorner || bMov) && !IsRotateAllowed(true))
1071  return PointerStyle::NotAllowed;
1072 
1073  // are 3D objects selected?
1074  bool b3DObjSelected = false;
1075  for (size_t a=0; !b3DObjSelected && a<GetMarkedObjectCount(); ++a) {
1077  if(dynamic_cast<const E3dObject* >(pObj) != nullptr)
1078  b3DObjSelected = true;
1079  }
1080  // If we have a 3D object, go on despite !IsShearAllowed,
1081  // because then we have a rotation instead of a shear.
1082  if (bVertex && !IsShearAllowed() && !b3DObjSelected)
1083  return PointerStyle::NotAllowed;
1084  if (bMov)
1085  return PointerStyle::Rotate;
1086  } break;
1087  case SdrDragMode::Shear: {
1088  if (bCorner) {
1089  if (!IsDistortAllowed(true) && !IsDistortAllowed()) return PointerStyle::NotAllowed;
1090  else return PointerStyle::RefHand;
1091  }
1092  if (bVertex && !IsShearAllowed()) return PointerStyle::NotAllowed;
1093  if (bMov) {
1094  if (!IsMoveAllowed()) return PointerStyle::Arrow; // because double click or drag & drop is possible
1095  return PointerStyle::Move;
1096  }
1097  } break;
1098  case SdrDragMode::Mirror: {
1099  if (bCorner || bVertex || bMov) {
1102  bool b90=false;
1103  bool b45=false;
1104  if (pH1!=nullptr && pH2!=nullptr) {
1105  Point aDif = pH2->GetPos()-pH1->GetPos();
1106  b90=(aDif.X()==0) || aDif.Y()==0;
1107  b45=b90 || (std::abs(aDif.X())==std::abs(aDif.Y()));
1108  }
1109  bool bNo=false;
1110  if (!IsMirrorAllowed(true,true)) bNo=true; // any mirroring is forbidden
1111  if (!IsMirrorAllowed() && !b45) bNo=true; // mirroring freely is forbidden
1112  if (!IsMirrorAllowed(true) && !b90) bNo=true; // mirroring horizontally/vertically is allowed
1113  if (bNo) return PointerStyle::NotAllowed;
1114  if (b90) {
1115  return PointerStyle::Mirror;
1116  }
1117  return PointerStyle::Mirror;
1118  }
1119  } break;
1120 
1122  {
1123  if(!IsTransparenceAllowed())
1124  return PointerStyle::NotAllowed;
1125 
1126  return PointerStyle::RefHand;
1127  }
1128 
1129  case SdrDragMode::Gradient:
1130  {
1131  if(!IsGradientAllowed())
1132  return PointerStyle::NotAllowed;
1133 
1134  return PointerStyle::RefHand;
1135  }
1136 
1137  case SdrDragMode::Crook: {
1138  if (bCorner || bVertex || bMov) {
1139  if (!IsCrookAllowed(true) && !IsCrookAllowed()) return PointerStyle::NotAllowed;
1140  return PointerStyle::Crook;
1141  }
1142  break;
1143  }
1144 
1145  case SdrDragMode::Crop:
1146  {
1147  return PointerStyle::Crop;
1148  }
1149 
1150  default: {
1151  if ((bCorner || bVertex) && !IsResizeAllowed(true)) return PointerStyle::NotAllowed;
1152  }
1153  }
1154  if (pHdl!=nullptr) return pHdl->GetPointer();
1155  if (bMov) {
1156  if (!IsMoveAllowed()) return PointerStyle::Arrow; // because double click or drag & drop is possible
1157  return PointerStyle::Move;
1158  }
1159  }
1161  return PointerStyle::Arrow;
1162 }
1163 
1164 constexpr OUStringLiteral STR_NOTHING = u"nothing";
1166 {
1167  OUString aName;
1168  OUString aStr = STR_NOTHING;
1169 
1170  if (mpCurrentCreate!=nullptr)
1171  {
1173 
1174  if(aStr.isEmpty())
1175  {
1177  aStr = SvxResId(STR_ViewCreateObj);
1178  }
1179  }
1180  else if (mpCurrentSdrDragMethod)
1181  {
1183  {
1184  aStr=maInsPointUndoStr;
1185  }
1186  else
1187  {
1188  if (maDragStat.IsMinMoved())
1189  {
1190  SAL_INFO(
1191  "svx.svdraw",
1192  "(" << this << ") " << mpCurrentSdrDragMethod.get());
1193  aStr = mpCurrentSdrDragMethod->GetSdrDragComment();
1194  }
1195  }
1196  }
1197  else if(IsMarkObj())
1198  {
1199  if(AreObjectsMarked())
1200  {
1201  aStr = SvxResId(STR_ViewMarkMoreObjs);
1202  }
1203  else
1204  {
1205  aStr = SvxResId(STR_ViewMarkObjs);
1206  }
1207  }
1208  else if(IsMarkPoints())
1209  {
1210  if(HasMarkedPoints())
1211  {
1212  aStr = SvxResId(STR_ViewMarkMorePoints);
1213  }
1214  else
1215  {
1216  aStr = SvxResId(STR_ViewMarkPoints);
1217  }
1218  } else if (IsMarkGluePoints())
1219  {
1220  if(HasMarkedGluePoints())
1221  {
1222  aStr = SvxResId(STR_ViewMarkMoreGluePoints);
1223  }
1224  else
1225  {
1226  aStr = SvxResId(STR_ViewMarkGluePoints);
1227  }
1228  }
1229  else if (IsTextEdit() && pTextEditOutlinerView!=nullptr) {
1230  aStr=SvxResId(STR_ViewTextEdit); // "TextEdit - Row y, Column x";
1232  tools::Long nPar=aSel.nEndPara,nLin=0,nCol=aSel.nEndPos;
1233  if (aSel.nEndPara>0) {
1234  for (sal_Int32 nParaNum=0; nParaNum<aSel.nEndPara; nParaNum++) {
1235  nLin+=pTextEditOutliner->GetLineCount(nParaNum);
1236  }
1237  }
1238  // A little imperfection:
1239  // At the end of a line of any multi-line paragraph, we display the
1240  // position of the next line of the same paragraph, if there is one.
1241  sal_uInt16 nParaLine = 0;
1242  sal_uLong nParaLineCount = pTextEditOutliner->GetLineCount(aSel.nEndPara);
1243  bool bBrk = false;
1244  while (!bBrk)
1245  {
1246  sal_uInt16 nLen = pTextEditOutliner->GetLineLen(aSel.nEndPara, nParaLine);
1247  bool bLastLine = (nParaLine == nParaLineCount - 1);
1248  if (nCol>nLen || (!bLastLine && nCol == nLen))
1249  {
1250  nCol -= nLen;
1251  nLin++;
1252  nParaLine++;
1253  }
1254  else
1255  bBrk = true;
1256 
1257  if (nLen == 0)
1258  bBrk = true; // to be sure
1259  }
1260 
1261  aStr = aStr.replaceFirst("%1", OUString::number(nPar + 1));
1262  aStr = aStr.replaceFirst("%2", OUString::number(nLin + 1));
1263  aStr = aStr.replaceFirst("%3", OUString::number(nCol + 1));
1264 
1265 #ifdef DBG_UTIL
1266  aStr += ", Level " + OUString::number( pTextEditOutliner->GetDepth( aSel.nEndPara ) );
1267 #endif
1268  }
1269 
1270  if(aStr == STR_NOTHING)
1271  {
1272  if (AreObjectsMarked()) {
1273  aStr = ImpGetDescriptionString(STR_ViewMarked);
1274  if (IsGluePointEditMode()) {
1275  if (HasMarkedGluePoints()) {
1277  }
1278  } else {
1279  if (HasMarkedPoints()) {
1281  }
1282  }
1283  } else {
1284  aStr.clear();
1285  }
1286  }
1287  else if(!aName.isEmpty())
1288  {
1289  aStr = aStr.replaceFirst("%1", aName);
1290  }
1291 
1292  if(!aStr.isEmpty())
1293  {
1294  // capitalize first letter
1295  aStr = aStr.replaceAt(0, 1, OUString(aStr[0]).toAsciiUpperCase());
1296  }
1297  return aStr;
1298 }
1299 
1301 {
1302  if( IsGluePointEditMode() )
1304 
1305  const size_t nMarkCount = GetMarkedObjectCount();
1306 
1307  if( HasMarkablePoints() && !IsFrameHandles() )
1308  {
1309  bool bPath=true;
1310  for( size_t nMarkNum = 0; nMarkNum < nMarkCount && bPath; ++nMarkNum )
1311  if (dynamic_cast<const SdrPathObj*>(GetMarkedObjectByIndex(nMarkNum)) == nullptr)
1312  bPath=false;
1313 
1314  if( bPath )
1316  }
1317 
1318  if( GetMarkedObjectCount() )
1319  {
1320  bool bGraf = true, bMedia = true, bTable = true;
1321 
1322  for( size_t nMarkNum = 0; nMarkNum < nMarkCount && ( bGraf || bMedia ); ++nMarkNum )
1323  {
1324  const SdrObject* pMarkObj = GetMarkedObjectByIndex( nMarkNum );
1325  DBG_ASSERT( pMarkObj, "SdrView::GetContext(), null pointer in mark list!" );
1326 
1327  if( !pMarkObj )
1328  continue;
1329 
1330  if( dynamic_cast<const SdrGrafObj*>( pMarkObj) == nullptr )
1331  bGraf = false;
1332 
1333  if( dynamic_cast<const SdrMediaObj*>( pMarkObj) == nullptr )
1334  bMedia = false;
1335 
1336  if( dynamic_cast<const sdr::table::SdrTableObj* >( pMarkObj ) == nullptr )
1337  bTable = false;
1338  }
1339 
1340  if( bGraf )
1341  return SdrViewContext::Graphic;
1342  else if( bMedia )
1343  return SdrViewContext::Media;
1344  else if( bTable )
1345  return SdrViewContext::Table;
1346  }
1347 
1348  return SdrViewContext::Standard;
1349 }
1350 
1352 {
1353  if (IsTextEdit()) {
1355  } else if (IsGluePointEditMode()) MarkAllGluePoints();
1356  else if (HasMarkablePoints()) MarkAllPoints();
1357  else {
1358  // check for table
1359  bool bMarkAll = true;
1360  const SdrMarkList& rMarkList = GetMarkedObjectList();
1361  if (rMarkList.GetMarkCount() == 1)
1362  {
1363  const SdrObject* pObj(rMarkList.GetMark(0)->GetMarkedSdrObj());
1364  SdrView* pView = this;
1365  if (pObj && pView && (pObj->GetObjInventor() == SdrInventor::Default)
1366  && (pObj->GetObjIdentifier() == OBJ_TABLE))
1367  {
1368  mxSelectionController.clear();
1370  *pView, static_cast<const sdr::table::SdrTableObj&>(*pObj),
1372 
1373  if (mxSelectionController.is())
1374  {
1375  mxLastSelectionController.clear();
1376  mxSelectionController->onSelectAll();
1377  bMarkAll = false;
1378  }
1379  }
1380  }
1381  if ( bMarkAll )
1382  MarkAllObj();
1383  }
1384 }
1385 
1387 {
1388  if (IsTextEdit()) {
1390  eSel.nStartPara=eSel.nEndPara;
1391  eSel.nStartPos=eSel.nEndPos;
1393  } else if (HasMarkedGluePoints()) UnmarkAllGluePoints();
1394  else if (HasMarkedPoints()) UnmarkAllPoints(); // Marked, not Markable!
1395  else UnmarkAllObj();
1396 }
1397 
1399 {
1401  return GetMarkedGluePointsRect();
1402  }
1403  if (HasMarkedPoints()) {
1404  return GetMarkedPointsRect();
1405  }
1406  return GetMarkedObjRect();
1407 }
1408 
1410 {
1411  if (IsTextEdit())
1412  {
1414  }
1415  else
1416  {
1417  if( mxSelectionController.is() && mxSelectionController->DeleteMarked() )
1418  {
1419  // action already performed by current selection controller, do nothing
1420  }
1421  else if (IsGluePointEditMode() && HasMarkedGluePoints())
1422  {
1424  }
1426  {
1428  }
1429  else
1430  {
1431  DeleteMarkedObj();
1432  }
1433  }
1434 }
1435 
1436 bool SdrView::BegMark(const Point& rPnt, bool bAddMark, bool bUnmark)
1437 {
1438  if (bUnmark) bAddMark=true;
1439  if (IsGluePointEditMode()) {
1440  if (!bAddMark) UnmarkAllGluePoints();
1441  return BegMarkGluePoints(rPnt,bUnmark);
1442  } else if (HasMarkablePoints()) {
1443  if (!bAddMark) UnmarkAllPoints();
1444  return BegMarkPoints(rPnt,bUnmark);
1445  } else {
1446  if (!bAddMark) UnmarkAllObj();
1447  BegMarkObj(rPnt,bUnmark);
1448  return true;
1449  }
1450 }
1451 
1452 bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint, const sal_Int32 aObjectOrdNum)
1453 {
1454  if (GetHdlList().IsMoveOutside())
1455  return false;
1456 
1457  if (!GetMarkedObjectList().GetMarkCount())
1458  return false;
1459 
1460  SdrHdl * pHdl = GetHdlList().GetHdl(handleNum);
1461  if (pHdl == nullptr)
1462  return false;
1463 
1464  SdrDragStat& rDragStat = const_cast<SdrDragStat&>(GetDragStat());
1465  // start dragging
1466  BegDragObj(pHdl->GetPos(), nullptr, pHdl, 0);
1467  if (!IsDragObj())
1468  return false;
1469 
1470  bool bWasNoSnap = rDragStat.IsNoSnap();
1471  bool bWasSnapEnabled = IsSnapEnabled();
1472 
1473  // switch snapping off
1474  if(!bWasNoSnap)
1475  rDragStat.SetNoSnap();
1476  if(bWasSnapEnabled)
1477  SetSnapEnabled(false);
1478 
1479  if (aObjectOrdNum != -1)
1480  {
1481  rDragStat.GetGlueOptions().objectOrdNum = aObjectOrdNum;
1482  }
1483  MovDragObj(aEndPoint);
1484  EndDragObj();
1485 
1486  // Clear Glue Options
1487  rDragStat.GetGlueOptions().objectOrdNum = -1;
1488 
1489  if (!bWasNoSnap)
1490  rDragStat.SetNoSnap(bWasNoSnap);
1491  if (bWasSnapEnabled)
1492  SetSnapEnabled(bWasSnapEnabled);
1493 
1494  return true;
1495 }
1496 
1498 {
1501 }
1502 
1503 
1506 {
1507 }
1508 
1510 {
1511  if(mbMasterPagePaintCaching == bOn)
1512  return;
1513 
1515 
1516  // reset at all SdrPageWindows
1517  SdrPageView* pPageView = GetSdrPageView();
1518 
1519  if(!pPageView)
1520  return;
1521 
1522  for(sal_uInt32 b(0); b < pPageView->PageWindowCount(); b++)
1523  {
1524  SdrPageWindow* pPageWindow = pPageView->GetPageWindow(b);
1525  assert(pPageWindow && "SdrView::SetMasterPagePaintCaching: Corrupt SdrPageWindow list (!)");
1526 
1527  // force deletion of ObjectContact, so at re-display all VOCs
1528  // will be re-created with updated flag setting
1529  pPageWindow->ResetObjectContact();
1530  }
1531 
1532  // force redraw of this view
1533  pPageView->InvalidateAllWin();
1534 }
1535 
1536 // Default ObjectContact is ObjectContactOfPageView
1538  SdrPageWindow& rPageWindow,
1539  const char* pDebugName) const
1540 {
1541  return new sdr::contact::ObjectContactOfPageView(rPageWindow, pDebugName);
1542 }
1543 
1544 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 mnMinMovLog
Definition: svdpntv.hxx:150
virtual bool HasTextEdit() const
Definition: svdobj.cxx:1757
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
Definition: svdmrkv.cxx:2513
OutDevType GetOutDevType() const
ConfigurationHints
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
Definition: svdobj.cxx:1126
bool IsTextEditInSelectionMode() const
Definition: svdedxv.cxx:2347
bool IsMacroHit(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1893
OUString maInsPointUndoStr
Definition: svddrgv.hxx:45
void CaptureMouse()
Point GetPointerPosPixel()
void SetTargetFrame(const OUString &rFrm)
sal_Int32 nStartPara
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr)
Definition: svddrgv.cxx:183
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
bool EndCreateObj(SdrCreateCmd eCmd)
Definition: svdcrtv.cxx:587
size_t GetMarkCount() const
Definition: svdmark.hxx:178
PointerStyle GetPreferredPointer(const Point &rMousePos, const OutputDevice *pOut, sal_uInt16 nModifier=0, bool bLeftDown=false) const
Definition: svdview.cxx:952
PointerStyle GetDraggedHelpLinePointer() const
Definition: svdsnpv.cxx:548
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:957
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
Definition: svdedxv.cxx:1410
virtual void onAccessibilityOptionsChanged()
method is called whenever the global SvtAccessibilityOptions is changed
Definition: svdview.cxx:1505
sal_uInt16 mnMouseCode
Definition: svdview.hxx:111
constexpr sal_uInt16 KEY_MOD1
void SortMarkedObjects() const
Definition: svdmrkv.hxx:258
std::unique_ptr< SdrDragMethod > mpCurrentSdrDragMethod
Definition: svddrgv.hxx:42
OUString GetStatusText()
Definition: svdview.cxx:1165
bool mbMarkedHitMovesAlways
Definition: svddrgv.hxx:49
bool mbMouseDown
Definition: svdview.hxx:115
bool IsHlplVisible() const
Draw Help line of the Page or not.
Definition: svdpntv.hxx:372
bool UnmarkAllGluePoints()
Definition: svdmrkv.hxx:391
bool IsResizeAllowed(bool bProp=false) const
Definition: svdedtv.cxx:391
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const
Definition: svdobj.cxx:1367
std::unique_ptr< SdrOutliner > pTextEditOutliner
Definition: svdedxv.hxx:86
bool mbInsPolyPoint
Definition: svdmrkv.hxx:125
virtual bool MouseButtonDown(const MouseEvent &rMEvt, OutputDevice *pWin) override
Definition: svdview.cxx:201
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
bool IsMacroObj() const
Definition: svdedxv.hxx:271
bool BegCreateObj(const Point &rPnt, OutputDevice *pOut=nullptr, short nMinMov=-3)
Definition: svdcrtv.cxx:493
void DeleteMarkedPoints() override
Definition: svdpoev.cxx:286
virtual SdrViewContext GetContext() const
Definition: svdview.cxx:1300
rtl::Reference< sdr::SelectionController > mxLastSelectionController
Definition: svdedxv.hxx:108
bool mbIsTextEdit
Definition: svdview.hxx:118
constexpr tools::Long Left() const
SdrHdlKind
Definition: svdhdl.hxx:52
KeyFuncType GetFullFunction() const
bool AreObjectsMarked() const
Definition: svdmrkv.hxx:259
void MarkAll()
Definition: svdview.cxx:1351
const SdrDragStat & GetDragStat() const
Definition: svdpntv.hxx:286
sal_uIntPtr sal_uLong
MouseEventModifiers GetMode() const
long Long
SdrMouseEventKind
Definition: svdview.hxx:89
constexpr sal_uInt16 KEY_A
bool EndDragObj(bool bCopy=false)
Definition: svddrgv.cxx:531
SdrViewContext
Definition: svdview.hxx:54
bool IsInsObjPoint() const
Definition: svddrgv.hxx:123
rtl::Reference< sdr::SelectionController > CreateTableController(SdrView &rView, const SdrTableObj &rObj, const rtl::Reference< sdr::SelectionController > &xRefController)
sal_uInt16 mnHlplIdx
Definition: svdview.hxx:112
bool IsTransparenceAllowed() const
Definition: svdedtv.cxx:416
const tools::Rectangle & GetMarkedGluePointsRect() const
Definition: svdmrkv1.cxx:539
bool mbMarkPrev
Definition: svdview.hxx:122
bool IsInsObjPointMode() const
Definition: svddrgv.hxx:128
SdrObject * GetObj() const
Definition: svdhdl.hxx:203
SdrDragStat maDragStat
Definition: svdpntv.hxx:140
SdrHdl * mpHdl
Definition: svdview.hxx:99
virtual OUString TakeObjNameSingul() const
Definition: svdobj.cxx:1082
const OUString & getHyperlink() const
Definition: svdobj.hxx:872
SdrMark * GetMark(size_t nNum) const
Definition: svdmark.cxx:230
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr) const
Definition: svdcrtv.cxx:861
void append(std::unique_ptr< OverlayObject > pOverlayObject)
SdrEventKind
Definition: svdview.hxx:63
const SvxURLField * mpURLField
Definition: svdview.hxx:103
const Point & GetPos() const
Definition: svdhdl.hxx:197
bool HasMarkedGluePoints() const
Definition: svdmrkv1.cxx:378
#define PRIMITIVE2D_ID_TEXTHIERARCHYFIELDPRIMITIVE2D
bool IsExtendedKeyInputDispatcherEnabled() const
Definition: svdview.hxx:178
SdrHitKind PickAnything(const MouseEvent &rMEvt, SdrMouseEventKind nMouseDownOrMoveOrUp, SdrViewEvent &rVEvt) const
Definition: svdview.cxx:254
media shape
Definition: svdobjkind.hxx:57
void SetMouseDown(bool bDown)
Definition: svddrag.hxx:151
const SdrHelpLineList & GetHelpLines() const
Definition: svdpagv.hxx:216
bool IsMoveAllowed() const
Definition: svdedtv.hxx:234
#define MODKEY_Unmark
Definition: svdview.cxx:290
virtual bool HasText() const override
Definition: svdotxat.cxx:417
sal_uInt16 mnGlueId
Definition: svdview.hxx:113
MouseEventModifiers
virtual PointerStyle GetPointer() const
Definition: svdhdl.cxx:952
bool BegMarkPoints(const Point &rPnt, bool bUnmark=false)
Definition: svdmrkv.cxx:433
const tools::Rectangle & GetMarkedObjRect() const
Definition: svdmrkv.cxx:2582
NONE
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1666
virtual bool MouseButtonUp(const MouseEvent &rMEvt, OutputDevice *pWin) override
Definition: svdedxv.cxx:1871
SdrModel * mpModel
Definition: svdpntv.hxx:125
bool MarkGluePoint(const SdrObject *pObj, sal_uInt16 nId, bool bUnmark)
Definition: svdmrkv1.cxx:477
virtual void ConfigurationChanged(utl::ConfigurationBroadcaster *, ConfigurationHints) override
Definition: svdview.cxx:1497
sal_uInt16 GetClicks() const
SdrDropMarkerOverlay(const SdrView &rView, const SdrObject &rObject)
Definition: svdview.cxx:106
bool MarkAllPoints()
Definition: svdmrkv.hxx:340
sal_uInt16 mnHitTolLog
Definition: svdpntv.hxx:149
bool MoveShapeHandle(const sal_uInt32 handleNum, const Point &aEndPoint, const sal_Int32 aObjectOrdNum=-1)
Definition: svdview.cxx:1452
constexpr sal_uInt16 KEY_REPEAT
SdrPageWindow * GetPageWindow(sal_uInt32 nIndex) const
Definition: svdpagv.cxx:83
void ImplCreateOverlays(const SdrView &rView, const basegfx::B2DPolyPolygon &rLinePolyPolygon)
Definition: svdview.cxx:86
SvtAccessibilityOptions maAccessibilityOptions
Definition: svdview.hxx:155
bool IsEditMode() const
Definition: svdmrkv.hxx:228
sal_uInt16 GetButtons() const
void Undo()
Definition: svdmodel.cxx:282
OUTDEV_WINDOW
void MarkNextPoint()
Definition: svdmrkv1.cxx:230
void SetDragWithCopy(bool bOn)
Definition: svddrgv.hxx:112
bool mbIsAction
Definition: svdview.hxx:117
bool IsDragHelpLine() const
Definition: svdsnpv.hxx:207
constexpr sal_uInt16 KEY_UNDO
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
bool mbMouseUp
Definition: svdview.hxx:116
void SetResizeAtCenter(bool bOn)
Definition: svddrgv.hxx:190
oslFileHandle & pOut
SdrObject * SdrObjectPrimitiveHit(const SdrObject &rObject, const Point &rPnt, sal_uInt16 nTol, const SdrPageView &rSdrPageView, const SdrLayerIDSet *pVisiLayer, bool bTextOnly, drawinglayer::primitive2d::Primitive2DContainer *pHitContainer)
auto & GetGlueOptions()
Definition: svddrag.hxx:172
#define MODKEY_PolyPoly
Definition: svdview.cxx:288
sal_uInt16 GetModifier() const
PointerStyle maCurrentCreatePointer
Definition: svdcrtv.hxx:48
bool IsRotateAllowed(bool b90Deg=false) const
Definition: svdedtv.cxx:399
OutputDevice * GetFirstOutputDevice() const
Definition: svdpntv.cxx:89
bool IsMarkGluePoints() const
Definition: svdmrkv.hxx:407
sal_Int32 nEndPos
bool BegMarkGluePoints(const Point &rPnt, bool bUnmark=false)
Definition: svdmrkv.cxx:497
void UnmarkAll()
Definition: svdview.cxx:1386
void BegMacroObj(const Point &rPnt, short nTol, SdrObject *pObj, SdrPageView *pPV, vcl::Window *pWin)
Definition: svdedxv.cxx:2354
bool MarkAllGluePoints()
Definition: svdmrkv.hxx:390
PointerStyle GetPointer(const Point &rPosPixel)
void SetSnapEnabled(bool bOn)
Definition: svdsnpv.hxx:171
#define MODKEY_AngleSnap
Definition: svdview.cxx:284
bool IsInsObjPointPossible() const
Definition: svddrgv.cxx:632
#define MOUSE_LEFT
SdrPageView * mpPV
Definition: svdview.hxx:102
bool IsMinMoved() const
Definition: svddrag.hxx:118
SdrInventor mnCurrentInvent
Definition: svdcrtv.hxx:52
sal_uInt32 PaintWindowCount() const
Definition: svdpntv.hxx:218
void ResetObjectContact()
const tools::Rectangle & GetMarkedRect() const
Definition: svdview.cxx:1398
virtual bool HasMarkedPoints() const
Definition: svdmrkv1.cxx:65
SdrObjList * GetObjList() const
Return current List.
Definition: svdpagv.hxx:169
SdrObject * GetMarkedSdrObj() const
Definition: svdmark.hxx:68
#define MODKEY_DeepBackw
Definition: svdview.cxx:293
SdrHitKind
Definition: svdmrkv.hxx:57
virtual bool MouseMove(const MouseEvent &rMEvt, OutputDevice *pWin) override
handle mouse over effects for handles
Definition: svdcrtv.cxx:297
void MarkAllObj(SdrPageView *pPV=nullptr)
Definition: svdmrkv.cxx:2533
void MarkNextGluePoint()
Definition: svdmrkv1.cxx:533
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
Definition: svdmrkv.cxx:2372
SdrDragMode meDragMode
Definition: svdmrkv.hxx:118
const SdrLayerIDSet & GetVisibleLayers() const
Definition: svdpagv.hxx:210
void SetNoSnap(bool bOn=true)
Definition: svddrag.hxx:131
bool IsShearAllowed() const
Definition: svdedtv.cxx:434
sal_Int32 nEndPara
bool IsHlplFront() const
Draw Help line in front of the objects or behind them.
Definition: svdpntv.hxx:375
VclPtr< vcl::Window > pTextEditWin
Definition: svdedxv.hxx:88
bool BegMark(const Point &rPnt, bool bAddMark, bool bUnmark)
Definition: svdview.cxx:1436
void InvalidateAllWin()
Invalidates the Page's whole area.
Definition: svdpagv.cxx:195
#define DBG_ASSERT(sCon, aError)
void Repeat(SfxRepeatTarget &)
Definition: svdmodel.cxx:326
bool IsInsGluePointPossible() const
Definition: svddrgv.cxx:711
#define MODKEY_CopyDrag
Definition: svdview.cxx:285
uno_Any a
#define EE_PARA_ALL
void SetRepresentation(const OUString &rRep)
bool IsMarkObj() const
Definition: svdmrkv.hxx:211
size_t GetMarkedObjectCount() const
Definition: svdmrkv.hxx:257
virtual bool MouseButtonUp(const MouseEvent &rMEvt, OutputDevice *pWin) override
Definition: svdview.cxx:214
bool IsSnapEnabled() const
Definition: svdsnpv.hxx:164
void MovDragObj(const Point &rPnt)
Definition: svddrgv.cxx:506
bool IsSelected() const
Definition: svdhdl.hxx:206
connector object
Definition: svdobjkind.hxx:48
bool DoMouseEvent(const SdrViewEvent &rVEvt)
Definition: svdview.cxx:753
#define MODKEY_MultiMark
Definition: svdview.cxx:289
const SdrMarkList & GetMarkedObjectList() const
Definition: svdmrkv.hxx:251
constexpr OUStringLiteral STR_NOTHING
Definition: svdview.cxx:1164
#define MODKEY_DeepMark
Definition: svdview.cxx:292
virtual bool KeyInput(const KeyEvent &rKEvt, vcl::Window *pWin) override
Definition: svdedxv.cxx:1792
bool IsTextEditHit(const Point &rHit) const
Definition: svdedxv.cxx:1715
virtual bool SdrBeginTextEdit(SdrObject *pObj, SdrPageView *pPV=nullptr, vcl::Window *pWin=nullptr, bool bIsNewObj=false, SdrOutliner *pGivenOutliner=nullptr, OutlinerView *pGivenOutlinerView=nullptr, bool bDontDeleteOutliner=false, bool bOnlyOneView=false, bool bGrabFocus=true)
Definition: svdedxv.cxx:1063
bool BegInsGluePoint(const Point &rPnt)
Definition: svddrgv.cxx:733
bool IsGluePointEditMode() const
Definition: svdmrkv.hxx:232
constexpr tools::Long Right() const
#define MODKEY_ForceMark
Definition: svdview.cxx:291
SdrObject * mpRootObj
Definition: svdview.hxx:101
float u
SdrHdl * PickHandle(const Point &rPnt) const
Definition: svdmrkv.cxx:1875
virtual bool HasMacro() const
Definition: svdobj.cxx:1851
constexpr tools::Long Top() const
const OutlinerView * GetTextEditOutlinerView() const
Definition: svdedxv.hxx:238
void BegMarkObj(const Point &rPnt, bool bUnmark=false)
Definition: svdmrkv.cxx:377
sdr::overlay::OverlayObjectList maObjects
Definition: svdview.hxx:133
void SetMasterPagePaintCaching(bool bOn)
Definition: svdview.cxx:1509
void SetCrookAtCenter(bool bOn)
Definition: svddrgv.hxx:195
void DeleteMarkedGluePoints()
Definition: svdglev.cxx:222
Point PixelToLogic(const Point &rDevicePt) const
bool mbUnmark
Definition: svdview.hxx:120
#define MODKEY_Center
Definition: svdview.cxx:283
sal_uInt16 GetModifier() const
const SdrLayerIDSet * pVisiLayer
Definition: svdobj.hxx:139
void SetActualWin(const OutputDevice *pWin)
Definition: svdsnpv.hxx:154
constexpr sal_uInt16 KEY_MOD2
bool IsTextTool() const
Definition: svdcrtv.cxx:316
Abstract DrawObject.
Definition: svdobj.hxx:259
bool IsCreateMode() const
Definition: svdmrkv.hxx:230
Point ScreenToOutputPixel(const Point &rPos) const
bool MarkNextObj(bool bPrev=false)
Definition: svdmrkv.cxx:1897
bool PickGluePoint(const Point &rPnt, SdrObject *&rpObj, sal_uInt16 &rnId, SdrPageView *&rpPV) const
Definition: svdmrkv1.cxx:441
TableHitKind CheckTableHit(const Point &rPos, sal_Int32 &rnX, sal_Int32 &rnY, const sal_uInt16 aTol=0) const
Definition: svdotable.cxx:1187
void SetFormat(SvxURLFormat eFmt)
virtual bool MouseButtonDown(const MouseEvent &rMEvt, OutputDevice *pWin) override
Definition: svdedxv.cxx:1827
sal_uInt16 nMacroTol
Definition: svdedxv.hxx:99
virtual sdr::contact::ObjectContact * createViewSpecificObjectContact(SdrPageWindow &rPageWindow, const char *pDebugName) const
Definition: svdview.cxx:1537
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:678
constexpr tools::Long Bottom() const
bool IsCreateObj() const
Definition: svdcrtv.hxx:119
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
void ConfigurationChanged(::utl::ConfigurationBroadcaster *, ConfigurationHints) override
Definition: svdpntv.cxx:231
void ReleaseMouse()
ESelection GetSelection() const
const SdrLayerIDSet & GetLockedLayers() const
Definition: svdpagv.hxx:214
virtual bool IsAction() const override
Definition: svdcrtv.cxx:202
void SetAngleSnapEnabled(bool bOn)
Definition: svdsnpv.hxx:221
bool IsSet(SdrLayerID a) const
Definition: svdsob.hxx:64
bool IsInsGluePointMode() const
Definition: svddrgv.hxx:137
SdrViewEditMode meEditMode
Definition: svdmrkv.hxx:119
bool mbAddMark
Definition: svdview.hxx:119
bool mbMasterPagePaintCaching
Definition: svdview.hxx:153
void SetPointer(PointerStyle)
SdrHdl * GetHdl(size_t nNum) const
Definition: svdhdl.hxx:460
SdrObject * mpCurrentCreate
Definition: svdcrtv.hxx:40
void setClosed(bool bNew)
const vcl::KeyCode & GetKeyCode() const
void ForceMarkedObjToAnotherPage()
Definition: svdedtv.cxx:682
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
bool IsEffectivelyVertical() const
void SetSelection(const ESelection &)
bool IsMarkPoints() const
Definition: svdmrkv.hxx:361
bool IsFrameHandles() const
Definition: svdmrkv.hxx:219
MouseEventModifiers mnMouseMode
Definition: svdview.hxx:110
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:341
virtual bool IsTextEdit() const final override
Definition: svdedxv.cxx:1673
virtual PointerStyle GetMacroPointer(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1866
#define MODKEY_NoSnap
Definition: svdview.cxx:281
size_t GetFontHeight()
Definition: svdetc.hxx:74
bool mbPrevNextMark
Definition: svdview.hxx:121
SdrObject * mpObj
Definition: svdview.hxx:100
virtual OutlinerParaObject * GetOutlinerParaObject() const override
Definition: svdotext.cxx:1330
constexpr sal_uInt16 KEY_ESCAPE
void DeleteMarkedObj()
Definition: svdedtv.cxx:796
OUString getValue(const OUString &rName) const
SdrHitKind meHit
Definition: svdview.hxx:106
#define SAL_INFO(area, stream)
OUString aName
OutlinerView * pTextEditOutlinerView
Definition: svdedxv.hxx:87
virtual bool Command(const CommandEvent &rCEvt, vcl::Window *pWin) override
Definition: svdedxv.cxx:1952
virtual bool Command(const CommandEvent &rCEvt, vcl::Window *pWin) override
Definition: svdview.cxx:242
virtual ~SdrView() override
Definition: svdview.cxx:160
bool IsQuickTextEditMode() const
Definition: svdedxv.hxx:188
::OutputDevice const * GetOutDev() const
SdrPageView * pMacroPV
Definition: svdedxv.hxx:91
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const
Definition: svdview.cxx:249
void SetOrtho(bool bOn)
Definition: svdsnpv.hxx:245
bool IsLeft() const
virtual PointerStyle GetCreatePointer() const
get the cursor/pointer that signals creating this object
Definition: svdobj.cxx:1427
bool IsSetPageOrg() const
Definition: svdsnpv.hxx:190
bool BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView *pPV)
Definition: svdsnpv.cxx:509
virtual void DeleteMarked()
Definition: svdview.cxx:1409
bool KeyInput(const KeyEvent &rKEvt, vcl::Window *pWin) override
Definition: svdview.cxx:165
bool IsVertexHdl() const
Definition: svdhdl.hxx:213
SdrHdl * GetGluePointHdl(const SdrObject *pObj, sal_uInt16 nId) const
Definition: svdmrkv1.cxx:520
bool IsGradientAllowed() const
Definition: svdedtv.cxx:428
const Point & GetPosPixel() const
SdrObject * GetMarkedObjectByIndex(size_t nNum) const
Definition: svdmrkv.hxx:256
constexpr sal_uInt16 KEY_BACKSPACE
PointerStyle
bool IsCrookAllowed(bool bNoContortion=false) const
Definition: svdedtv.cxx:447
sal_uInt16 GetFullCode() const
SdrObject * getParentSdrObjectFromSdrObject() const
Definition: svdobj.cxx:753
SdrPageView * GetSdrPageView() const
Definition: svdpntv.hxx:299
void Redo()
Definition: svdmodel.cxx:304
bool BegCreateCaptionObj(const Point &rPnt, const Size &rObjSiz, OutputDevice *pOut=nullptr, short nMinMov=-3)
Definition: svdcrtv.cxx:512
SdrView(SdrModel &rSdrModel, OutputDevice *pOut=nullptr)
Definition: svdview.cxx:148
Point maLogicPos
Definition: svdview.hxx:105
const tools::Rectangle & GetMarkedPointsRect() const
Definition: svdmrkv1.cxx:236
bool IsDragObj() const
Definition: svddrgv.hxx:103
bool BegInsObjPoint(const Point &rPnt, bool bNewObj)
Definition: svddrgv.hxx:120
virtual void MovAction(const Point &rPnt) override
Definition: svdcrtv.cxx:207
virtual bool MouseMove(const MouseEvent &rMEvt, OutputDevice *pWin) override
handle mouse over effects for handles
Definition: svdview.cxx:228
SdrHdlList maHdlList
Definition: svdmrkv.hxx:107
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
Definition: svdmrkv.cxx:1883
constexpr sal_uInt16 KEY_DELETE
const SdrHdlList & GetHdlList() const
Definition: svdmrkv.hxx:353
sal_uInt16 nTol
Definition: svdobj.hxx:141
bool IsCornerHdl() const
Definition: svdhdl.hxx:212
bool IsPointMarkable(const SdrHdl &rHdl) const
Definition: svdmrkv1.cxx:82
bool PickHelpLine(const Point &rPnt, short nTol, const OutputDevice &rOut, sal_uInt16 &rnHelpLineNum, SdrPageView *&rpPV) const
Definition: svdsnpv.cxx:489
#define MODKEY_Ortho
Definition: svdview.cxx:282
SdrObjList * getParentSdrObjListFromSdrObject() const
Definition: svdobj.cxx:305
OUString ImpGetDescriptionString(TranslateId pStrCacheID, ImpGetDescriptionOptions nOpt=ImpGetDescriptionOptions::NONE) const
Definition: svdmrkv.cxx:2602
void SetURL(const OUString &rURL)
SdrEventKind meEvent
Definition: svdview.hxx:107
virtual void BrkAction() override
Definition: svdcrtv.cxx:227
SdrCreateCmd
Definition: svdtypes.hxx:26
virtual bool MarkPoint(SdrHdl &rHdl, bool bUnmark=false)
Definition: svdmrkv1.cxx:167
constexpr sal_uInt16 KEY_SHIFT
void SetCreate1stPointAsCenter(bool bOn)
Definition: svdcrtv.hxx:134
bool IsInsertGluePoint() const
Definition: svddrgv.hxx:116
bool IsDragWithCopy() const
Definition: svddrgv.hxx:113
bool IsMarking() const
Definition: svdmrkv.hxx:204
rtl::Reference< sdr::SelectionController > mxSelectionController
Definition: svdedxv.hxx:107
SdrObjKind mnCurrentIdent
Definition: svdcrtv.hxx:53
sal_uInt16 mnMouseClicks
Definition: svdview.hxx:109
virtual vcl::Window * GetOwnerWindow() const
#define MOUSE_RIGHT
#define EE_TEXTPOS_ALL
SdrObject * pMacroObj
Definition: svdedxv.hxx:90
virtual void BckAction() override
Definition: svdcrtv.cxx:221
bool IsNoSnap() const
Definition: svddrag.hxx:130
aStr
bool IsExtendedMouseEventDispatcherEnabled() const
Definition: svdview.hxx:175
VclPtr< OutputDevice > mpActualOutDev
Definition: svdpntv.hxx:126
bool EndInsObjPoint(SdrCreateCmd eCmd)
Definition: svddrgv.cxx:695
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
Definition: svdpntv.cxx:73
const SdrPageView * pPageView
Definition: svdobj.hxx:140
SdrHdlKind GetKind() const
Definition: svdhdl.hxx:194
bool IsDistortAllowed(bool bNoContortion=false) const
Definition: svdedtv.cxx:459
virtual void EndAction() override
Definition: svdcrtv.cxx:215
bool IsOrthoDesired() const
Definition: svddrgv.cxx:885
virtual bool HasMarkablePoints() const
Definition: svdmrkv1.cxx:29
sal_Int32 nStartPos
sal_uInt32 PageWindowCount() const
Definition: svdpagv.hxx:89
bool IsObjMarked(SdrObject const *pObj) const
Definition: svdmrkv.cxx:2150