LibreOffice Module svx (master)  1
svdmrkv.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 <svx/svdmrkv.hxx>
22 #include <svx/svdview.hxx>
23 #include <svx/svdpagv.hxx>
24 #include <svx/svdpage.hxx>
25 #include <svx/svdotable.hxx>
26 
27 #include <osl/diagnose.h>
28 #include <osl/thread.h>
29 #include <rtl/strbuf.hxx>
30 #include <svx/svdoole2.hxx>
31 #include <svx/xgrad.hxx>
32 #include <svx/xfillit0.hxx>
33 #include <svx/xflgrit.hxx>
34 #include "gradtrns.hxx"
35 #include <svx/xflftrit.hxx>
36 #include <svx/dialmgr.hxx>
37 #include <svx/strings.hrc>
38 #include <svx/svdundo.hxx>
39 #include <svx/svdopath.hxx>
40 #include <svx/scene3d.hxx>
41 #include <svx/svdovirt.hxx>
48 #include <svx/sdrpaintwindow.hxx>
49 #include <svx/sdrpagewindow.hxx>
50 #include <svx/sdrhittesthelper.hxx>
51 #include <vcl/uitest/logger.hxx>
53 #include <vcl/window.hxx>
54 
55 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
56 #include <comphelper/lok.hxx>
57 #include <sfx2/lokhelper.hxx>
58 #include <sfx2/lokcharthelper.hxx>
59 #include <sfx2/viewsh.hxx>
60 
61 #include <array>
62 
63 #include <com/sun/star/frame/XController.hpp>
64 #include <com/sun/star/view/XSelectionSupplier.hpp>
65 
66 #include <boost/property_tree/json_parser.hpp>
67 #include <boost/optional/optional.hpp>
68 #include <tools/UnitConversion.hxx>
69 
70 using namespace com::sun::star;
71 
72 // Migrate Marking of Objects, Points and GluePoints
73 
75 {
76  // The OverlayObjects
78 
79  // The remembered second position in logical coordinates
81 
82  // A flag to remember if the action is for unmarking.
83  bool mbUnmarking : 1;
84 
85 public:
86  ImplMarkingOverlay(const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos, bool bUnmarking);
87 
88  // The OverlayObjects are cleared using the destructor of OverlayObjectList.
89  // That destructor calls clear() at the list which removes all objects from the
90  // OverlayManager and deletes them.
91 
92  void SetSecondPosition(const basegfx::B2DPoint& rNewPosition);
93  bool IsUnmarking() const { return mbUnmarking; }
94 };
95 
96 ImplMarkingOverlay::ImplMarkingOverlay(const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos, bool bUnmarking)
97 : maSecondPosition(rStartPos),
98  mbUnmarking(bUnmarking)
99 {
101  return; // We do client-side object manipulation with the Kit API
102 
103  for(sal_uInt32 a(0); a < rView.PaintWindowCount(); a++)
104  {
105  SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
106  const rtl::Reference< sdr::overlay::OverlayManager >& xTargetOverlay = pCandidate->GetOverlayManager();
107 
108  if (xTargetOverlay.is())
109  {
110  std::unique_ptr<sdr::overlay::OverlayRollingRectangleStriped> pNew(new sdr::overlay::OverlayRollingRectangleStriped(
111  rStartPos, rStartPos, false));
112  xTargetOverlay->add(*pNew);
113  maObjects.append(std::move(pNew));
114  }
115  }
116 }
117 
119 {
120  if(rNewPosition != maSecondPosition)
121  {
122  // apply to OverlayObjects
123  for(sal_uInt32 a(0); a < maObjects.count(); a++)
124  {
126  rCandidate.setSecondPosition(rNewPosition);
127  }
128 
129  // remember new position
130  maSecondPosition = rNewPosition;
131  }
132 }
133 
135 {
137 
138 public:
139  MarkingSubSelectionOverlay(const SdrPaintView& rView, std::vector<basegfx::B2DRectangle> const & rSelections)
140  {
142  return; // We do client-side object manipulation with the Kit API
143 
144  for (sal_uInt32 a(0); a < rView.PaintWindowCount(); a++)
145  {
146  SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
147  const rtl::Reference<sdr::overlay::OverlayManager>& xTargetOverlay = pCandidate->GetOverlayManager();
148 
149  if (xTargetOverlay.is())
150  {
151  const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
152  const Color aHighlightColor = aSvtOptionsDrawinglayer.getHilightColor();
153 
154  std::unique_ptr<sdr::overlay::OverlaySelection> pNew =
155  std::make_unique<sdr::overlay::OverlaySelection>(
157  aHighlightColor, rSelections, false);
158 
159  xTargetOverlay->add(*pNew);
160  maObjects.append(std::move(pNew));
161  }
162  }
163  }
164 };
165 
167  : SdrSnapView(rSdrModel, pOut)
168  , mpMarkedObj(nullptr)
169  , mpMarkedPV(nullptr)
170  , maHdlList(this)
171  , meDragMode(SdrDragMode::Move)
172  , meEditMode(SdrViewEditMode::Edit)
173  , meEditMode0(SdrViewEditMode::Edit)
174  , mbDesignMode(false)
175  , mbForceFrameHandles(false)
176  , mbPlusHdlAlways(false)
177  , mbInsPolyPoint(false)
178  , mbMarkedObjRectDirty(false)
179  , mbMrkPntDirty(false)
180  , mbMarkedPointsRectsDirty(false)
181  , mbMarkHandlesHidden(false)
182 {
183 
184  BrkMarkObj();
185  BrkMarkPoints();
187 
188  StartListening(rSdrModel);
189 }
190 
192 {
193  // Migrate selections
194  BrkMarkObj();
195  BrkMarkPoints();
197 }
198 
200 {
201  if (rHint.GetId() == SfxHintId::ThisIsAnSdrHint)
202  {
203  const SdrHint* pSdrHint = static_cast<const SdrHint*>(&rHint);
204  SdrHintKind eKind=pSdrHint->GetKind();
206  {
209  }
210  }
211  SdrSnapView::Notify(rBC,rHint);
212 }
213 
215 {
220  // Example: Obj is selected and maMarkedObjectList is sorted.
221  // In another View 2, the ObjOrder is changed (e. g. MovToTop())
222  // Then we need to re-sort MarkList.
225  mbMrkPntDirty=true;
226  UndirtyMrkPnt();
227  SdrView* pV=static_cast<SdrView*>(this);
228  if (pV!=nullptr && !pV->IsDragObj() && !pV->IsInsObjPoint()) {
229  AdjustMarkHdl();
230  }
231 
233  return;
234 
235  //TODO: Is MarkedObjRect valid at this point?
236  tools::Rectangle aSelection(GetMarkedObjRect());
237  OString sSelection;
238  if (aSelection.IsEmpty())
239  sSelection = "EMPTY";
240  else
241  {
242  sal_uInt32 nTotalPaintWindows = this->PaintWindowCount();
243  if (nTotalPaintWindows == 1)
244  {
245  const vcl::Window* pWin = dynamic_cast<const vcl::Window*>(this->GetFirstOutputDevice());
246  if (pWin && pWin->IsChart())
247  {
248  const vcl::Window* pViewShellWindow = GetSfxViewShell()->GetEditWindowForActiveOLEObj();
249  if (pViewShellWindow && pViewShellWindow->IsAncestorOf(*pWin))
250  {
251  Point aOffsetPx = pWin->GetOffsetPixelFrom(*pViewShellWindow);
252  Point aLogicOffset = pWin->PixelToLogic(aOffsetPx);
253  aSelection.Move(aLogicOffset.getX(), aLogicOffset.getY());
254  }
255  }
256  }
257 
258  // In case the map mode is in 100th MM, then need to convert the coordinates over to twips for LOK.
259  if (mpMarkedPV)
260  {
261  if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice())
262  {
263  if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
264  aSelection = OutputDevice::LogicToLogic(aSelection, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
265  }
266  }
267 
268  sSelection = aSelection.toString();
269  }
270 
271  if(SfxViewShell* pViewShell = GetSfxViewShell())
272  SfxLokHelper::notifyInvalidation(pViewShell, sSelection);
273 }
274 
275 
277 {
279 }
280 
281 void SdrMarkView::MovAction(const Point& rPnt)
282 {
284 
285  if(IsMarkObj())
286  {
287  MovMarkObj(rPnt);
288  }
289  else if(IsMarkPoints())
290  {
291  MovMarkPoints(rPnt);
292  }
293  else if(IsMarkGluePoints())
294  {
295  MovMarkGluePoints(rPnt);
296  }
297 }
298 
300 {
301  if(IsMarkObj())
302  {
303  EndMarkObj();
304  }
305  else if(IsMarkPoints())
306  {
307  EndMarkPoints();
308  }
309  else if(IsMarkGluePoints())
310  {
312  }
313 
315 }
316 
318 {
320  BrkMarkObj();
321  BrkMarkPoints();
323 }
324 
326 {
328  BrkMarkObj();
329  BrkMarkPoints();
331 }
332 
334 {
335  if(IsMarkObj() || IsMarkPoints() || IsMarkGluePoints())
336  {
338  }
339  else
340  {
342  }
343 }
344 
345 
347 {
348  UnmarkAllObj();
350 }
351 
353 {
354  bool bMrkChg(false);
355 
356  SdrPageView* pPageView = GetSdrPageView();
357  if (pPageView)
358  {
359  // break all creation actions when hiding page (#75081#)
360  BrkAction();
361 
362  // Discard all selections on this page
363  bMrkChg = GetMarkedObjectListWriteAccess().DeletePageView(*pPageView);
364  }
365 
367 
368  if(bMrkChg)
369  {
371  AdjustMarkHdl();
372  }
373 }
374 
375 
376 void SdrMarkView::BegMarkObj(const Point& rPnt, bool bUnmark)
377 {
378  BrkAction();
379 
380  DBG_ASSERT(!mpMarkObjOverlay, "SdrMarkView::BegMarkObj: There exists a mpMarkObjOverlay (!)");
381 
382  basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
383  mpMarkObjOverlay.reset(new ImplMarkingOverlay(*this, aStartPos, bUnmark));
384 
385  maDragStat.Reset(rPnt);
388 }
389 
390 void SdrMarkView::MovMarkObj(const Point& rPnt)
391 {
392  if(IsMarkObj() && maDragStat.CheckMinMoved(rPnt))
393  {
394  maDragStat.NextMove(rPnt);
395  DBG_ASSERT(mpMarkObjOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
396  basegfx::B2DPoint aNewPos(rPnt.X(), rPnt.Y());
397  mpMarkObjOverlay->SetSecondPosition(aNewPos);
398  }
399 }
400 
402 {
403  bool bRetval(false);
404 
405  if(IsMarkObj())
406  {
407  if(maDragStat.IsMinMoved())
408  {
410  aRect.Justify();
411  MarkObj(aRect, mpMarkObjOverlay->IsUnmarking());
412  bRetval = true;
413  }
414 
415  // cleanup
416  BrkMarkObj();
417  }
418 
419  return bRetval;
420 }
421 
423 {
424  if(IsMarkObj())
425  {
426  DBG_ASSERT(mpMarkObjOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
427  mpMarkObjOverlay.reset();
428  }
429 }
430 
431 
432 bool SdrMarkView::BegMarkPoints(const Point& rPnt, bool bUnmark)
433 {
434  if(HasMarkablePoints())
435  {
436  BrkAction();
437 
438  DBG_ASSERT(!mpMarkPointsOverlay, "SdrMarkView::BegMarkObj: There exists a mpMarkPointsOverlay (!)");
439  basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
440  mpMarkPointsOverlay.reset(new ImplMarkingOverlay(*this, aStartPos, bUnmark));
441 
442  maDragStat.Reset(rPnt);
445 
446  return true;
447  }
448 
449  return false;
450 }
451 
452 void SdrMarkView::MovMarkPoints(const Point& rPnt)
453 {
454  if(IsMarkPoints() && maDragStat.CheckMinMoved(rPnt))
455  {
456  maDragStat.NextMove(rPnt);
457 
458  DBG_ASSERT(mpMarkPointsOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
459  basegfx::B2DPoint aNewPos(rPnt.X(), rPnt.Y());
460  mpMarkPointsOverlay->SetSecondPosition(aNewPos);
461  }
462 }
463 
465 {
466  bool bRetval(false);
467 
468  if(IsMarkPoints())
469  {
470  if(maDragStat.IsMinMoved())
471  {
473  aRect.Justify();
474  MarkPoints(&aRect, mpMarkPointsOverlay->IsUnmarking());
475 
476  bRetval = true;
477  }
478 
479  // cleanup
480  BrkMarkPoints();
481  }
482 
483  return bRetval;
484 }
485 
487 {
488  if(IsMarkPoints())
489  {
490  DBG_ASSERT(mpMarkPointsOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
491  mpMarkPointsOverlay.reset();
492  }
493 }
494 
495 
496 bool SdrMarkView::BegMarkGluePoints(const Point& rPnt, bool bUnmark)
497 {
499  {
500  BrkAction();
501 
502  DBG_ASSERT(!mpMarkGluePointsOverlay, "SdrMarkView::BegMarkObj: There exists a mpMarkGluePointsOverlay (!)");
503 
504  basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
505  mpMarkGluePointsOverlay.reset(new ImplMarkingOverlay(*this, aStartPos, bUnmark));
506  maDragStat.Reset(rPnt);
509 
510  return true;
511  }
512 
513  return false;
514 }
515 
516 void SdrMarkView::MovMarkGluePoints(const Point& rPnt)
517 {
519  {
520  maDragStat.NextMove(rPnt);
521 
522  DBG_ASSERT(mpMarkGluePointsOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
523  basegfx::B2DPoint aNewPos(rPnt.X(), rPnt.Y());
524  mpMarkGluePointsOverlay->SetSecondPosition(aNewPos);
525  }
526 }
527 
529 {
530  if(IsMarkGluePoints())
531  {
532  if(maDragStat.IsMinMoved())
533  {
535  aRect.Justify();
536  MarkGluePoints(&aRect, mpMarkGluePointsOverlay->IsUnmarking());
537  }
538 
539  // cleanup
541  }
542 }
543 
545 {
546  if(IsMarkGluePoints())
547  {
548  DBG_ASSERT(mpMarkGluePointsOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
549  mpMarkGluePointsOverlay.reset();
550  }
551 }
552 
554 {
555  SdrPageView* pPV = GetSdrPageView();
556  if (!pPV)
557  return false;
558 
559  SdrObjList* pOL=pPV->GetObjList();
560  const size_t nObjCount = pOL->GetObjCount();
561  for (size_t nObjNum=0; nObjNum<nObjCount; ++nObjNum) {
562  SdrObject* pObj=pOL->GetObj(nObjNum);
563  if (IsObjMarkable(pObj,pPV) && --n<0)
564  return true;
565  }
566 
567  return false;
568 }
569 
571 {
573  {
574  mbMarkHandlesHidden = true;
575  AdjustMarkHdl();
576  }
577 }
578 
580 {
582  {
583  mbMarkHandlesHidden = false;
584  AdjustMarkHdl();
585  }
586 }
587 
589 {
590  const size_t nMarkCount=GetMarkedObjectCount();
591  bool bFrmHdl=nMarkCount>static_cast<size_t>(mnFrameHandlesLimit) || mbForceFrameHandles;
592  bool bStdDrag=meDragMode==SdrDragMode::Move;
593  if (nMarkCount==1 && bStdDrag && bFrmHdl)
594  {
595  const SdrObject* pObj=GetMarkedObjectByIndex(0);
597  {
598  sal_uInt16 nIdent=pObj->GetObjIdentifier();
599  if (nIdent==OBJ_LINE || nIdent==OBJ_EDGE || nIdent==OBJ_CAPTION || nIdent==OBJ_MEASURE || nIdent==OBJ_CUSTOMSHAPE || nIdent==OBJ_TABLE )
600  {
601  bFrmHdl=false;
602  }
603  }
604  }
605  if (!bStdDrag && !bFrmHdl) {
606  // all other drag modes only with FrameHandles
607  bFrmHdl=true;
609  // when rotating, use ObjOwn drag, if there's at least 1 PolyObj
610  for (size_t nMarkNum=0; nMarkNum<nMarkCount && bFrmHdl; ++nMarkNum) {
611  const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
612  const SdrObject* pObj=pM->GetMarkedSdrObj();
613  bFrmHdl=!pObj->IsPolyObj();
614  }
615  }
616  }
617  if (!bFrmHdl) {
618  // FrameHandles, if at least 1 Obj can't do SpecialDrag
619  for (size_t nMarkNum=0; nMarkNum<nMarkCount && !bFrmHdl; ++nMarkNum) {
620  const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
621  const SdrObject* pObj=pM->GetMarkedSdrObj();
622  bFrmHdl=!pObj->hasSpecialDrag();
623  }
624  }
625 
626  // no FrameHdl for crop
627  if(bFrmHdl && SdrDragMode::Crop == meDragMode)
628  {
629  bFrmHdl = false;
630  }
631 
632  return bFrmHdl;
633 }
634 
635 namespace
636 {
637 OUString lcl_getDragMethodServiceName( const OUString& rCID )
638 {
639  OUString aRet;
640 
641  sal_Int32 nIndexStart = rCID.indexOf( "DragMethod=" );
642  if( nIndexStart != -1 )
643  {
644  nIndexStart = rCID.indexOf( '=', nIndexStart );
645  if( nIndexStart != -1 )
646  {
647  nIndexStart++;
648  sal_Int32 nNextSlash = rCID.indexOf( '/', nIndexStart );
649  if( nNextSlash != -1 )
650  {
651  sal_Int32 nIndexEnd = nNextSlash;
652  sal_Int32 nNextColon = rCID.indexOf( ':', nIndexStart );
653  if( nNextColon < nNextSlash )
654  nIndexEnd = nNextColon;
655  aRet = rCID.copy(nIndexStart,nIndexEnd-nIndexStart);
656  }
657  }
658  }
659  return aRet;
660 }
661 
662 OUString lcl_getDragParameterString( const OUString& rCID )
663 {
664  OUString aRet;
665 
666  sal_Int32 nIndexStart = rCID.indexOf( "DragParameter=" );
667  if( nIndexStart != -1 )
668  {
669  nIndexStart = rCID.indexOf( '=', nIndexStart );
670  if( nIndexStart != -1 )
671  {
672  nIndexStart++;
673  sal_Int32 nNextSlash = rCID.indexOf( '/', nIndexStart );
674  if( nNextSlash != -1 )
675  {
676  sal_Int32 nIndexEnd = nNextSlash;
677  sal_Int32 nNextColon = rCID.indexOf( ':', nIndexStart );
678  if( nNextColon < nNextSlash )
679  nIndexEnd = nNextColon;
680  aRet = rCID.copy(nIndexStart,nIndexEnd-nIndexStart);
681  }
682  }
683  }
684  return aRet;
685 }
686 } // anonymous namespace
687 
689 {
690  SfxViewShell* pViewShell = GetSfxViewShell();
691 
692  tools::Rectangle aSelection(rRect);
693  bool bIsChart = false;
694  Point addLogicOffset(0, 0);
695  if (!rRect.IsEmpty())
696  {
697  sal_uInt32 nTotalPaintWindows = this->PaintWindowCount();
698  if (nTotalPaintWindows == 1)
699  {
700  const vcl::Window* pWin = dynamic_cast<const vcl::Window*>(this->GetFirstOutputDevice());
701  if (pWin && pWin->IsChart())
702  {
703  bIsChart = true;
704  const vcl::Window* pViewShellWindow = GetSfxViewShell()->GetEditWindowForActiveOLEObj();
705  if (pViewShellWindow && pViewShellWindow->IsAncestorOf(*pWin))
706  {
707  Point aOffsetPx = pWin->GetOffsetPixelFrom(*pViewShellWindow);
708  Point aLogicOffset = pWin->PixelToLogic(aOffsetPx);
709  addLogicOffset = aLogicOffset;
710  aSelection.Move(aLogicOffset.getX(), aLogicOffset.getY());
711  }
712  }
713  }
714  }
715 
716  if (!aSelection.IsEmpty())
717  {
718  // In case the map mode is in 100th MM, then need to convert the coordinates over to twips for LOK.
719  if (mpMarkedPV)
720  {
721  if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice())
722  {
723  if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
724  aSelection = OutputDevice::LogicToLogic(aSelection, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
725  }
726  }
727 
728  // hide the text selection too
729  pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, "");
730  }
731 
732  {
733  OString sSelectionText;
734  OString sSelectionTextView;
735  boost::property_tree::ptree aTableJsonTree;
736  bool bTableSelection = false;
737 
739  {
740  auto& rTableObject = dynamic_cast<sdr::table::SdrTableObj&>(*mpMarkedObj);
741  bTableSelection = rTableObject.createTableEdgesJson(aTableJsonTree);
742  }
743  if (GetMarkedObjectCount())
744  {
745  SdrMark* pM = GetSdrMarkByIndex(0);
746  SdrObject* pO = pM->GetMarkedSdrObj();
747  Degree100 nRotAngle = pO->GetRotateAngle();
748  // true if we are dealing with a RotGrfFlyFrame
749  // (SwVirtFlyDrawObj with a SwGrfNode)
750  bool bWriterGraphic = pO->HasLimitedRotation();
751 
752  OStringBuffer aExtraInfo;
753  OString handleArrayStr;
754 
755  aExtraInfo.append("{\"id\":\"");
756  aExtraInfo.append(OString::number(reinterpret_cast<sal_IntPtr>(pO)));
757  aExtraInfo.append("\",\"type\":");
758  aExtraInfo.append(OString::number(pO->GetObjIdentifier()));
759 
760  if (bWriterGraphic)
761  {
762  aExtraInfo.append(", \"isWriterGraphic\": true");
763  }
764  else if (bIsChart)
765  {
766  LokChartHelper aChartHelper(pViewShell);
767  css::uno::Reference<css::frame::XController>& xChartController = aChartHelper.GetXController();
768  css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier( xChartController, uno::UNO_QUERY);
769  if (xSelectionSupplier.is())
770  {
771  uno::Any aSel = xSelectionSupplier->getSelection();
772  OUString aValue;
773  if (aSel >>= aValue)
774  {
775  OString aObjectCID(aValue.getStr(), aValue.getLength(), osl_getThreadTextEncoding());
776  const std::vector<OString> aProps{"Draggable", "Resizable", "Rotatable"};
777  for (const auto& rProp: aProps)
778  {
779  sal_Int32 nPos = aObjectCID.indexOf(rProp);
780  if (nPos == -1) continue;
781  nPos += rProp.getLength() + 1; // '='
782  if (aExtraInfo.getLength() > 2) // != "{ "
783  aExtraInfo.append(", ");
784  aExtraInfo.append("\"is");
785  aExtraInfo.append(rProp);
786  aExtraInfo.append("\": ");
787  aExtraInfo.append(OString::boolean(aObjectCID[nPos] == '1'));
788  }
789 
790  OUString sDragMethod = lcl_getDragMethodServiceName(aValue);
791  if (sDragMethod == "PieSegmentDragging")
792  {
793  // old initial offset inside the CID returned by xSelectionSupplier->getSelection()
794  // after a pie segment dragging; using SdrObject::GetName for getting a CID with the updated offset
795  aValue = pO->GetName();
796  OUString sDragParameters = lcl_getDragParameterString(aValue);
797  if (!sDragParameters.isEmpty())
798  {
799  aExtraInfo.append(", \"dragInfo\": { ");
800  aExtraInfo.append("\"dragMethod\": \"");
801  aExtraInfo.append(sDragMethod.toUtf8());
802  aExtraInfo.append("\"");
803 
804  OUString sParam;
805  sal_Int32 nStartIndex = 0;
806  std::array<int, 5> aDragParameters;
807  for (auto& rParam : aDragParameters)
808  {
809  sParam = sDragParameters.getToken(0, ',', nStartIndex);
810  if (sParam.isEmpty())
811  break;
812  rParam = sParam.toInt32();
813  }
814 
815  // initial offset in %
816  if (aDragParameters[0] < 0)
817  aDragParameters[0] = 0;
818  else if (aDragParameters[0] > 100)
819  aDragParameters[0] = 100;
820 
821  aExtraInfo.append(", \"initialOffset\": ");
822  aExtraInfo.append(OString::number(aDragParameters[0]));
823 
824  // drag direction constraint
825  Point aMinPos(aDragParameters[1], aDragParameters[2]);
826  Point aMaxPos(aDragParameters[3], aDragParameters[4]);
827  Point aDragDirection = aMaxPos - aMinPos;
828  aDragDirection = OutputDevice::LogicToLogic(aDragDirection, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
829 
830  aExtraInfo.append(", \"dragDirection\": [");
831  aExtraInfo.append(aDragDirection.toString());
832  aExtraInfo.append("]");
833 
834  // polygon approximating the pie segment or donut segment
835  if (pO->GetObjIdentifier() == OBJ_PATHFILL)
836  {
837  const basegfx::B2DPolyPolygon aPolyPolygon(pO->TakeXorPoly());
838  if (aPolyPolygon.count() == 1)
839  {
840  const basegfx::B2DPolygon aPolygon = aPolyPolygon.getB2DPolygon(0);
841  if (sal_uInt32 nPolySize = aPolygon.count())
842  {
843  const vcl::Window* pWin = dynamic_cast<const vcl::Window*>(this->GetFirstOutputDevice());
844  const vcl::Window* pViewShellWindow = pViewShell->GetEditWindowForActiveOLEObj();
845  if (pWin && pViewShellWindow && pViewShellWindow->IsAncestorOf(*pWin))
846  {
847  // in the following code escaping sequences used inside raw literal strings
848  // are for making them understandable by the JSON parser
849 
850  Point aOffsetPx = pWin->GetOffsetPixelFrom(*pViewShellWindow);
851  Point aLogicOffset = pWin->PixelToLogic(aOffsetPx);
852  OString sPolygonElem("<polygon points=\\\"");
853  for (sal_uInt32 nIndex = 0; nIndex < nPolySize; ++nIndex)
854  {
855  const basegfx::B2DPoint aB2Point = aPolygon.getB2DPoint(nIndex);
856  Point aPoint(aB2Point.getX(), aB2Point.getY());
857  aPoint.Move(aLogicOffset.getX(), aLogicOffset.getY());
858  if (nIndex > 0)
859  sPolygonElem += " ";
860  sPolygonElem += aPoint.toString();
861  }
862  sPolygonElem += R"elem(\" style=\"stroke: none; fill: rgb(114,159,207); fill-opacity: 0.8\"/>)elem";
863 
864  OString sSVGElem = R"elem(<svg version=\"1.2\" width=\")elem" +
865  OString::number(aSelection.GetWidth() / 100.0) +
866  R"elem(mm\" height=\")elem" +
867  OString::number(aSelection.GetHeight() / 100.0) +
868  R"elem(mm\" viewBox=\")elem" +
869  aSelection.toString() +
870  R"elem(\" preserveAspectRatio=\"xMidYMid\" xmlns=\"http://www.w3.org/2000/svg\">)elem";
871 
872  aExtraInfo.append(", \"svg\": \"");
873  aExtraInfo.append(sSVGElem);
874  aExtraInfo.append("\\n ");
875  aExtraInfo.append(sPolygonElem);
876  aExtraInfo.append("\\n</svg>");
877  aExtraInfo.append("\""); // svg
878  }
879  }
880  }
881  }
882  aExtraInfo.append("}"); // dragInfo
883  }
884  }
885  }
886  }
887  }
888  if (!bTableSelection && !pOtherShell && maHdlList.GetHdlCount())
889  {
890  boost::property_tree::ptree responseJSON;
891  boost::property_tree::ptree others;
892  boost::property_tree::ptree rectangle;
893  boost::property_tree::ptree poly;
894  boost::property_tree::ptree custom;
895  boost::property_tree::ptree nodes;
896  const bool convertMapMode = mpMarkedPV->GetView().GetFirstOutputDevice()->GetMapMode().GetMapUnit() == MapUnit::Map100thMM;
897  for (size_t i = 0; i < maHdlList.GetHdlCount(); i++)
898  {
899  SdrHdl *pHdl = maHdlList.GetHdl(i);
900  boost::property_tree::ptree child;
901  boost::property_tree::ptree point;
902  sal_Int32 kind = static_cast<sal_Int32>(pHdl->GetKind());
903  child.put("id", pHdl->GetObjHdlNum());
904  child.put("kind", kind);
905  child.put("pointer", static_cast<sal_Int32>(pHdl->GetPointer()));
906  Point pHdlPos = pHdl->GetPos();
907  pHdlPos.Move(addLogicOffset.getX(), addLogicOffset.getY());
908  if (convertMapMode)
909  pHdlPos = OutputDevice::LogicToLogic(pHdlPos, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
910  point.put("x", pHdlPos.getX());
911  point.put("y", pHdlPos.getY());
912  child.add_child("point", point);
913  const auto node = std::make_pair("", child);
914  boost::property_tree::ptree* selectedNode = nullptr;
915  if (kind >= static_cast<sal_Int32>(SdrHdlKind::UpperLeft) && kind <= static_cast<sal_Int32>(SdrHdlKind::LowerRight))
916  {
917  selectedNode = &rectangle;
918  }
919  else if (kind == static_cast<sal_Int32>(SdrHdlKind::Poly))
920  {
921  selectedNode = &poly;
922  }
923  else if (kind == static_cast<sal_Int32>(SdrHdlKind::CustomShape1))
924  {
925  selectedNode = &custom;
926  }
927  else
928  {
929  selectedNode = &others;
930  }
931  std::string sKind = std::to_string(kind);
932  boost::optional< boost::property_tree::ptree& > kindNode = selectedNode->get_child_optional(sKind.c_str());
933  if (!kindNode)
934  {
935  boost::property_tree::ptree newChild;
936  newChild.push_back(node);
937  selectedNode->add_child(sKind.c_str(), newChild);
938  }
939  else
940  kindNode.get().push_back(node);
941  }
942  nodes.add_child("rectangle", rectangle);
943  nodes.add_child("poly", poly);
944  nodes.add_child("custom", custom);
945  nodes.add_child("others", others);
946  responseJSON.add_child("kinds", nodes);
947  std::stringstream aStream;
948  boost::property_tree::write_json(aStream, responseJSON, /*pretty=*/ false);
949  handleArrayStr = ", \"handles\":";
950  handleArrayStr = handleArrayStr + aStream.str().c_str();
951  }
952  sSelectionText = aSelection.toString() +
953  ", " + OString::number(nRotAngle.get());
954  if (!aExtraInfo.isEmpty())
955  {
956  sSelectionTextView = sSelectionText + ", " + aExtraInfo.toString() + "}";
957  aExtraInfo.append(handleArrayStr);
958  aExtraInfo.append("}");
959  sSelectionText += ", " + aExtraInfo.makeStringAndClear();
960  }
961  }
962 
963  if (sSelectionText.isEmpty())
964  {
965  sSelectionText = "EMPTY";
966  sSelectionTextView = "EMPTY";
967  }
968 
969  if (bTableSelection)
970  {
971  boost::property_tree::ptree aTableRectangle;
972  aTableRectangle.put("x", aSelection.Left());
973  aTableRectangle.put("y", aSelection.Top());
974  aTableRectangle.put("width", aSelection.GetWidth());
975  aTableRectangle.put("height", aSelection.GetHeight());
976  aTableJsonTree.push_back(std::make_pair("rectangle", aTableRectangle));
977 
978  std::stringstream aStream;
979  boost::property_tree::write_json(aStream, aTableJsonTree);
980  pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, aStream.str().c_str());
981  }
982  else
983  {
984  pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, "{}");
985  }
986 
987  if (pOtherShell)
988  {
989  // Another shell wants to know about our existing
990  // selection.
991  if (pViewShell != pOtherShell)
992  SfxLokHelper::notifyOtherView(pViewShell, pOtherShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelectionTextView);
993  }
994  else
995  {
996  // We have a new selection, so both pViewShell and the
997  // other views want to know about it.
998  pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, sSelectionText.getStr());
999  SfxLokHelper::notifyOtherViews(pViewShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelectionTextView);
1000  }
1001  }
1002 }
1003 
1005 {
1006  // remember old focus handle values to search for it again
1007  const SdrHdl* pSaveOldFocusHdl = maHdlList.GetFocusHdl();
1008  bool bSaveOldFocus(false);
1009  sal_uInt32 nSavePolyNum(0), nSavePointNum(0);
1010  SdrHdlKind eSaveKind(SdrHdlKind::Move);
1011  SdrObject* pSaveObj = nullptr;
1012 
1014 
1015  if(pSaveOldFocusHdl
1016  && pSaveOldFocusHdl->GetObj()
1017  && dynamic_cast<const SdrPathObj*>(pSaveOldFocusHdl->GetObj()) != nullptr
1018  && (pSaveOldFocusHdl->GetKind() == SdrHdlKind::Poly || pSaveOldFocusHdl->GetKind() == SdrHdlKind::BezierWeight))
1019  {
1020  bSaveOldFocus = true;
1021  nSavePolyNum = pSaveOldFocusHdl->GetPolyNum();
1022  nSavePointNum = pSaveOldFocusHdl->GetPointNum();
1023  pSaveObj = pSaveOldFocusHdl->GetObj();
1024  eSaveKind = pSaveOldFocusHdl->GetKind();
1025  }
1026 
1027  // delete/clear all handles. This will always be done, even with areMarkHandlesHidden()
1028  maHdlList.Clear();
1031  mpMarkedObj=nullptr;
1032  mpMarkedPV=nullptr;
1033 
1034  // are handles enabled at all? Create only then
1035  if(areMarkHandlesHidden())
1036  return;
1037 
1038  // There can be multiple mark views, but we're only interested in the one that has a window associated.
1040 
1041  const size_t nMarkCount=GetMarkedObjectCount();
1042  bool bStdDrag=meDragMode==SdrDragMode::Move;
1043  bool bSingleTextObjMark=false;
1044  bool bLimitedRotation(false);
1045 
1046  if (nMarkCount==1)
1047  {
1049 
1050  if(nullptr != mpMarkedObj)
1051  {
1052  bSingleTextObjMark =
1053  dynamic_cast<const SdrTextObj*>( mpMarkedObj) != nullptr &&
1054  static_cast<SdrTextObj*>(mpMarkedObj)->IsTextFrame();
1055 
1056  // RotGrfFlyFrame: we may have limited rotation
1057  bLimitedRotation = SdrDragMode::Rotate == meDragMode && mpMarkedObj->HasLimitedRotation();
1058  }
1059  }
1060 
1061  bool bFrmHdl=ImpIsFrameHandles();
1062 
1063  if (nMarkCount>0)
1064  {
1066 
1067  for (size_t nMarkNum=0; nMarkNum<nMarkCount && (mpMarkedPV!=nullptr || !bFrmHdl); ++nMarkNum)
1068  {
1069  const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
1070 
1071  if (mpMarkedPV!=pM->GetPageView())
1072  {
1073  mpMarkedPV=nullptr;
1074  }
1075  }
1076  }
1077 
1078  SfxViewShell* pViewShell = GetSfxViewShell();
1079 
1080  // check if text edit or ole is active and handles need to be suppressed. This may be the case
1081  // when a single object is selected
1082  // Using a strict return statement is okay here; no handles means *no* handles.
1083  if(mpMarkedObj)
1084  {
1085  // formerly #i33755#: If TextEdit is active the EditEngine will directly paint
1086  // to the window, so suppress Overlay and handles completely; a text frame for
1087  // the active text edit will be painted by the repaint mechanism in
1088  // SdrObjEditView::ImpPaintOutlinerView in this case. This needs to be reworked
1089  // in the future
1090  // Also formerly #122142#: Pretty much the same for SdrCaptionObj's in calc.
1091  if(static_cast<SdrView*>(this)->IsTextEdit())
1092  {
1093  const SdrTextObj* pSdrTextObj = dynamic_cast< const SdrTextObj* >(mpMarkedObj);
1094 
1095  if (pSdrTextObj && pSdrTextObj->IsInEditMode())
1096  {
1097  if (!bTiledRendering)
1098  return;
1099  }
1100  }
1101 
1102  // formerly #i118524#: if inplace activated OLE is selected, suppress handles
1103  const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(mpMarkedObj);
1104 
1105  if(pSdrOle2Obj && (pSdrOle2Obj->isInplaceActive() || pSdrOle2Obj->isUiActive()))
1106  {
1107  return;
1108  }
1109 
1110  if (!maSubSelectionList.empty())
1111  {
1112  mpMarkingSubSelectionOverlay = std::make_unique<MarkingSubSelectionOverlay>(*this, maSubSelectionList);
1113  }
1114  }
1115 
1117 
1118  if (bFrmHdl)
1119  {
1120  if(!aRect.IsEmpty())
1121  {
1122  // otherwise nothing is found
1123  const size_t nSiz0(maHdlList.GetHdlCount());
1124 
1125  if( bSingleTextObjMark )
1126  {
1128  }
1129  else
1130  {
1131  const bool bWdt0(aRect.Left() == aRect.Right());
1132  const bool bHgt0(aRect.Top() == aRect.Bottom());
1133 
1134  if (bWdt0 && bHgt0)
1135  {
1136  maHdlList.AddHdl(std::make_unique<SdrHdl>(aRect.TopLeft(), SdrHdlKind::UpperLeft));
1137  }
1138  else if (!bStdDrag && (bWdt0 || bHgt0))
1139  {
1140  maHdlList.AddHdl(std::make_unique<SdrHdl>(aRect.TopLeft(), SdrHdlKind::UpperLeft));
1141  maHdlList.AddHdl(std::make_unique<SdrHdl>(aRect.BottomRight(), SdrHdlKind::LowerRight));
1142  }
1143  else
1144  {
1145  if (!bWdt0 && !bHgt0)
1146  {
1147  maHdlList.AddHdl(std::make_unique<SdrHdl>(aRect.TopLeft(), SdrHdlKind::UpperLeft));
1148  }
1149 
1150  if (!bLimitedRotation && !bHgt0)
1151  {
1152  maHdlList.AddHdl(std::make_unique<SdrHdl>(aRect.TopCenter(), SdrHdlKind::Upper));
1153  }
1154 
1155  if (!bWdt0 && !bHgt0)
1156  {
1157  maHdlList.AddHdl(std::make_unique<SdrHdl>(aRect.TopRight(), SdrHdlKind::UpperRight));
1158  }
1159 
1160  if (!bLimitedRotation && !bWdt0)
1161  {
1162  maHdlList.AddHdl(std::make_unique<SdrHdl>(aRect.LeftCenter(), SdrHdlKind::Left ));
1163  maHdlList.AddHdl(std::make_unique<SdrHdl>(aRect.RightCenter(), SdrHdlKind::Right));
1164  }
1165 
1166  if (!bWdt0 && !bHgt0)
1167  {
1168  maHdlList.AddHdl(std::make_unique<SdrHdl>(aRect.BottomLeft(), SdrHdlKind::LowerLeft));
1169  }
1170 
1171  if (!bLimitedRotation && !bHgt0)
1172  {
1173  maHdlList.AddHdl(std::make_unique<SdrHdl>(aRect.BottomCenter(), SdrHdlKind::Lower));
1174  }
1175 
1176  if (!bWdt0 && !bHgt0)
1177  {
1178  maHdlList.AddHdl(std::make_unique<SdrHdl>(aRect.BottomRight(), SdrHdlKind::LowerRight));
1179  }
1180  }
1181  }
1182 
1183  const size_t nSiz1(maHdlList.GetHdlCount());
1184 
1185  // moved setting the missing parameters at SdrHdl here from the
1186  // single loop above (bSingleTextObjMark), this was missing all
1187  // the time. Setting SdrObject is now required to correctly get
1188  // the View-Dependent evtl. GridOffset adapted
1189  for (size_t i=nSiz0; i<nSiz1; ++i)
1190  {
1191  SdrHdl* pHdl=maHdlList.GetHdl(i);
1192  pHdl->SetObj(mpMarkedObj);
1193  pHdl->SetPageView(mpMarkedPV);
1194  pHdl->SetObjHdlNum(sal_uInt16(i-nSiz0));
1195  }
1196  }
1197  }
1198  else
1199  {
1200  bool bDone(false);
1201 
1202  // moved crop handling to non-frame part and the handle creation to SdrGrafObj
1203  if(1 == nMarkCount && mpMarkedObj && SdrDragMode::Crop == meDragMode)
1204  {
1205  // Default addCropHandles from SdrObject does nothing. When pMarkedObj is SdrGrafObj, previous
1206  // behaviour occurs (code in svx/source/svdraw/svdograf.cxx). When pMarkedObj is SwVirtFlyDrawObj
1207  // writer takes the responsibility of adding handles (code in sw/source/core/draw/dflyobj.cxx)
1208  const size_t nSiz0(maHdlList.GetHdlCount());
1210  const size_t nSiz1(maHdlList.GetHdlCount());
1211 
1212  // Was missing: Set infos at SdrCropHdl
1213  for (size_t i=nSiz0; i<nSiz1; ++i)
1214  {
1215  SdrHdl* pHdl=maHdlList.GetHdl(i);
1216  pHdl->SetObj(mpMarkedObj);
1217  pHdl->SetPageView(mpMarkedPV);
1218  pHdl->SetObjHdlNum(sal_uInt16(i-nSiz0));
1219  }
1220 
1221  bDone = true;
1222  }
1223 
1224  if(!bDone)
1225  {
1226  for (size_t nMarkNum=0; nMarkNum<nMarkCount; ++nMarkNum)
1227  {
1228  const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
1229  SdrObject* pObj=pM->GetMarkedSdrObj();
1230  SdrPageView* pPV=pM->GetPageView();
1231  const size_t nSiz0=maHdlList.GetHdlCount();
1232  pObj->AddToHdlList(maHdlList);
1233  const size_t nSiz1=maHdlList.GetHdlCount();
1234  bool bPoly=pObj->IsPolyObj();
1235  const SdrUShortCont& rMrkPnts = pM->GetMarkedPoints();
1236  for (size_t i=nSiz0; i<nSiz1; ++i)
1237  {
1238  SdrHdl* pHdl=maHdlList.GetHdl(i);
1239  pHdl->SetObj(pObj);
1240  pHdl->SetPageView(pPV);
1241  pHdl->SetObjHdlNum(sal_uInt16(i-nSiz0));
1242 
1243  if (bPoly)
1244  {
1245  bool bSelected= rMrkPnts.find( sal_uInt16(i-nSiz0) ) != rMrkPnts.end();
1246  pHdl->SetSelected(bSelected);
1247  if (mbPlusHdlAlways || bSelected)
1248  {
1249  SdrHdlList plusList(nullptr);
1250  pObj->AddToPlusHdlList(plusList, *pHdl);
1251  sal_uInt32 nPlusHdlCnt=plusList.GetHdlCount();
1252  for (sal_uInt32 nPlusNum=0; nPlusNum<nPlusHdlCnt; nPlusNum++)
1253  {
1254  SdrHdl* pPlusHdl=plusList.GetHdl(nPlusNum);
1255  pPlusHdl->SetObj(pObj);
1256  pPlusHdl->SetPageView(pPV);
1257  pPlusHdl->SetPlusHdl(true);
1258  }
1259  plusList.MoveTo(maHdlList);
1260  }
1261  }
1262  }
1263  }
1264  }
1265  }
1266 
1267  // GluePoint handles
1268  for (size_t nMarkNum=0; nMarkNum<nMarkCount; ++nMarkNum)
1269  {
1270  const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
1271  SdrObject* pObj=pM->GetMarkedSdrObj();
1272  const SdrGluePointList* pGPL=pObj->GetGluePointList();
1273  if (!pGPL)
1274  continue;
1275 
1276  SdrPageView* pPV=pM->GetPageView();
1277  const SdrUShortCont& rMrkGlue=pM->GetMarkedGluePoints();
1278  for (sal_uInt16 nId : rMrkGlue)
1279  {
1280  //nNum changed to nNumGP because already used in for loop
1281  sal_uInt16 nNumGP=pGPL->FindGluePoint(nId);
1282  if (nNumGP!=SDRGLUEPOINT_NOTFOUND)
1283  {
1284  const SdrGluePoint& rGP=(*pGPL)[nNumGP];
1285  Point aPos(rGP.GetAbsolutePos(*pObj));
1286  std::unique_ptr<SdrHdl> pGlueHdl(new SdrHdl(aPos,SdrHdlKind::Glue));
1287  pGlueHdl->SetObj(pObj);
1288  pGlueHdl->SetPageView(pPV);
1289  pGlueHdl->SetObjHdlNum(nId);
1290  maHdlList.AddHdl(std::move(pGlueHdl));
1291  }
1292  }
1293  }
1294 
1295  // moved it here to access all the handles for callback.
1296  if (bTiledRendering && pViewShell)
1297  {
1298  SetMarkHandlesForLOKit(aRect, pOtherShell);
1299  }
1300  // rotation point/axis of reflection
1301  if(!bLimitedRotation)
1302  {
1304  }
1305 
1306  // sort handles
1307  maHdlList.Sort();
1308 
1309  // add custom handles (used by other apps, e.g. AnchorPos)
1310  AddCustomHdl();
1311 
1312  // try to restore focus handle index from remembered values
1313  if(!bSaveOldFocus)
1314  return;
1315 
1316  for(size_t a = 0; a < maHdlList.GetHdlCount(); ++a)
1317  {
1318  SdrHdl* pCandidate = maHdlList.GetHdl(a);
1319 
1320  if(pCandidate->GetObj()
1321  && pCandidate->GetObj() == pSaveObj
1322  && pCandidate->GetKind() == eSaveKind
1323  && pCandidate->GetPolyNum() == nSavePolyNum
1324  && pCandidate->GetPointNum() == nSavePointNum)
1325  {
1326  maHdlList.SetFocusHdl(pCandidate);
1327  break;
1328  }
1329  }
1330 }
1331 
1333 {
1334  // add custom handles (used by other apps, e.g. AnchorPos)
1335 }
1336 
1338 {
1339  SdrDragMode eMode0=meDragMode;
1340  meDragMode=eMode;
1342  if (meDragMode!=eMode0) {
1343  ForceRefToMarked();
1344  SetMarkHandles(nullptr);
1345  {
1347  }
1348  }
1349 }
1350 
1352 {
1353  switch(eMode)
1354  {
1355  case SdrDragMode::Rotate:
1356  {
1357  // add rotation center
1358  maHdlList.AddHdl(std::make_unique<SdrHdl>(maRef1, SdrHdlKind::Ref1));
1359  break;
1360  }
1361  case SdrDragMode::Mirror:
1362  {
1363  // add axis of reflection
1364  std::unique_ptr<SdrHdl> pHdl3(new SdrHdl(maRef2, SdrHdlKind::Ref2));
1365  std::unique_ptr<SdrHdl> pHdl2(new SdrHdl(maRef1, SdrHdlKind::Ref1));
1366  std::unique_ptr<SdrHdl> pHdl1(new SdrHdlLine(*pHdl2, *pHdl3, SdrHdlKind::MirrorAxis));
1367 
1368  pHdl1->SetObjHdlNum(1); // for sorting
1369  pHdl2->SetObjHdlNum(2); // for sorting
1370  pHdl3->SetObjHdlNum(3); // for sorting
1371 
1372  maHdlList.AddHdl(std::move(pHdl1)); // line comes first, so it is the last in HitTest
1373  maHdlList.AddHdl(std::move(pHdl2));
1374  maHdlList.AddHdl(std::move(pHdl3));
1375 
1376  break;
1377  }
1379  {
1380  // add interactive transparency handle
1381  const size_t nMarkCount = GetMarkedObjectCount();
1382  if(nMarkCount == 1)
1383  {
1384  SdrObject* pObj = GetMarkedObjectByIndex(0);
1385  SdrModel* pModel = GetModel();
1386  const SfxItemSet& rSet = pObj->GetMergedItemSet();
1387 
1388  if(SfxItemState::SET != rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE, false))
1389  {
1390  // add this item, it's not yet there
1392  XGradient aGrad = aNewItem.GetGradientValue();
1393 
1394  aNewItem.SetEnabled(true);
1395  aGrad.SetStartIntens(100);
1396  aGrad.SetEndIntens(100);
1397  aNewItem.SetGradientValue(aGrad);
1398 
1399  // add undo to allow user to take back this step
1400  if( pModel->IsUndoEnabled() )
1401  {
1402  pModel->BegUndo(SvxResId(SIP_XA_FILLTRANSPARENCE));
1403  pModel->AddUndo(pModel->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
1404  pModel->EndUndo();
1405  }
1406 
1407  SfxItemSet aNewSet(pModel->GetItemPool());
1408  aNewSet.Put(aNewItem);
1409  pObj->SetMergedItemSetAndBroadcast(aNewSet);
1410  }
1411 
1412  // set values and transform to vector set
1413  GradTransVector aGradTransVector;
1414  GradTransGradient aGradTransGradient;
1415 
1416  aGradTransGradient.aGradient = rSet.Get(XATTR_FILLFLOATTRANSPARENCE).GetGradientValue();
1417  GradTransformer::GradToVec(aGradTransGradient, aGradTransVector, pObj);
1418 
1419  // build handles
1420  const Point aTmpPos1(basegfx::fround(aGradTransVector.maPositionA.getX()), basegfx::fround(aGradTransVector.maPositionA.getY()));
1421  const Point aTmpPos2(basegfx::fround(aGradTransVector.maPositionB.getX()), basegfx::fround(aGradTransVector.maPositionB.getY()));
1422  std::unique_ptr<SdrHdlColor> pColHdl1(new SdrHdlColor(aTmpPos1, aGradTransVector.aCol1, SDR_HANDLE_COLOR_SIZE_NORMAL, true));
1423  std::unique_ptr<SdrHdlColor> pColHdl2(new SdrHdlColor(aTmpPos2, aGradTransVector.aCol2, SDR_HANDLE_COLOR_SIZE_NORMAL, true));
1424  std::unique_ptr<SdrHdlGradient> pGradHdl(new SdrHdlGradient(aTmpPos1, aTmpPos2, false));
1425  DBG_ASSERT(pColHdl1 && pColHdl2 && pGradHdl, "Could not get all necessary handles!");
1426 
1427  // link them
1428  pGradHdl->SetColorHandles(pColHdl1.get(), pColHdl2.get());
1429  pGradHdl->SetObj(pObj);
1430  pColHdl1->SetColorChangeHdl(LINK(pGradHdl.get(), SdrHdlGradient, ColorChangeHdl));
1431  pColHdl2->SetColorChangeHdl(LINK(pGradHdl.get(), SdrHdlGradient, ColorChangeHdl));
1432 
1433  // insert them
1434  maHdlList.AddHdl(std::move(pColHdl1));
1435  maHdlList.AddHdl(std::move(pColHdl2));
1436  maHdlList.AddHdl(std::move(pGradHdl));
1437  }
1438  break;
1439  }
1440  case SdrDragMode::Gradient:
1441  {
1442  // add interactive gradient handle
1443  const size_t nMarkCount = GetMarkedObjectCount();
1444  if(nMarkCount == 1)
1445  {
1446  SdrObject* pObj = GetMarkedObjectByIndex(0);
1447  const SfxItemSet& rSet = pObj->GetMergedItemSet();
1448  drawing::FillStyle eFillStyle = rSet.Get(XATTR_FILLSTYLE).GetValue();
1449 
1450  if(eFillStyle == drawing::FillStyle_GRADIENT)
1451  {
1452  // set values and transform to vector set
1453  GradTransVector aGradTransVector;
1454  GradTransGradient aGradTransGradient;
1455  Size aHdlSize(15, 15);
1456 
1457  aGradTransGradient.aGradient = rSet.Get(XATTR_FILLGRADIENT).GetGradientValue();
1458  GradTransformer::GradToVec(aGradTransGradient, aGradTransVector, pObj);
1459 
1460  // build handles
1461  const Point aTmpPos1(basegfx::fround(aGradTransVector.maPositionA.getX()), basegfx::fround(aGradTransVector.maPositionA.getY()));
1462  const Point aTmpPos2(basegfx::fround(aGradTransVector.maPositionB.getX()), basegfx::fround(aGradTransVector.maPositionB.getY()));
1463  std::unique_ptr<SdrHdlColor> pColHdl1(new SdrHdlColor(aTmpPos1, aGradTransVector.aCol1, aHdlSize, false));
1464  std::unique_ptr<SdrHdlColor> pColHdl2(new SdrHdlColor(aTmpPos2, aGradTransVector.aCol2, aHdlSize, false));
1465  std::unique_ptr<SdrHdlGradient> pGradHdl(new SdrHdlGradient(aTmpPos1, aTmpPos2, true));
1466  DBG_ASSERT(pColHdl1 && pColHdl2 && pGradHdl, "Could not get all necessary handles!");
1467 
1468  // link them
1469  pGradHdl->SetColorHandles(pColHdl1.get(), pColHdl2.get());
1470  pGradHdl->SetObj(pObj);
1471  pColHdl1->SetColorChangeHdl(LINK(pGradHdl.get(), SdrHdlGradient, ColorChangeHdl));
1472  pColHdl2->SetColorChangeHdl(LINK(pGradHdl.get(), SdrHdlGradient, ColorChangeHdl));
1473 
1474  // insert them
1475  maHdlList.AddHdl(std::move(pColHdl1));
1476  maHdlList.AddHdl(std::move(pColHdl2));
1477  maHdlList.AddHdl(std::move(pGradHdl));
1478  }
1479  }
1480  break;
1481  }
1482  case SdrDragMode::Crop:
1483  {
1484  // TODO
1485  break;
1486  }
1487  default: break;
1488  }
1489 }
1490 
1493 {
1494  if(maHdlList.GetHdlCount())
1495  {
1496  SdrHdl* pMouseOverHdl = nullptr;
1497  if( !rMEvt.IsLeaveWindow() && pWin )
1498  {
1499  Point aMDPos( pWin->PixelToLogic( rMEvt.GetPosPixel() ) );
1500  pMouseOverHdl = PickHandle(aMDPos);
1501  }
1502 
1503  // notify last mouse over handle that he lost the mouse
1504  const size_t nHdlCount = maHdlList.GetHdlCount();
1505 
1506  for(size_t nHdl = 0; nHdl < nHdlCount; ++nHdl)
1507  {
1508  SdrHdl* pCurrentHdl = GetHdl(nHdl);
1509  if( pCurrentHdl->mbMouseOver )
1510  {
1511  if( pCurrentHdl != pMouseOverHdl )
1512  {
1513  pCurrentHdl->mbMouseOver = false;
1514  pCurrentHdl->onMouseLeave();
1515  }
1516  break;
1517  }
1518  }
1519 
1520  // notify current mouse over handle
1521  if( pMouseOverHdl )
1522  {
1523  pMouseOverHdl->mbMouseOver = true;
1524  pMouseOverHdl->onMouseEnter(rMEvt);
1525  }
1526  }
1527  return SdrSnapView::MouseMove(rMEvt, pWin);
1528 }
1529 
1531 {
1532  if (maHdlList.GetHdlCount())
1533  {
1534  const size_t nHdlCount = maHdlList.GetHdlCount();
1535 
1536  for (size_t nHdl = 0; nHdl < nHdlCount; ++nHdl)
1537  {
1538  SdrHdl* pCurrentHdl = GetHdl(nHdl);
1539  if (pCurrentHdl->mbMouseOver)
1540  {
1541  pCurrentHdl->onHelpRequest();
1542  return true;
1543  }
1544  }
1545  }
1546  return SdrSnapView::RequestHelp(rHEvt);
1547 }
1548 
1550 {
1551  switch(meDragMode)
1552  {
1553  case SdrDragMode::Rotate:
1554  {
1556  maRef1 = aR.Center();
1557 
1558  break;
1559  }
1560 
1561  case SdrDragMode::Mirror:
1562  {
1563  // first calculate the length of the axis of reflection
1564  tools::Long nOutMin=0;
1565  tools::Long nOutMax=0;
1566  tools::Long nMinLen=0;
1567  tools::Long nObjDst=0;
1568  tools::Long nOutHgt=0;
1570  if (pOut!=nullptr) {
1571  // minimum length: 50 pixels
1572  nMinLen=pOut->PixelToLogic(Size(0,50)).Height();
1573  // 20 pixels distance to the Obj for the reference point
1574  nObjDst=pOut->PixelToLogic(Size(0,20)).Height();
1575  // MinY/MaxY
1576  // margin = minimum length = 10 pixels
1577  tools::Long nDst=pOut->PixelToLogic(Size(0,10)).Height();
1578  nOutMin=-pOut->GetMapMode().GetOrigin().Y();
1579  nOutMax=pOut->GetOutputSize().Height()-1+nOutMin;
1580  nOutMin+=nDst;
1581  nOutMax-=nDst;
1582  // absolute minimum length, however, is 10 pixels
1583  if (nOutMax-nOutMin<nDst) {
1584  nOutMin+=nOutMax+1;
1585  nOutMin/=2;
1586  nOutMin-=(nDst+1)/2;
1587  nOutMax=nOutMin+nDst;
1588  }
1589  nOutHgt=nOutMax-nOutMin;
1590  // otherwise minimum length = 1/4 OutHgt
1591  tools::Long nTemp=nOutHgt/4;
1592  if (nTemp>nMinLen) nMinLen=nTemp;
1593  }
1594 
1596  Point aCenter(aR.Center());
1597  tools::Long nMarkHgt=aR.GetHeight()-1;
1598  tools::Long nHgt=nMarkHgt+nObjDst*2; // 20 pixels overlapping above and below
1599  if (nHgt<nMinLen) nHgt=nMinLen; // minimum length 50 pixels or 1/4 OutHgt, respectively
1600 
1601  tools::Long nY1=aCenter.Y()-(nHgt+1)/2;
1602  tools::Long nY2=nY1+nHgt;
1603 
1604  if (pOut!=nullptr && nMinLen>nOutHgt) nMinLen=nOutHgt; // TODO: maybe shorten this a little
1605 
1606  if (pOut!=nullptr) { // now move completely into the visible area
1607  if (nY1<nOutMin) {
1608  nY1=nOutMin;
1609  if (nY2<nY1+nMinLen) nY2=nY1+nMinLen;
1610  }
1611  if (nY2>nOutMax) {
1612  nY2=nOutMax;
1613  if (nY1>nY2-nMinLen) nY1=nY2-nMinLen;
1614  }
1615  }
1616 
1617  maRef1.setX(aCenter.X() );
1618  maRef1.setY(nY1 );
1619  maRef2.setX(aCenter.X() );
1620  maRef2.setY(nY2 );
1621 
1622  break;
1623  }
1624 
1626  case SdrDragMode::Gradient:
1627  case SdrDragMode::Crop:
1628  {
1630  maRef1 = aRect.TopLeft();
1631  maRef2 = aRect.BottomRight();
1632  break;
1633  }
1634  default: break;
1635  }
1636 }
1637 
1638 void SdrMarkView::SetRef1(const Point& rPt)
1639 {
1641  {
1642  maRef1 = rPt;
1644  if(pH)
1645  pH->SetPos(rPt);
1646  }
1647 }
1648 
1649 void SdrMarkView::SetRef2(const Point& rPt)
1650 {
1652  {
1653  maRef2 = rPt;
1655  if(pH)
1656  pH->SetPos(rPt);
1657  }
1658 }
1659 
1661 {
1662  return SfxViewShell::Current();
1663 }
1664 
1666 {
1667  for (size_t nm=GetMarkedObjectCount(); nm>0;) {
1668  --nm;
1669  SdrMark* pM = GetSdrMarkByIndex(nm);
1670  SdrObject* pObj = pM->GetMarkedSdrObj();
1671  SdrPageView* pPV = pM->GetPageView();
1672  bool bRaus = !pObj || !pPV->IsObjMarkable(pObj);
1673  if (bRaus)
1674  {
1676  }
1677  else
1678  {
1679  if (!IsGluePointEditMode()) { // selected glue points only in GlueEditMode
1680  SdrUShortCont& rPts = pM->GetMarkedGluePoints();
1681  rPts.clear();
1682  }
1683  }
1684  }
1685 
1686  // at least reset the remembered BoundRect to prevent handle
1687  // generation if bForceFrameHandles is TRUE.
1688  mbMarkedObjRectDirty = true;
1689 }
1690 
1692 {
1693  SdrPageView* pPV = GetSdrPageView();
1694 
1695  if(pPV)
1696  {
1697  pPV->SetHasMarkedObj(GetMarkedObjectList().TakeSnapRect(pPV, pPV->MarkSnap()));
1699  }
1700 }
1701 
1703 {
1704  if (bOn!=mbForceFrameHandles) {
1705  bool bOld=ImpIsFrameHandles();
1706  mbForceFrameHandles=bOn;
1707  bool bNew=ImpIsFrameHandles();
1708  if (bNew!=bOld) {
1709  AdjustMarkHdl();
1711  }
1712  }
1713 }
1714 
1716 {
1717  if (eMode==meEditMode) return;
1718 
1720  bool bEdge0=static_cast<SdrCreateView*>(this)->IsEdgeTool();
1722  meEditMode=eMode;
1724  bool bEdge1=static_cast<SdrCreateView*>(this)->IsEdgeTool();
1725  // avoid flickering when switching between GlueEdit and EdgeTool
1726  if (bGlue1 && !bGlue0) ImpSetGlueVisible2(bGlue1);
1727  if (bEdge1!=bEdge0) ImpSetGlueVisible3(bEdge1);
1728  if (!bGlue1 && bGlue0) ImpSetGlueVisible2(bGlue1);
1729  if (bGlue0 && !bGlue1) UnmarkAllGluePoints();
1730 }
1731 
1732 
1733 bool SdrMarkView::IsObjMarkable(SdrObject const * pObj, SdrPageView const * pPV) const
1734 {
1735  if (pObj)
1736  {
1737  if (pObj->IsMarkProtect() ||
1738  (!mbDesignMode && pObj->IsUnoObj()))
1739  {
1740  // object not selectable or
1741  // SdrUnoObj not in DesignMode
1742  return false;
1743  }
1744  }
1745  return pPV==nullptr || pPV->IsObjMarkable(pObj);
1746 }
1747 
1748 bool SdrMarkView::IsMarkedObjHit(const Point& rPnt, short nTol) const
1749 {
1750  bool bRet=false;
1751  nTol=ImpGetHitTolLogic(nTol,nullptr);
1752  for (size_t nm=0; nm<GetMarkedObjectCount() && !bRet; ++nm) {
1753  SdrMark* pM=GetSdrMarkByIndex(nm);
1754  bRet = nullptr != CheckSingleSdrObjectHit(rPnt,sal_uInt16(nTol),pM->GetMarkedSdrObj(),pM->GetPageView(),SdrSearchOptions::NONE,nullptr);
1755  }
1756  return bRet;
1757 }
1758 
1759 SdrHdl* SdrMarkView::PickHandle(const Point& rPnt) const
1760 {
1761  if (mbSomeObjChgdFlag) { // recalculate handles, if necessary
1763  }
1764  return maHdlList.IsHdlListHit(rPnt);
1765 }
1766 
1767 bool SdrMarkView::MarkObj(const Point& rPnt, short nTol, bool bToggle, bool bDeep)
1768 {
1769  SdrPageView* pPV;
1770  nTol=ImpGetHitTolLogic(nTol,nullptr);
1772  if (bDeep) nOptions=nOptions|SdrSearchOptions::DEEP;
1773  SdrObject* pObj = PickObj(rPnt, static_cast<sal_uInt16>(nTol), pPV, nOptions);
1774  if (pObj) {
1775  bool bUnmark=bToggle && IsObjMarked(pObj);
1776  MarkObj(pObj,pPV,bUnmark);
1777  }
1778  return pObj != nullptr;
1779 }
1780 
1782 {
1783  SdrPageView* pPageView = GetSdrPageView();
1784 
1785  if(!pPageView)
1786  {
1787  return false;
1788  }
1789 
1791  const size_t nMarkCount=GetMarkedObjectCount();
1792  size_t nChgMarkNum = SAL_MAX_SIZE; // number of the MarkEntry we want to replace
1793  size_t nSearchObjNum = bPrev ? 0 : SAL_MAX_SIZE;
1794  if (nMarkCount!=0) {
1795  nChgMarkNum=bPrev ? 0 : nMarkCount-1;
1796  SdrMark* pM=GetSdrMarkByIndex(nChgMarkNum);
1797  OSL_ASSERT(pM!=nullptr);
1798  if (pM->GetMarkedSdrObj() != nullptr)
1799  nSearchObjNum = pM->GetMarkedSdrObj()->GetNavigationPosition();
1800  }
1801 
1802  SdrObject* pMarkObj=nullptr;
1803  SdrObjList* pSearchObjList=pPageView->GetObjList();
1804  const size_t nObjCount = pSearchObjList->GetObjCount();
1805  if (nObjCount!=0) {
1806  if (nSearchObjNum>nObjCount) nSearchObjNum=nObjCount;
1807  while (pMarkObj==nullptr && ((!bPrev && nSearchObjNum>0) || (bPrev && nSearchObjNum<nObjCount)))
1808  {
1809  if (!bPrev)
1810  nSearchObjNum--;
1811  SdrObject* pSearchObj = pSearchObjList->GetObjectForNavigationPosition(nSearchObjNum);
1812  if (IsObjMarkable(pSearchObj,pPageView))
1813  {
1814  if (TryToFindMarkedObject(pSearchObj)==SAL_MAX_SIZE)
1815  {
1816  pMarkObj=pSearchObj;
1817  }
1818  }
1819  if (bPrev) nSearchObjNum++;
1820  }
1821  }
1822 
1823  if(!pMarkObj)
1824  {
1825  return false;
1826  }
1827 
1828  if (nChgMarkNum!=SAL_MAX_SIZE)
1829  {
1831  }
1832  MarkObj(pMarkObj,pPageView); // also calls MarkListHasChanged(), AdjustMarkHdl()
1833  return true;
1834 }
1835 
1836 bool SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, bool bPrev)
1837 {
1839  nTol=ImpGetHitTolLogic(nTol,nullptr);
1840  SdrMark* pTopMarkHit=nullptr;
1841  SdrMark* pBtmMarkHit=nullptr;
1842  size_t nTopMarkHit=0;
1843  size_t nBtmMarkHit=0;
1844  // find topmost of the selected objects that is hit by rPnt
1845  const size_t nMarkCount=GetMarkedObjectCount();
1846  for (size_t nm=nMarkCount; nm>0 && pTopMarkHit==nullptr;) {
1847  --nm;
1848  SdrMark* pM=GetSdrMarkByIndex(nm);
1849  if(CheckSingleSdrObjectHit(rPnt,sal_uInt16(nTol),pM->GetMarkedSdrObj(),pM->GetPageView(),SdrSearchOptions::NONE,nullptr))
1850  {
1851  pTopMarkHit=pM;
1852  nTopMarkHit=nm;
1853  }
1854  }
1855  // nothing found, in this case, just select an object
1856  if (pTopMarkHit==nullptr) return MarkObj(rPnt,sal_uInt16(nTol));
1857 
1858  SdrObject* pTopObjHit=pTopMarkHit->GetMarkedSdrObj();
1859  SdrObjList* pObjList=pTopObjHit->getParentSdrObjListFromSdrObject();
1860  SdrPageView* pPV=pTopMarkHit->GetPageView();
1861  // find lowermost of the selected objects that is hit by rPnt
1862  // and is placed on the same PageView as pTopMarkHit
1863  for (size_t nm=0; nm<nMarkCount && pBtmMarkHit==nullptr; ++nm) {
1864  SdrMark* pM=GetSdrMarkByIndex(nm);
1865  SdrPageView* pPV2=pM->GetPageView();
1866  if (pPV2==pPV && CheckSingleSdrObjectHit(rPnt,sal_uInt16(nTol),pM->GetMarkedSdrObj(),pPV2,SdrSearchOptions::NONE,nullptr))
1867  {
1868  pBtmMarkHit=pM;
1869  nBtmMarkHit=nm;
1870  }
1871  }
1872  if (pBtmMarkHit==nullptr) { pBtmMarkHit=pTopMarkHit; nBtmMarkHit=nTopMarkHit; }
1873  SdrObject* pBtmObjHit=pBtmMarkHit->GetMarkedSdrObj();
1874  const size_t nObjCount = pObjList->GetObjCount();
1875 
1876  size_t nSearchBeg(0);
1877  E3dScene* pScene(nullptr);
1878  SdrObject* pObjHit(bPrev ? pBtmObjHit : pTopObjHit);
1879  bool bRemap =
1880  nullptr != dynamic_cast< const E3dCompoundObject* >(pObjHit);
1881  if (bRemap)
1882  {
1883  pScene = dynamic_cast< E3dScene* >(pObjHit->getParentSdrObjectFromSdrObject());
1884  bRemap = nullptr != pScene;
1885  }
1886 
1887  if(bPrev)
1888  {
1889  sal_uInt32 nOrdNumBtm(pBtmObjHit->GetOrdNum());
1890 
1891  if(bRemap)
1892  {
1893  nOrdNumBtm = pScene->RemapOrdNum(nOrdNumBtm);
1894  }
1895 
1896  nSearchBeg = nOrdNumBtm + 1;
1897  }
1898  else
1899  {
1900  sal_uInt32 nOrdNumTop(pTopObjHit->GetOrdNum());
1901 
1902  if(bRemap)
1903  {
1904  nOrdNumTop = pScene->RemapOrdNum(nOrdNumTop);
1905  }
1906 
1907  nSearchBeg = nOrdNumTop;
1908  }
1909 
1910  size_t no=nSearchBeg;
1911  SdrObject* pFndObj=nullptr;
1912  while (pFndObj==nullptr && ((!bPrev && no>0) || (bPrev && no<nObjCount))) {
1913  if (!bPrev) no--;
1914  SdrObject* pObj;
1915 
1916  if(bRemap)
1917  {
1918  pObj = pObjList->GetObj(pScene->RemapOrdNum(no));
1919  }
1920  else
1921  {
1922  pObj = pObjList->GetObj(no);
1923  }
1924 
1925  if (CheckSingleSdrObjectHit(rPnt,sal_uInt16(nTol),pObj,pPV,SdrSearchOptions::TESTMARKABLE,nullptr))
1926  {
1927  if (TryToFindMarkedObject(pObj)==SAL_MAX_SIZE) {
1928  pFndObj=pObj;
1929  } else {
1930  // TODO: for performance reasons set on to Top or Btm, if necessary
1931  }
1932  }
1933  if (bPrev) no++;
1934  }
1935  if (pFndObj!=nullptr)
1936  {
1937  GetMarkedObjectListWriteAccess().DeleteMark(bPrev?nBtmMarkHit:nTopMarkHit);
1940  AdjustMarkHdl();
1941  }
1942  return pFndObj!=nullptr;
1943 }
1944 
1945 void SdrMarkView::MarkObj(const tools::Rectangle& rRect, bool bUnmark)
1946 {
1947  bool bFnd=false;
1948  tools::Rectangle aR(rRect);
1949  SdrObjList* pObjList;
1950  BrkAction();
1951  SdrPageView* pPV = GetSdrPageView();
1952 
1953  if(pPV)
1954  {
1955  pObjList=pPV->GetObjList();
1956  tools::Rectangle aFrm1(aR);
1957  const size_t nObjCount = pObjList->GetObjCount();
1958  for (size_t nO=0; nO<nObjCount; ++nO) {
1959  SdrObject* pObj=pObjList->GetObj(nO);
1960  tools::Rectangle aRect(pObj->GetCurrentBoundRect());
1961  if (aFrm1.IsInside(aRect)) {
1962  if (!bUnmark) {
1963  if (IsObjMarkable(pObj,pPV))
1964  {
1966  bFnd=true;
1967  }
1968  } else {
1969  const size_t nPos=TryToFindMarkedObject(pObj);
1970  if (nPos!=SAL_MAX_SIZE)
1971  {
1973  bFnd=true;
1974  }
1975  }
1976  }
1977  }
1978  }
1979  if (bFnd) {
1982  AdjustMarkHdl();
1983  }
1984 }
1985 
1986 namespace {
1987 
1988 void collectUIInformation(const SdrObject* pObj)
1989 {
1990  EventDescription aDescription;
1991  aDescription.aAction = "SELECT";
1992  aDescription.aParent = "MainWindow";
1993  aDescription.aKeyWord = "CurrentApp";
1994 
1995  if (!pObj->GetName().isEmpty())
1996  aDescription.aParameters = {{"OBJECT", pObj->GetName()}};
1997  else
1998  aDescription.aParameters = {{"OBJECT", "Unnamed_Obj_" + OUString::number(pObj->GetOrdNum())}};
1999 
2000  UITestLogger::getInstance().logEvent(aDescription);
2001 }
2002 
2003 }
2004 
2005  void SdrMarkView::MarkObj(SdrObject* pObj, SdrPageView* pPV, bool bUnmark, bool bDoNoSetMarkHdl,
2006  std::vector<basegfx::B2DRectangle> const & rSubSelections)
2007 {
2008  if (!(pObj!=nullptr && pPV!=nullptr && IsObjMarkable(pObj, pPV)))
2009  return;
2010 
2011  BrkAction();
2012  if (!bUnmark)
2013  {
2015  collectUIInformation(pObj);
2016  }
2017  else
2018  {
2019  const size_t nPos=TryToFindMarkedObject(pObj);
2020  if (nPos!=SAL_MAX_SIZE)
2021  {
2023  }
2024  }
2025 
2026  maSubSelectionList = rSubSelections;
2027 
2028  if (!bDoNoSetMarkHdl) {
2030  AdjustMarkHdl();
2031  }
2032 }
2033 
2034 bool SdrMarkView::IsObjMarked(SdrObject const * pObj) const
2035 {
2036  return TryToFindMarkedObject(pObj)!=SAL_MAX_SIZE;
2037 }
2038 
2040 {
2041  return maHdlList.GetHdlSize()*2+1;
2042 }
2043 
2045 {
2046  if (nSiz<3) nSiz=3;
2047  nSiz/=2;
2048  if (nSiz!=maHdlList.GetHdlSize()) {
2049  maHdlList.SetHdlSize(nSiz);
2050  }
2051 }
2052 
2054  basegfx::B2DVector& rOffset,
2055  const SdrObject* pObj,
2056  const SdrPageView* pPV) const
2057 {
2058  if(nullptr == pObj || nullptr == pPV)
2059  {
2060  return false;
2061  }
2062 
2063  const OutputDevice* pOutputDevice(GetFirstOutputDevice());
2064 
2065  if(nullptr == pOutputDevice)
2066  {
2067  return false;
2068  }
2069 
2070  const SdrPageWindow* pSdrPageWindow(pPV->FindPageWindow(*pOutputDevice));
2071 
2072  if(nullptr == pSdrPageWindow)
2073  {
2074  return false;
2075  }
2076 
2077  const sdr::contact::ObjectContact& rObjectContact(pSdrPageWindow->GetObjectContact());
2078 
2079  if(!rObjectContact.supportsGridOffsets())
2080  {
2081  return false;
2082  }
2083 
2085  const_cast<sdr::contact::ObjectContact&>(rObjectContact)));
2086 
2087  rOffset = rVOC.getGridOffset();
2088 
2089  return !rOffset.equalZero();
2090 }
2091 
2093  basegfx::B2DVector& rOffset,
2094  const basegfx::B2DPoint& rPoint,
2095  const SdrPageView* pPV) const
2096 {
2097  if(nullptr == pPV)
2098  {
2099  return false;
2100  }
2101 
2102  const OutputDevice* pOutputDevice(GetFirstOutputDevice());
2103 
2104  if(nullptr == pOutputDevice)
2105  {
2106  return false;
2107  }
2108 
2109  const SdrPageWindow* pSdrPageWindow(pPV->FindPageWindow(*pOutputDevice));
2110 
2111  if(nullptr == pSdrPageWindow)
2112  {
2113  return false;
2114  }
2115 
2116  const sdr::contact::ObjectContact& rObjectContact(pSdrPageWindow->GetObjectContact());
2117 
2118  if(!rObjectContact.supportsGridOffsets())
2119  {
2120  return false;
2121  }
2122 
2123  rObjectContact.calculateGridOffsetForB2DRange(rOffset, basegfx::B2DRange(rPoint));
2124 
2125  return !rOffset.equalZero();
2126 }
2127 
2128 SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay) const
2129 {
2130  if(((nOptions & SdrSearchOptions::IMPISMASTER) && pObj->IsNotVisibleAsMaster()) || (!pObj->IsVisible()))
2131  {
2132  return nullptr;
2133  }
2134 
2135  const bool bCheckIfMarkable(nOptions & SdrSearchOptions::TESTMARKABLE);
2136  const bool bDeep(nOptions & SdrSearchOptions::DEEP);
2137  const bool bOLE(dynamic_cast< const SdrOle2Obj* >(pObj) != nullptr);
2138  auto pTextObj = dynamic_cast<const SdrTextObj*>( pObj);
2139  const bool bTXT(pTextObj && pTextObj->IsTextFrame());
2140  SdrObject* pRet=nullptr;
2141  tools::Rectangle aRect(pObj->GetCurrentBoundRect());
2142 
2143  // add possible GridOffset to up-to-now view-independent BoundRect data
2144  basegfx::B2DVector aGridOffset(0.0, 0.0);
2145  if(getPossibleGridOffsetForSdrObject(aGridOffset, pObj, pPV))
2146  {
2147  aRect += Point(
2148  basegfx::fround(aGridOffset.getX()),
2149  basegfx::fround(aGridOffset.getY()));
2150  }
2151 
2152  sal_uInt16 nTol2(nTol);
2153 
2154  // double tolerance for OLE, text frames and objects in
2155  // active text edit
2156  if(bOLE || bTXT || pObj==static_cast<const SdrObjEditView*>(this)->GetTextEditObject())
2157  {
2158  nTol2*=2;
2159  }
2160 
2161  aRect.AdjustLeft( -nTol2 ); // add 1 tolerance for all objects
2162  aRect.AdjustTop( -nTol2 );
2163  aRect.AdjustRight(nTol2 );
2164  aRect.AdjustBottom(nTol2 );
2165 
2166  if (aRect.IsInside(rPnt))
2167  {
2168  if (!bCheckIfMarkable || IsObjMarkable(pObj,pPV))
2169  {
2170  SdrObjList* pOL=pObj->GetSubList();
2171 
2172  if (pOL!=nullptr && pOL->GetObjCount()!=0)
2173  {
2174  SdrObject* pTmpObj;
2175  // adjustment hit point for virtual objects
2176  Point aPnt( rPnt );
2177 
2178  if ( auto pVirtObj = dynamic_cast<const SdrVirtObj*>( pObj) )
2179  {
2180  Point aOffset = pVirtObj->GetOffset();
2181  aPnt.Move( -aOffset.X(), -aOffset.Y() );
2182  }
2183 
2184  pRet=CheckSingleSdrObjectHit(aPnt,nTol,pOL,pPV,nOptions,pMVisLay,pTmpObj);
2185  }
2186  else
2187  {
2188  if(!pMVisLay || pMVisLay->IsSet(pObj->GetLayer()))
2189  {
2190  pRet = SdrObjectPrimitiveHit(*pObj, rPnt, nTol2, *pPV, &pPV->GetVisibleLayers(), false);
2191  }
2192  }
2193  }
2194  }
2195 
2196  if (!bDeep && pRet!=nullptr)
2197  {
2198  pRet=pObj;
2199  }
2200 
2201  return pRet;
2202 }
2203 
2204 SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList const * pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay, SdrObject*& rpRootObj) const
2205 {
2206  return (*this).CheckSingleSdrObjectHit(rPnt,nTol,pOL,pPV,nOptions,pMVisLay,rpRootObj,nullptr);
2207 }
2208 SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList const * pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay, SdrObject*& rpRootObj,const SdrMarkList * pMarkList) const
2209 {
2210  SdrObject* pRet=nullptr;
2211  rpRootObj=nullptr;
2212  if (pOL!=nullptr)
2213  {
2214  const bool bRemap(
2215  nullptr != pOL->getSdrObjectFromSdrObjList()
2216  && nullptr != dynamic_cast< const E3dScene* >(pOL->getSdrObjectFromSdrObjList()));
2217  const E3dScene* pRemapScene(bRemap ? static_cast< E3dScene* >(pOL->getSdrObjectFromSdrObjList()) : nullptr);
2218  const size_t nObjCount(pOL->GetObjCount());
2219  size_t nObjNum(nObjCount);
2220 
2221  while (pRet==nullptr && nObjNum>0)
2222  {
2223  nObjNum--;
2224  SdrObject* pObj;
2225 
2226  if(bRemap)
2227  {
2228  pObj = pOL->GetObj(pRemapScene->RemapOrdNum(nObjNum));
2229  }
2230  else
2231  {
2232  pObj = pOL->GetObj(nObjNum);
2233  }
2234  if (nOptions & SdrSearchOptions::BEFOREMARK)
2235  {
2236  if (pMarkList!=nullptr)
2237  {
2238  if ((*pMarkList).FindObject(pObj)!=SAL_MAX_SIZE)
2239  {
2240  return nullptr;
2241  }
2242  }
2243  }
2244  pRet=CheckSingleSdrObjectHit(rPnt,nTol,pObj,pPV,nOptions,pMVisLay);
2245  if (pRet!=nullptr) rpRootObj=pObj;
2246  }
2247  }
2248  return pRet;
2249 }
2250 
2251 SdrObject* SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrPageView*& rpPV, SdrSearchOptions nOptions) const
2252 {
2253  return PickObj(rPnt, nTol, rpPV, nOptions, nullptr);
2254 }
2255 
2256 SdrObject* SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrPageView*& rpPV, SdrSearchOptions nOptions, SdrObject** ppRootObj, bool* pbHitPassDirect) const
2257 { // TODO: lacks a Pass2,Pass3
2259  if (ppRootObj!=nullptr) *ppRootObj=nullptr;
2260  if (pbHitPassDirect!=nullptr) *pbHitPassDirect=true;
2261  SdrObject* pRet = nullptr;
2262  rpPV=nullptr;
2263  bool bMarked(nOptions & SdrSearchOptions::MARKED);
2264  bool bMasters=!bMarked && bool(nOptions & SdrSearchOptions::ALSOONMASTER);
2265  // nOptions & SdrSearchOptions::NEXT: n.i.
2266  // nOptions & SdrSearchOptions::PASS2BOUND: n.i.
2267  // nOptions & SdrSearchOptions::PASS3NEAREST// n.i.
2268  if (nTol<0) nTol=ImpGetHitTolLogic(nTol,nullptr);
2269  SdrObject* pObj=nullptr;
2270  SdrObject* pHitObj=nullptr;
2271  SdrPageView* pPV=nullptr;
2272  if (static_cast<const SdrObjEditView*>(this)->IsTextEditFrameHit(rPnt)) {
2273  pObj=static_cast<const SdrObjEditView*>(this)->GetTextEditObject();
2274  pHitObj=pObj;
2275  pPV=static_cast<const SdrObjEditView*>(this)->GetTextEditPageView();
2276  }
2277  if (bMarked) {
2278  const size_t nMrkCnt=GetMarkedObjectCount();
2279  size_t nMrkNum=nMrkCnt;
2280  while (pHitObj==nullptr && nMrkNum>0) {
2281  nMrkNum--;
2282  SdrMark* pM=GetSdrMarkByIndex(nMrkNum);
2283  pObj=pM->GetMarkedSdrObj();
2284  pPV=pM->GetPageView();
2285  pHitObj=CheckSingleSdrObjectHit(rPnt,nTol,pObj,pPV,nOptions,nullptr);
2286  }
2287  }
2288  else
2289  {
2290  pPV = GetSdrPageView();
2291 
2292  if(pPV)
2293  {
2294  SdrPage* pPage=pPV->GetPage();
2295  sal_uInt16 nPgCount=1;
2296 
2297  if(bMasters && pPage->TRG_HasMasterPage())
2298  {
2299  nPgCount++;
2300  }
2301  bool bWholePage(nOptions & SdrSearchOptions::WHOLEPAGE);
2302  bool bExtraPassForWholePage=bWholePage && pPage!=pPV->GetObjList();
2303  if (bExtraPassForWholePage) nPgCount++; // First search in AktObjList, then on the entire page
2304  sal_uInt16 nPgNum=nPgCount;
2305  while (pHitObj==nullptr && nPgNum>0) {
2306  SdrSearchOptions nTmpOptions=nOptions;
2307  nPgNum--;
2308  const SdrLayerIDSet* pMVisLay=nullptr;
2309  SdrObjList* pObjList=nullptr;
2310  if (pbHitPassDirect!=nullptr) *pbHitPassDirect = true;
2311  if (nPgNum>=nPgCount-1 || (bExtraPassForWholePage && nPgNum>=nPgCount-2))
2312  {
2313  pObjList=pPV->GetObjList();
2314  if (bExtraPassForWholePage && nPgNum==nPgCount-2) {
2315  pObjList=pPage;
2316  if (pbHitPassDirect!=nullptr) *pbHitPassDirect = false;
2317  }
2318  }
2319  else
2320  {
2321  // otherwise MasterPage
2322  SdrPage& rMasterPage = pPage->TRG_GetMasterPage();
2323  pMVisLay = &pPage->TRG_GetMasterPageVisibleLayers();
2324  pObjList = &rMasterPage;
2325 
2326  if (pbHitPassDirect!=nullptr) *pbHitPassDirect = false;
2327  nTmpOptions=nTmpOptions | SdrSearchOptions::IMPISMASTER;
2328  }
2329  pHitObj=CheckSingleSdrObjectHit(rPnt,nTol,pObjList,pPV,nTmpOptions,pMVisLay,pObj,&(GetMarkedObjectList()));
2330  }
2331  }
2332  }
2333  if (pHitObj!=nullptr) {
2334  if (ppRootObj!=nullptr) *ppRootObj=pObj;
2335  if (nOptions & SdrSearchOptions::DEEP) pObj=pHitObj;
2336  if (nOptions & SdrSearchOptions::TESTTEXTEDIT) {
2337  if (!pObj->HasTextEdit() || pPV->GetLockedLayers().IsSet(pObj->GetLayer())) {
2338  pObj=nullptr;
2339  }
2340  }
2341  if (pObj!=nullptr && (nOptions & SdrSearchOptions::TESTMACRO)) {
2342  SdrObjMacroHitRec aHitRec;
2343  aHitRec.aPos=rPnt;
2344  aHitRec.nTol=nTol;
2345  aHitRec.pVisiLayer=&pPV->GetVisibleLayers();
2346  aHitRec.pPageView=pPV;
2347  if (!pObj->HasMacro() || !pObj->IsMacroHit(aHitRec)) pObj=nullptr;
2348  }
2349  if (pObj!=nullptr) {
2350  pRet=pObj;
2351  rpPV=pPV;
2352  }
2353  }
2354  return pRet;
2355 }
2356 
2357 bool SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, SdrSearchOptions nOptions) const
2358 {
2360  const bool bBoundCheckOn2ndPass(nOptions & SdrSearchOptions::PASS2BOUND);
2361  rpObj=nullptr;
2362  rpPV=nullptr;
2363  const size_t nMarkCount=GetMarkedObjectCount();
2364  for (size_t nMarkNum=nMarkCount; nMarkNum>0;) {
2365  --nMarkNum;
2366  SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
2367  SdrPageView* pPV=pM->GetPageView();
2368  SdrObject* pObj=pM->GetMarkedSdrObj();
2370  rpObj=pObj;
2371  rpPV=pPV;
2372  return true;
2373  }
2374  }
2375  if (bBoundCheckOn2ndPass) {
2376  for (size_t nMarkNum=nMarkCount; nMarkNum>0;) {
2377  --nMarkNum;
2378  SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
2379  SdrPageView* pPV=pM->GetPageView();
2380  SdrObject* pObj=pM->GetMarkedSdrObj();
2381  tools::Rectangle aRect(pObj->GetCurrentBoundRect());
2382  aRect.AdjustLeft( -mnHitTolLog );
2383  aRect.AdjustTop( -mnHitTolLog );
2384  aRect.AdjustRight(mnHitTolLog );
2385  aRect.AdjustBottom(mnHitTolLog );
2386  if (aRect.IsInside(rPnt)) {
2387  rpObj=pObj;
2388  rpPV=pPV;
2389  return true;
2390  }
2391  }
2392  }
2393  return false;
2394 }
2395 
2396 
2398 {
2399  if (GetMarkedObjectCount()==0)
2400  return;
2401 
2402  BrkAction();
2403  if (pPV!=nullptr)
2404  {
2406  }
2407  else
2408  {
2410  }
2411  mpMarkedObj=nullptr;
2412  mpMarkedPV=nullptr;
2414  AdjustMarkHdl();
2415 }
2416 
2418 {
2419  BrkAction();
2420 
2421  if(!pPV)
2422  {
2423  pPV = GetSdrPageView();
2424  }
2425 
2426  // #i69171# pPV may still be NULL if there is no SDrPageView (!), e.g. when inserting
2427  // other files
2428  if(pPV)
2429  {
2430  const bool bMarkChg(GetMarkedObjectListWriteAccess().InsertPageView(*pPV));
2431 
2432  if(bMarkChg)
2433  {
2435  }
2436  }
2437 
2438  if(GetMarkedObjectCount())
2439  {
2440  AdjustMarkHdl();
2441  }
2442 }
2443 
2445 {
2446  CheckMarked();
2447  SetMarkRects();
2448  SetMarkHandles(pOtherShell);
2449 }
2450 
2451 // BoundRect in model coordinates, no GridOffset added
2453 {
2454  tools::Rectangle aRect;
2455  for (size_t nm=0; nm<GetMarkedObjectCount(); ++nm) {
2456  SdrMark* pM=GetSdrMarkByIndex(nm);
2457  SdrObject* pO=pM->GetMarkedSdrObj();
2459  if (aRect.IsEmpty()) aRect=aR1;
2460  else aRect.Union(aR1);
2461  }
2462  return aRect;
2463 }
2464 
2465 // ObjRect in model coordinates, no GridOffset added
2467 {
2468  if (mbMarkedObjRectDirty) {
2469  const_cast<SdrMarkView*>(this)->mbMarkedObjRectDirty=false;
2470  tools::Rectangle aRect;
2471  for (size_t nm=0; nm<GetMarkedObjectCount(); ++nm) {
2472  SdrMark* pM=GetSdrMarkByIndex(nm);
2473  SdrObject* pO = pM->GetMarkedSdrObj();
2474  if (!pO)
2475  continue;
2476  tools::Rectangle aR1(pO->GetSnapRect());
2477  if (aRect.IsEmpty()) aRect=aR1;
2478  else aRect.Union(aR1);
2479  }
2480  const_cast<SdrMarkView*>(this)->maMarkedObjRect=aRect;
2481  }
2482  return maMarkedObjRect;
2483 }
2484 
2485 
2486 OUString SdrMarkView::ImpGetDescriptionString(const char* pStrCacheID, ImpGetDescriptionOptions nOpt) const
2487 {
2488  OUString sStr = SvxResId(pStrCacheID);
2489  const sal_Int32 nPos = sStr.indexOf("%1");
2490 
2491  if(nPos != -1)
2492  {
2494  {
2495  sStr = sStr.replaceAt(nPos, 2, GetDescriptionOfMarkedPoints());
2496  }
2497  else if(nOpt == ImpGetDescriptionOptions::GLUEPOINTS)
2498  {
2499  sStr = sStr.replaceAt(nPos, 2, GetDescriptionOfMarkedGluePoints());
2500  }
2501  else
2502  {
2503  sStr = sStr.replaceAt(nPos, 2, GetDescriptionOfMarkedObjects());
2504  }
2505  }
2506 
2507  return sStr.replaceFirst("%2", "0");
2508 }
2509 
2510 
2512 {
2513  // We enter only the first group found (in only one PageView), because
2514  // PageView::EnterGroup calls an AdjustMarkHdl.
2515  // TODO: I'll have to prevent that via a flag.
2516  SdrPageView* pPV = GetSdrPageView();
2517 
2518  if(!pPV)
2519  return;
2520 
2521  bool bEnter=false;
2522  for (size_t nm = GetMarkedObjectCount(); nm > 0 && !bEnter;)
2523  {
2524  --nm;
2525  SdrMark* pM=GetSdrMarkByIndex(nm);
2526  if (pM->GetPageView()==pPV) {
2527  SdrObject* pObj=pM->GetMarkedSdrObj();
2528  if (pObj->IsGroupObject()) {
2529  if (pPV->EnterGroup(pObj)) {
2530  bEnter=true;
2531  }
2532  }
2533  }
2534  }
2535 }
2536 
2537 
2539 {
2541  maSdrViewSelection.SetEdgesOfMarkedNodesDirty();
2542 
2543  mbMarkedObjRectDirty=true;
2545  bool bOneEdgeMarked=false;
2546  if (GetMarkedObjectCount()==1) {
2547  const SdrObject* pObj=GetMarkedObjectByIndex(0);
2548  if (pObj->GetObjInventor()==SdrInventor::Default) {
2549  sal_uInt16 nIdent=pObj->GetObjIdentifier();
2550  bOneEdgeMarked=nIdent==OBJ_EDGE;
2551  }
2552  }
2553  ImpSetGlueVisible4(bOneEdgeMarked);
2554 }
2555 
2556 
2558 {
2560 }
2561 
2563 {
2564  if ( mbDesignMode != bOn )
2565  {
2566  mbDesignMode = bOn;
2567  SdrPageView* pPageView = GetSdrPageView();
2568  if ( pPageView )
2569  pPageView->SetDesignMode( bOn );
2570  }
2571 }
2572 
2573 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 mnMinMovLog
Definition: svdpntv.hxx:152
Point TopLeft() const
void EndMarkGluePoints()
Definition: svdmrkv.cxx:528
SdrPage & TRG_GetMasterPage() const
Definition: svdpage.cxx:1581
virtual bool HasTextEdit() const
Definition: svdobj.cxx:1736
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
Definition: svdmrkv.cxx:2397
OutDevType GetOutDevType() const
virtual void HideSdrPage()
Definition: svdpntv.cxx:372
void SetEditMode(SdrViewEditMode eMode)
Definition: svdmrkv.cxx:1715
const SdrUShortCont & GetMarkedGluePoints() const
Definition: svdmark.hxx:115
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
Definition: svdobj.cxx:1105
bool IsMacroHit(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1872
void SetMinMove(sal_uInt16 nDist)
Definition: svddrag.hxx:111
static void notifyOtherViews(const SfxViewShell *pThisView, int nType, std::string_view rKey, const OString &rPayload)
sal_Int32 nIndex
void Reset()
Definition: svddrag.cxx:36
const tools::Rectangle & MarkSnap() const
Definition: svdpagv.hxx:186
void BrkMarkGluePoints()
Definition: svdmrkv.cxx:544
virtual bool IsTextEdit() const
Definition: svdpntv.cxx:296
bool IsNotVisibleAsMaster() const
Definition: svdobj.hxx:831
SdrHintKind GetKind() const
Definition: svdmodel.hxx:124
sal_uInt32 GetPolyNum() const
Definition: svdhdl.hxx:219
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:931
XGradient aGradient
Definition: gradtrns.hxx:40
void SetPos(const Point &rPnt)
Definition: svdhdl.cxx:341
virtual void SetMarkHandles(SfxViewShell *pOtherShell)
Definition: svdmrkv.cxx:1004
void SortMarkedObjects() const
Definition: svdmrkv.hxx:258
void SetDesignMode(bool bOn=true)
Definition: svdmrkv.cxx:2562
void UndirtyMrkPnt() const
Definition: svdmrkv1.cxx:287
bool mbMarkHandlesHidden
Definition: svdmrkv.hxx:132
bool UnmarkAllGluePoints()
Definition: svdmrkv.hxx:391
std::unique_ptr< ImplMarkingOverlay > mpMarkObjOverlay
Definition: svdmrkv.hxx:96
const SdrUShortCont & GetMarkedPoints() const
Definition: svdmark.hxx:110
basegfx::B2DPoint maPositionB
Definition: gradtrns.hxx:32
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
virtual void ModelHasChanged()
Definition: svdpntv.cxx:253
void SetSecondPosition(const basegfx::B2DPoint &rNewPosition)
Definition: svdmrkv.cxx:118
sdr::overlay::OverlayObjectList maObjects
Definition: svdmrkv.cxx:77
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
bool IsObjMarkable(SdrObject const *pObj, SdrPageView const *pPV) const
Definition: svdmrkv.cxx:1733
virtual bool IsPolyObj() const
Definition: svdobj.cxx:1708
const Point & GetStart() const
Definition: svddrag.hxx:92
Point BottomLeft() const
SdrView & GetView()
Definition: svdpagv.hxx:135
SdrHdlKind
Definition: svdhdl.hxx:52
bool isInplaceActive() const
Definition: svdoole2.cxx:812
bool AreObjectsMarked() const
Definition: svdmrkv.hxx:259
SdrSearchOptions
Definition: svdmrkv.hxx:35
long Long
bool CheckMinMoved(const Point &rPnt)
Definition: svddrag.cxx:86
bool ImpIsFrameHandles() const
Definition: svdmrkv.cxx:588
object group
Definition: svdobjkind.hxx:28
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
sdr::ViewSelection maSdrViewSelection
Definition: svdmrkv.hxx:110
void FlushComeBackTimer() const
Definition: svdpntv.cxx:244
bool IsTextFrame() const
Definition: svdotext.hxx:346
virtual ~SdrMarkView() override
Definition: svdmrkv.cxx:191
bool IsInsObjPoint() const
Definition: svddrgv.hxx:123
bool isUiActive() const
Definition: svdoole2.cxx:817
double getX() const
SdrViewEditMode
Definition: svdmrkv.hxx:74
SdrHintKind
Definition: svdmodel.hxx:93
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:770
virtual void BckAction() override
Definition: svdmrkv.cxx:317
size_t GetObjCount() const
Definition: svdpage.cxx:764
sal_uInt32 GetPointNum() const
Definition: svdhdl.hxx:222
bool IsInEditMode() const
Definition: svdotext.hxx:326
void SetSelected(bool bJa=true)
Definition: svdhdl.cxx:353
bool mbPlusHdlAlways
Definition: svdmrkv.hxx:125
virtual void addCropHandles(SdrHdlList &rTarget) const
Definition: svdobj.cxx:1231
sal_Int16 nId
virtual bool hasSpecialDrag() const
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdobj.cxx:1307
SdrObject * GetObjectForNavigationPosition(const sal_uInt32 nNavigationPosition) const
Return the object for the given navigation position.
Definition: svdpage.cxx:888
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: svdpntv.cxx:193
OUString const & GetDescriptionOfMarkedGluePoints() const
Definition: svdmrkv.hxx:262
const_iterator find(const Value &x) const
ViewObjectContact & GetViewObjectContact(ObjectContact &rObjectContact)
Definition: viewcontact.cxx:70
const MapMode & GetMapMode() const
OUString const & GetDescriptionOfMarkedPoints() const
Definition: svdmrkv.hxx:261
SdrObject * GetObj() const
Definition: svdhdl.hxx:203
double getY() const
def point()
tools::Long GetWidth() const
SdrDragStat maDragStat
Definition: svdpntv.hxx:142
SdrPageView * GetSdrPageViewOfMarkedByIndex(size_t nNum) const
Definition: svdmrkv.hxx:254
void append(std::unique_ptr< OverlayObject > pOverlayObject)
void SetUnsorted()
Definition: svdmark.hxx:175
const Point & GetPos() const
Definition: svdhdl.hxx:197
void Clear()
Definition: svdmark.cxx:201
virtual void AddToHdlList(SdrHdlList &rHdlList) const
Definition: svdobj.cxx:1207
bool HasMarkableGluePoints() const
Definition: svdmrkv1.cxx:351
virtual void BrkAction() override
Definition: svdmrkv.cxx:325
size_t TryToFindMarkedObject(const SdrObject *pObj) const
Definition: svdmrkv.hxx:253
void ImpSetGlueVisible4(bool bOn)
Definition: svdpntv.hxx:241
virtual SdrObjKind GetObjIdentifier() const
Definition: svdobj.cxx:632
bool MarkGluePoints(const tools::Rectangle *pRect, bool bUnmark)
Definition: svdmrkv1.cxx:391
media shape
Definition: svdobjkind.hxx:57
bool mbDesignMode
Definition: svdmrkv.hxx:123
void DeleteMark(size_t nNum)
Definition: svdmark.cxx:316
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:721
void BegUndo()
Definition: svdmodel.cxx:413
SfxHintId GetId() const
virtual void AddToPlusHdlList(SdrHdlList &rHdlList, SdrHdl &rHdl) const
Definition: svdobj.cxx:1227
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:248
virtual PointerStyle GetPointer() const
Definition: svdhdl.cxx:951
bool BegMarkPoints(const Point &rPnt, bool bUnmark=false)
Definition: svdmrkv.cxx:432
const tools::Rectangle & GetMarkedObjRect() const
Definition: svdmrkv.cxx:2466
Point RightCenter() const
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1645
virtual void BrkAction() override
Definition: svdsnpv.cxx:237
virtual bool MouseMove(const MouseEvent &rMEvt, OutputDevice *pWin) override
handle mouse over effects for handles
Definition: svdmrkv.cxx:1492
bool IsVisible() const
Definition: svdobj.hxx:753
void EnterMarkedGroup()
Definition: svdmrkv.cxx:2511
virtual void MarkListHasChanged()
Definition: svdmrkv.cxx:2538
bool IsEmpty() const
SdrPageWindow * FindPageWindow(SdrPaintWindow &rPaintWindow) const
Definition: svdpagv.cxx:43
static UITestLogger & getInstance()
SdrMarkView(SdrModel &rSdrModel, OutputDevice *pOut)
Definition: svdmrkv.cxx:166
void logEvent(const EventDescription &rDescription)
sal_uInt16 mnHitTolLog
Definition: svdpntv.hxx:151
void SetNameDirty()
Definition: svdmark.hxx:195
bool IsUnmarking() const
Definition: svdmrkv.cxx:93
tools::Long Left() const
sal_uInt16 ImpGetHitTolLogic(short nHitTol, const OutputDevice *pOut) const
Definition: svdpntv.cxx:315
bool IsAncestorOf(const vcl::Window &rWindow) const
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:25
OUTDEV_WINDOW
virtual void TakeActionRect(tools::Rectangle &rRect) const override
Definition: svdsnpv.cxx:244
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdmodel.cxx:547
Point BottomCenter() const
SdrHdl * GetHdl(size_t nHdlNum) const
Definition: svdmrkv.hxx:352
virtual bool MouseMove(const MouseEvent &, OutputDevice *)
Definition: svdpntv.hxx:455
tools::Long Bottom() const
static SfxViewShell * Current()
void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
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)
void MovMarkObj(const Point &rPnt)
Definition: svdmrkv.cxx:390
void Clear()
Definition: svdhdl.cxx:2245
virtual bool RequestHelp(const HelpEvent &)
Definition: svdpntv.hxx:456
sdr::overlay::OverlayObjectList maObjects
Definition: svdmrkv.cxx:136
OutputDevice * GetFirstOutputDevice() const
Definition: svdpntv.cxx:88
bool IsMarkGluePoints() const
Definition: svdmrkv.hxx:407
sal_uInt16 GetHdlSize() const
Definition: svdhdl.hxx:465
bool BegMarkGluePoints(const Point &rPnt, bool bUnmark=false)
Definition: svdmrkv.cxx:496
Point LeftCenter() const
void showMarkHandles()
Definition: svdmrkv.cxx:579
Point maRef1
Definition: svdmrkv.hxx:106
virtual SdrObject * CheckSingleSdrObjectHit(const Point &rPnt, sal_uInt16 nTol, SdrObject *pObj, SdrPageView *pPV, SdrSearchOptions nOptions, const SdrLayerIDSet *pMVisLay) const
Definition: svdmrkv.cxx:2128
void AddDragModeHdl(SdrDragMode eMode)
Definition: svdmrkv.cxx:1351
void SetDistortShear(bool bOn)
Definition: svdhdl.cxx:2225
B2IRange fround(const B2DRange &rRange)
Point maRef2
Definition: svdmrkv.hxx:107
bool TakeBoundRect(SdrPageView const *pPageView, tools::Rectangle &rRect) const
Definition: svdmark.cxx:588
virtual bool HasLimitedRotation() const
Definition: svdobj.cxx:1045
bool mbMarkedObjRectDirty
Definition: svdmrkv.hxx:127
bool IsMinMoved() const
Definition: svddrag.hxx:108
sal_uInt32 PaintWindowCount() const
Definition: svdpntv.hxx:223
SdrHdl * IsHdlListHit(const Point &rPnt) const
Definition: svdhdl.cxx:2296
bool PickMarkedObj(const Point &rPnt, SdrObject *&rpObj, SdrPageView *&rpPV, SdrSearchOptions nOptions) const
Definition: svdmrkv.cxx:2357
void Sort()
Definition: svdhdl.cxx:2253
SdrObjList * GetObjList() const
Return current List.
Definition: svdpagv.hxx:174
SdrObject * GetMarkedSdrObj() const
Definition: svdmark.hxx:68
void SetMoveOutside(bool bOn)
Definition: svdmrkv.cxx:2557
Point BottomRight() const
Everything a View needs to know about a selected object.
Definition: svdmark.hxx:44
void MarkAllObj(SdrPageView *pPV=nullptr)
Definition: svdmrkv.cxx:2417
virtual void ClearPageView()
Definition: svdpntv.cxx:344
bool mbMrkPntDirty
Definition: svdmrkv.hxx:128
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
Definition: svdmrkv.cxx:2256
bool getPossibleGridOffsetForPosition(basegfx::B2DVector &rOffset, const basegfx::B2DPoint &rPoint, const SdrPageView *pPV) const
Definition: svdmrkv.cxx:2092
SdrDragMode meDragMode
Definition: svdmrkv.hxx:119
const SdrLayerIDSet & GetVisibleLayers() const
Definition: svdpagv.hxx:215
void ImpSetGlueVisible3(bool bOn)
Definition: svdpntv.hxx:240
open Bezier-curve
Definition: svdobjkind.hxx:37
UNDERLYING_TYPE get() const
virtual const SdrGluePointList * GetGluePointList() const
Definition: svdobj.cxx:2267
sal_uInt32 RemapOrdNum(sal_uInt32 nOrdNum) const
Definition: scene3d.cxx:278
void SetObj(SdrObject *pNewObj)
Definition: svdhdl.cxx:377
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define DBG_ASSERT(sCon, aError)
bool IsLeaveWindow() const
int i
uno_Any a
#define SDRGLUEPOINT_NOTFOUND
Definition: svdglue.hxx:117
void MoveTo(SdrHdlList &rOther)
Definition: svdhdl.cxx:2323
const tools::Rectangle & MarkBound() const
Definition: svdpagv.hxx:185
bool IsUndoEnabled() const
returns true if undo is currently enabled This returns false if undo was disabled using EnableUndo( f...
Definition: svdmodel.cxx:578
void SetObjHdlNum(sal_uInt32 nNum)
Definition: svdhdl.hxx:215
virtual void MovAction(const Point &rPnt) override
Definition: svdmrkv.cxx:281
basegfx::B2DPoint maPositionA
Definition: gradtrns.hxx:31
bool IsMarkObj() const
Definition: svdmrkv.hxx:211
std::vector< basegfx::B2DRectangle > maSubSelectionList
Definition: svdmrkv.hxx:112
size_t GetMarkedObjectCount() const
Definition: svdmrkv.hxx:257
virtual void EndAction() override
Definition: svdmrkv.cxx:299
const SdrLayerIDSet & TRG_GetMasterPageVisibleLayers() const
Definition: svdpage.cxx:1587
bool MarkableObjectsExceed(int n) const
Definition: svdmrkv.cxx:553
bool IsMarkedObjHit(const Point &rPnt, short nTol=-2) const
Definition: svdmrkv.cxx:1748
OUString const & GetDescriptionOfMarkedObjects() const
Definition: svdmrkv.hxx:260
void ForceRefToMarked()
Definition: svdmrkv.cxx:1549
void hideMarkHandles()
Definition: svdmrkv.cxx:570
virtual bool IsAction() const override
Definition: svdmrkv.cxx:276
connector object
Definition: svdobjkind.hxx:48
virtual void onHelpRequest()
is called when help is requested for the area of this handle
Definition: svdhdl.cxx:1064
const SdrMarkList & GetMarkedObjectList() const
Definition: svdmrkv.hxx:251
Size GetOutputSize() const
SdrPageView * GetPageView() const
Definition: svdmark.hxx:70
void SetHasMarkedObj(bool bOn)
Definition: svdpagv.hxx:183
virtual bool IsAction() const override
Definition: svdsnpv.cxx:203
void ImpSetGlueVisible2(bool bOn)
Definition: svdpntv.hxx:239
bool mbMouseOver
Definition: svdhdl.hxx:165
bool IsGluePointEditMode() const
Definition: svdmrkv.hxx:232
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:1997
void MovMarkGluePoints(const Point &rPnt)
Definition: svdmrkv.cxx:516
SdrHdl * PickHandle(const Point &rPnt) const
Definition: svdmrkv.cxx:1759
void setSecondPosition(const basegfx::B2DPoint &rNew)
sal_uInt32 GetOrdNum() const
The order number (aka ZOrder, aka z-index) determines whether a SdrObject is located above or below a...
Definition: svdobj.cxx:873
void BrkMarkObj()
Definition: svdmrkv.cxx:422
#define SDR_HANDLE_COLOR_SIZE_NORMAL
Definition: svdhdl.hxx:252
void SetMarkHandlesForLOKit(tools::Rectangle const &rRect, const SfxViewShell *pOtherShell)
Definition: svdmrkv.cxx:688
virtual bool HasMacro() const
Definition: svdobj.cxx:1830
void SetMoveOutside(bool bOn)
Definition: svdhdl.cxx:2204
bool IsGroupObject() const
Definition: svdobj.cxx:716
void NextMove(const Point &rPnt)
Definition: svddrag.cxx:66
virtual void calculateGridOffsetForB2DRange(basegfx::B2DVector &rTarget, const basegfx::B2DRange &rB2DRange) const
void BegMarkObj(const Point &rPnt, bool bUnmark=false)
Definition: svdmrkv.cxx:376
bool IsInside(const Point &rPOINT) const
void NextPoint()
Definition: svddrag.cxx:73
bool mbSomeObjChgdFlag
Definition: svdpntv.hxx:169
SdrPageView * mpMarkedPV
Definition: svdmrkv.hxx:104
static constexpr sal_uInt16 mnFrameHandlesLimit
Definition: svdmrkv.hxx:117
MapUnit GetMapUnit() const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
const_iterator end() const
void SetHdlSize(sal_uInt16 nSiz)
Definition: svdhdl.cxx:2188
bool TRG_HasMasterPage() const
Definition: svdpage.hxx:487
tools::Rectangle GetMarkedObjBoundRect() const
Definition: svdmrkv.cxx:2452
const SdrLayerIDSet * pVisiLayer
Definition: svdobj.hxx:138
tools::Long Top() const
Abstract DrawObject.
Definition: svdobj.hxx:258
Point GetOffsetPixelFrom(const vcl::Window &rWindow) const
virtual SfxViewShell * GetSfxViewShell() const
Get access to the view shell owning this draw view, if any.
Definition: svdmrkv.cxx:1660
bool getPossibleGridOffsetForSdrObject(basegfx::B2DVector &rOffset, const SdrObject *pObj, const SdrPageView *pPV) const
Definition: svdmrkv.cxx:2053
bool MarkNextObj(bool bPrev=false)
Definition: svdmrkv.cxx:1781
SdrUndoFactory & GetSdrUndoFactory() const
returns the models undo factory.
Definition: svdmodel.cxx:1897
Point GetAbsolutePos(const SdrObject &rObj) const
Definition: svdglue.cxx:47
OUString GetName() const
Definition: svdobj.cxx:775
virtual bool IsChart() const
virtual void AddCustomHdl()
Definition: svdmrkv.cxx:1332
virtual SdrInventor GetObjInventor() const
Definition: svdobj.cxx:627
sal_uInt16 FindGluePoint(sal_uInt16 nId) const
Definition: svdglue.cxx:331
void MovMarkPoints(const Point &rPnt)
Definition: svdmrkv.cxx:452
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:651
SdrObject * mpMarkedObj
Definition: svdmrkv.hxx:103
bool IsMarkProtect() const
Definition: svdobj.hxx:755
virtual void ClearPageView() override
Definition: svdmrkv.cxx:346
Point PixelToLogic(const Point &rDevicePt) const
void EndUndo()
Definition: svdmodel.cxx:484
const SdrLayerIDSet & GetLockedLayers() const
Definition: svdpagv.hxx:219
void SetStartIntens(sal_uInt16 nNewIntens)
Definition: xgrad.hxx:64
SdrHdl * GetFocusHdl() const
Definition: svdhdl.cxx:2127
void SetRef1(const Point &rPt)
Definition: svdmrkv.cxx:1638
bool IsSet(SdrLayerID a) const
Definition: svdsob.hxx:66
SdrViewEditMode meEditMode
Definition: svdmrkv.hxx:120
size_t GetHdlCount() const
Definition: svdhdl.hxx:461
SdrHdl * GetHdl(size_t nNum) const
Definition: svdhdl.hxx:462
SdrViewEditMode meEditMode0
Definition: svdmrkv.hxx:121
bool IsUnoObj() const
Definition: svdobj.hxx:745
def rectangle(l)
bool IsMarkPoints() const
Definition: svdmrkv.hxx:361
void SetMarkRects()
Definition: svdmrkv.cxx:1691
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
bool mbMarkedPointsRectsDirty
Definition: svdmrkv.hxx:129
sal_uInt32 GetObjHdlNum() const
Definition: svdhdl.hxx:216
OverlayObject & getOverlayObject(sal_uInt32 nIndex) const
bool EndMarkObj()
Definition: svdmrkv.cxx:401
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: svdmrkv.cxx:199
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
bool equalZero() const
basegfx::B2DPoint maSecondPosition
tools::Rectangle & Union(const tools::Rectangle &rRect)
constexpr tools::Long Height() const
SdrDragMode
Definition: svdtypes.hxx:34
SdrPage * GetPage() const
Definition: svdpagv.hxx:171
OUString ImpGetDescriptionString(const char *pStrCacheID, ImpGetDescriptionOptions nOpt=ImpGetDescriptionOptions::NONE) const
Definition: svdmrkv.cxx:2486
object that represents a SdrPage
Definition: svdobjkind.hxx:52
ImplMarkingOverlay(const SdrPaintView &rView, const basegfx::B2DPoint &rStartPos, bool bUnmarking)
Definition: svdmrkv.cxx:96
virtual void MovAction(const Point &rPnt) override
Definition: svdsnpv.cxx:208
virtual void TakeActionRect(tools::Rectangle &rRect) const override
Definition: svdmrkv.cxx:333
void SetPageView(SdrPageView *pNewPV)
Definition: svdhdl.hxx:201
const SfxItemSet & GetMergedItemSet() const
Definition: svdobj.cxx:1957
std::unique_ptr< MarkingSubSelectionOverlay > mpMarkingSubSelectionOverlay
Definition: svdmrkv.hxx:100
virtual void BckAction() override
Definition: svdsnpv.cxx:230
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
Definition: svdmrkv.cxx:2444
MarkingSubSelectionOverlay(const SdrPaintView &rView, std::vector< basegfx::B2DRectangle > const &rSelections)
Definition: svdmrkv.cxx:139
void SetFocusHdl(SdrHdl *pNew)
Definition: svdhdl.cxx:2135
virtual void EndAction() override
Definition: svdsnpv.cxx:219
void SetDesignMode(bool _bDesignMode) const
Sets all elements in the view which support a design and an alive mode into the given mode...
Definition: svdpagv.cxx:340
void SetDragMode(SdrDragMode eMode)
Definition: svdmrkv.cxx:1337
sal_uInt32 GetNavigationPosition() const
Definition: svdobj.cxx:910
bool EndMarkPoints()
Definition: svdmrkv.cxx:464
bool areMarkHandlesHidden() const
Definition: svdmrkv.hxx:276
const Point & GetPosPixel() const
SdrObject * GetMarkedObjectByIndex(size_t nNum) const
Definition: svdmrkv.hxx:256
const Point & GetOrigin() const
void SetFrameHandles(bool bOn)
Definition: svdmrkv.cxx:1702
const Point & GetNow() const
Definition: svddrag.hxx:95
SdrObject * getParentSdrObjectFromSdrObject() const
Definition: svdobj.cxx:726
ImpGetDescriptionOptions
options for ImpGetDescriptionString()
Definition: svdmrkv.hxx:81
virtual bool MarkPoints(const tools::Rectangle *pRect, bool bUnmark)
Definition: svdmrkv1.cxx:186
void BrkMarkPoints()
Definition: svdmrkv.cxx:486
SdrPageView * GetSdrPageView() const
Definition: svdpntv.hxx:304
Universal Network Object packed into SvDraw object.
Definition: svdobjkind.hxx:55
bool EnterGroup(SdrObject *pObj)
Entering (editing) an object group After that, we have direct access to all member objects of the gro...
Definition: svdpagv.cxx:727
tools::Long GetHeight() const
void SetPlusHdl(bool bOn)
Definition: svdhdl.hxx:224
sal_uInt16 GetMarkHdlSizePixel() const
Definition: svdmrkv.cxx:2039
virtual void ModelHasChanged() override
Definition: svdmrkv.cxx:214
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
bool IsDragObj() const
Definition: svddrgv.hxx:103
SdrHdlList maHdlList
Definition: svdmrkv.hxx:108
tools::Long AdjustLeft(tools::Long nHorzMoveDelta)
std::unique_ptr< ImplMarkingOverlay > mpMarkGluePointsOverlay
Definition: svdmrkv.hxx:98
virtual void onMouseEnter(const MouseEvent &rMEvt)
is called when the mouse enters the area of this handle.
Definition: svdhdl.cxx:1060
const SfxItemPool & GetItemPool() const
Definition: svdmodel.hxx:314
virtual Degree100 GetRotateAngle() const
Definition: svdobj.cxx:1688
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
Definition: svdmrkv.cxx:1767
sal_uInt16 nTol
Definition: svdobj.hxx:140
basegfx::B2DPoint maSecondPosition
Definition: svdmrkv.cxx:80
SdrMark * GetSdrMarkByIndex(size_t nNum) const
Definition: svdmrkv.hxx:255
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:365
OLE object.
Definition: svdobjkind.hxx:47
SdrObjList * getParentSdrObjListFromSdrObject() const
Definition: svdobj.cxx:302
tools::Rectangle maMarkedObjRect
Definition: svdmrkv.hxx:113
std::map< OUString, OUString > aParameters
virtual void onMouseLeave()
is called when the mouse leaves the area of this handle.
Definition: svdhdl.cxx:1068
virtual std::unique_ptr< SdrUndoAction > CreateUndoAttrObject(SdrObject &rObject, bool bStyleSheet1=false, bool bSaveText=false)
Definition: svdundo.cxx:1643
rtl::OString toString() const
void InsertEntry(const SdrMark &rMark, bool bChkSort=true)
Definition: svdmark.cxx:260
void SetMarkHdlSizePixel(sal_uInt16 nSiz)
Definition: svdmrkv.cxx:2044
virtual void HideSdrPage() override
Definition: svdmrkv.cxx:352
static void GradToVec(GradTransGradient const &rG, GradTransVector &rV, const SdrObject *pObj)
Definition: gradtrns.cxx:30
css::uno::Reference< css::frame::XController > & GetXController()
SdrMarkList & GetMarkedObjectListWriteAccess()
Definition: svdmrkv.hxx:247
SdrModel * GetModel() const
Definition: svdpntv.hxx:265
void SetRef2(const Point &rPt)
Definition: svdmrkv.cxx:1649
virtual SdrObject * getSdrObjectFromSdrObjList() const
Definition: svdpage.cxx:132
std::unique_ptr< ImplMarkingOverlay > mpMarkPointsOverlay
Definition: svdmrkv.hxx:97
void CheckMarked()
Definition: svdmrkv.cxx:1665
bool mbForceFrameHandles
Definition: svdmrkv.hxx:124
Point TopRight() const
static void notifyInvalidation(SfxViewShell const *pThisView, std::string_view rPayload)
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
Definition: svdpntv.cxx:72
virtual vcl::Window * GetEditWindowForActiveOLEObj() const override
tools::Long Right() const
const SdrPageView * pPageView
Definition: svdobj.hxx:139
void SetRotateShear(bool bOn)
Definition: svdhdl.cxx:2220
bool IsObjMarkable(SdrObject const *pObj) const
At least one member must be visible for the Group object and it must not be locked.
Definition: svdpagv.cxx:591
Point Center() const
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
Definition: svdhdl.cxx:2289
sal_uInt16 nPos
Point TopCenter() const
static void notifyOtherView(const SfxViewShell *pThisView, SfxViewShell const *pOtherView, int nType, std::string_view rKey, const OString &rPayload)
SdrHdlKind GetKind() const
Definition: svdhdl.hxx:194
virtual bool HasMarkablePoints() const
Definition: svdmrkv1.cxx:29
sal_uInt32 count() const
bool DeletePageView(const SdrPageView &rPV)
Definition: svdmark.cxx:372
bool createTableEdgesJson(boost::property_tree::ptree &rJsonRoot)
Definition: svdotable.cxx:2456
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
Color getHilightColor() const
bool IsObjMarked(SdrObject const *pObj) const
Definition: svdmrkv.cxx:2034
virtual bool RequestHelp(const HelpEvent &rHEvt) override
Definition: svdmrkv.cxx:1530