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