LibreOffice Module svx (master)  1
svdobj.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <svx/svdobj.hxx>
21 #include <config_features.h>
22 
23 #include <sal/config.h>
24 #include <sal/log.hxx>
25 #include <rtl/ustrbuf.hxx>
26 
27 #include <com/sun/star/lang/XComponent.hpp>
28 #include <com/sun/star/text/RelOrientation.hpp>
29 
39 #include <editeng/editeng.hxx>
40 #include <editeng/outlobj.hxx>
41 #include <o3tl/deleter.hxx>
42 #include <math.h>
43 #include <svl/grabbagitem.hxx>
44 #include <tools/bigint.hxx>
45 #include <tools/diagnose_ex.h>
46 #include <tools/helpers.hxx>
47 #include <unotools/configmgr.hxx>
48 #include <vcl/canvastools.hxx>
49 #include <vcl/ptrstyle.hxx>
50 #include <vector>
51 
53 #include <svx/svdotable.hxx>
54 
59 #include <svx/sdrhittesthelper.hxx>
60 #include <svx/sdrobjectuser.hxx>
61 #include <svx/sdrobjectfilter.hxx>
62 #include <svx/svddrag.hxx>
63 #include <svx/svdetc.hxx>
64 #include <svx/svdhdl.hxx>
65 #include <svx/svditer.hxx>
66 #include <svx/svdmodel.hxx>
67 #include <svx/svdoashp.hxx>
68 #include <svx/svdocapt.hxx>
69 #include <svx/svdocirc.hxx>
70 #include <svx/svdoedge.hxx>
71 #include <svx/svdograf.hxx>
72 #include <svx/svdogrp.hxx>
73 #include <svx/svdomeas.hxx>
74 #include <svx/svdomedia.hxx>
75 #include <svx/svdoole2.hxx>
76 #include <svx/svdopage.hxx>
77 #include <svx/svdopath.hxx>
78 #include <svx/svdorect.hxx>
79 #include <svx/svdotext.hxx>
80 #include <svx/svdouno.hxx>
81 #include <svx/svdovirt.hxx>
82 #include <svx/svdpage.hxx>
83 #include <svx/svdpool.hxx>
84 #include <svx/strings.hrc>
85 #include <svx/dialmgr.hxx>
86 #include <svx/svdtrans.hxx>
87 #include <svx/svdundo.hxx>
88 #include <svx/svdview.hxx>
89 #include <sxlayitm.hxx>
90 #include <sxlogitm.hxx>
91 #include <sxmovitm.hxx>
92 #include <sxoneitm.hxx>
93 #include <sxopitm.hxx>
94 #include <sxreoitm.hxx>
95 #include <sxrooitm.hxx>
96 #include <sxsaitm.hxx>
97 #include <sxsoitm.hxx>
98 #include <sxtraitm.hxx>
99 #include <svx/unopage.hxx>
100 #include <svx/unoshape.hxx>
101 #include <svx/xfillit0.hxx>
102 #include <svx/xflclit.hxx>
103 #include <svx/xfltrit.hxx>
104 #include <svx/xlineit0.hxx>
105 #include <svx/xlnclit.hxx>
106 #include <svx/xlnedwit.hxx>
107 #include <svx/xlnstwit.hxx>
108 #include <svx/xlntrit.hxx>
109 #include <svx/xlnwtit.hxx>
110 #include <svx/svdglue.hxx>
111 #include <svx/svdsob.hxx>
112 #include <svdobjplusdata.hxx>
113 #include <svdobjuserdatalist.hxx>
114 
115 #include <unordered_set>
116 
117 #include <optional>
118 #include <libxml/xmlwriter.h>
119 #include <memory>
120 
121 using namespace ::com::sun::star;
122 
123 
125 {
126 }
127 
128 void SdrObjUserCall::Changed(const SdrObject& /*rObj*/, SdrUserCallType /*eType*/, const tools::Rectangle& /*rOldBoundRect*/)
129 {
130 }
131 
133  pVisiLayer(nullptr),
134  pPageView(nullptr),
135  nTol(0) {}
136 
137 
139  nInventor(nInv),
140  nIdentifier(nId) {}
141 
143  nInventor(rData.nInventor),
144  nIdentifier(rData.nIdentifier) {}
145 
147 
149  bMovProt(false),
150  bSizProt(false),
151  bNoPrint(false),
152  bClosedObj(false),
153  mbVisible(true),
154  mnLayerID(0)
155 {
156 }
157 
159 {
160 }
161 
163  bMoveAllowed(true),
164  bResizeFreeAllowed(true),
165  bResizePropAllowed(true),
166  bRotateFreeAllowed(true),
167  bRotate90Allowed(true),
168  bMirrorFreeAllowed(true),
169  bMirror45Allowed(true),
170  bMirror90Allowed(true),
171  bTransparenceAllowed(true),
172  bShearAllowed(true),
173  bEdgeRadiusAllowed(true),
174  bNoOrthoDesired(true),
175  bNoContortion(true),
176  bCanConvToPath(true),
177  bCanConvToPoly(true),
178  bCanConvToContour(false),
179  bCanConvToPathLineToArea(true),
180  bCanConvToPolyLineToArea(true) {}
181 
183 {
185  std::shared_ptr<DiagramDataInterface> mpDiagramData;
186  std::optional<double> mnRelativeWidth;
187  std::optional<double> mnRelativeHeight;
190 
191  Impl() :
192  meRelativeWidthRelation(text::RelOrientation::PAGE_FRAME),
193  meRelativeHeightRelation(text::RelOrientation::PAGE_FRAME) {}
194 };
195 
196 
197 // BaseProperties section
198 
199 std::unique_ptr<sdr::properties::BaseProperties> SdrObject::CreateObjectSpecificProperties()
200 {
201  return std::make_unique<sdr::properties::EmptyProperties>(*this);
202 }
203 
205 {
206  if(!mpProperties)
207  {
208  // CAUTION(!) Do *not* call this during SdrObject construction,
209  // that will lead to wrong type-casts (dependent on constructor-level)
210  // and thus eventually create the wrong sdr::properties (!). Is there
211  // a way to check if on the stack is a SdrObject-constructor (?)
212  const_cast< SdrObject* >(this)->mpProperties =
213  const_cast< SdrObject* >(this)->CreateObjectSpecificProperties();
214  }
215 
216  return *mpProperties;
217 }
218 
219 
220 // ObjectUser section
221 
223 {
224  mpImpl->maObjectUsers.push_back(&rNewUser);
225 }
226 
228 {
229  const sdr::ObjectUserVector::iterator aFindResult =
230  std::find(mpImpl->maObjectUsers.begin(), mpImpl->maObjectUsers.end(), &rOldUser);
231  if (aFindResult != mpImpl->maObjectUsers.end())
232  {
233  mpImpl->maObjectUsers.erase(aFindResult);
234  }
235 }
236 
237 
238 // DrawContact section
239 
240 std::unique_ptr<sdr::contact::ViewContact> SdrObject::CreateObjectSpecificViewContact()
241 {
242  return std::make_unique<sdr::contact::ViewContactOfSdrObj>(*this);
243 }
244 
246 {
247  if(!mpViewContact)
248  {
249  const_cast< SdrObject* >(this)->mpViewContact =
250  const_cast< SdrObject* >(this)->CreateObjectSpecificViewContact();
251  }
252 
253  return *mpViewContact;
254 }
255 
256 // DrawContact support: Methods for handling Object changes
258 {
259  // Do necessary ViewContact actions
261 }
262 
264 {
266  {
268  }
269 
270  return nullptr;
271 }
272 
274 {
276 }
277 
279 {
280  if(getParentSdrObjListFromSdrObject() == pNewObjList)
281  return;
282 
283  // remember current page
284  SdrPage* pOldPage(getSdrPageFromSdrObject());
285 
286  // set new parent
287  mpParentOfSdrObject = pNewObjList;
288 
289  // get new page
290  SdrPage* pNewPage(getSdrPageFromSdrObject());
291 
292  // broadcast page change over objects if needed
293  if(pOldPage != pNewPage)
294  {
295  handlePageChange(pOldPage, pNewPage);
296  }
297 }
298 
300 {
301  return mpParentOfSdrObject;
302 }
303 
305 {
306  // default has no children
307  return nullptr;
308 }
309 
311 {
313 }
314 
315 #ifdef DBG_UTIL
316 // SdrObjectLifetimeWatchDog:
317 void impAddIncarnatedSdrObjectToSdrModel(const SdrObject& rSdrObject, SdrModel& rSdrModel)
318 {
319  rSdrModel.maAllIncarnatedObjects.insert(&rSdrObject);
320 }
321 void impRemoveIncarnatedSdrObjectToSdrModel(const SdrObject& rSdrObject, SdrModel& rSdrModel)
322 {
323  if(!rSdrModel.maAllIncarnatedObjects.erase(&rSdrObject))
324  {
325  SAL_WARN("svx","SdrObject::~SdrObject: Destructed incarnation of SdrObject not member of this SdrModel (!)");
326  }
327 }
328 #endif
329 
331 : mpFillGeometryDefiningShape(nullptr)
332  ,mrSdrModelFromSdrObject(rSdrModel)
333  ,pUserCall(nullptr)
334  ,mpImpl(new Impl)
335  ,mpParentOfSdrObject(nullptr)
336  ,nOrdNum(0)
337  ,mnNavigationPosition(SAL_MAX_UINT32)
338  ,mnLayerID(0)
339  ,mpSvxShape( nullptr )
340  ,maWeakUnoShape()
341  ,mbDoNotInsertIntoPageAutomatically(false)
342 {
343  bVirtObj =false;
344  bSnapRectDirty =true;
345  bMovProt =false;
346  bSizProt =false;
347  bNoPrint =false;
348  bEmptyPresObj =false;
349  bNotVisibleAsMaster=false;
350  bClosedObj =false;
351  mbVisible = true;
352 
353  // #i25616#
354  mbLineIsOutsideGeometry = false;
355 
356  // #i25616#
358 
359  bIsEdge=false;
360  bIs3DObj=false;
361  bMarkProt=false;
362  bIsUnoObj=false;
363 #ifdef DBG_UTIL
364  // SdrObjectLifetimeWatchDog:
366 #endif
367 }
368 
370 {
371  // Tell all the registered ObjectUsers that the page is in destruction.
372  // And clear the vector. This means that user do not need to call RemoveObjectUser()
373  // when they get called from ObjectInDestruction().
374  sdr::ObjectUserVector aList;
375  aList.swap(mpImpl->maObjectUsers);
376  for(sdr::ObjectUser* pObjectUser : aList)
377  {
378  DBG_ASSERT(pObjectUser, "SdrObject::~SdrObject: corrupt ObjectUser list (!)");
379  pObjectUser->ObjectInDestruction(*this);
380  }
381 
382  // UserCall
385 
386  pGrabBagItem.reset();
387  mpProperties.reset();
388  mpViewContact.reset();
389 
390 #ifdef DBG_UTIL
391  // SdrObjectLifetimeWatchDog:
393 #endif
394 }
395 
396 void SdrObject::Free( SdrObject*& _rpObject )
397 {
398  SdrObject* pObject = _rpObject; _rpObject = nullptr;
399 
400  if(nullptr == pObject)
401  {
402  // nothing to do
403  return;
404  }
405 
406  SvxShape* pShape(pObject->getSvxShape());
407 
408  if(pShape)
409  {
410  if(pShape->HasSdrObjectOwnership())
411  {
412  // only the SvxShape is allowed to delete me, and will reset
413  // the ownership before doing so
414  return;
415  }
416  else
417  {
418  // not only delete pObject, but also need to dispose uno shape
419  try
420  {
421  pShape->InvalidateSdrObject();
422  uno::Reference< lang::XComponent > xShapeComp( pObject->getWeakUnoShape(), uno::UNO_QUERY_THROW );
423  xShapeComp->dispose();
424  }
425  catch( const uno::Exception& )
426  {
428  }
429  }
430  }
431 
432  delete pObject;
433 }
434 
435 void SdrObject::SetRectsDirty(bool bNotMyself, bool bRecursive)
436 {
437  if (!bNotMyself)
438  {
440  bSnapRectDirty=true;
441  }
442 
443  if (bRecursive && nullptr != getParentSdrObjListFromSdrObject())
444  {
446  }
447 }
448 
449 void SdrObject::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage)
450 {
451  // The creation of the UNO shape in SdrObject::getUnoShape is influenced
452  // by pPage, so when the page changes we need to discard the cached UNO
453  // shape so that a new one will be created.
454  // If the page is changing to another page with the same model, we
455  // assume they create compatible UNO shape objects so we shouldn't have
456  // to invalidate.
457  // TTTT: This causes quite some problems in SvxDrawPage::add when used
458  // e.g. from Writer - the SdrObject may be cloned to target model, and
459  // the xShape was added to it by purpose (see there). Thus it will be
460  // good to think about if this is really needed - it *seems* to be intended
461  // for a xShape being a on-demand-creatable resource - with the argument that
462  // the SdrPage/UnoPage used influences the SvxShape creation. This uses
463  // resources and would be nice to get rid of anyways.
464  if(nullptr == pOldPage || nullptr == pNewPage)
465  {
466  SvxShape* const pShape(getSvxShape());
467 
468  if (pShape && !pShape->HasSdrObjectOwnership())
469  {
470  setUnoShape(nullptr);
471  }
472  }
473 }
474 
475 // init global static itempool
477 
479 {
480  if(!mpGlobalItemPool)
481  {
483  SfxItemPool* pGlobalOutlPool = EditEngine::CreatePool();
484  mpGlobalItemPool->SetSecondaryPool(pGlobalOutlPool);
487  }
488 
489  return *mpGlobalItemPool;
490 }
491 
493 {
494  mpImpl->mnRelativeWidth = nValue;
495 }
496 
497 void SdrObject::SetRelativeWidthRelation( sal_Int16 eValue )
498 {
499  mpImpl->meRelativeWidthRelation = eValue;
500 }
501 
503 {
504  mpImpl->mnRelativeHeight = nValue;
505 }
506 
507 void SdrObject::SetRelativeHeightRelation( sal_Int16 eValue )
508 {
509  mpImpl->meRelativeHeightRelation = eValue;
510 }
511 
512 const double* SdrObject::GetRelativeWidth( ) const
513 {
514  if (!mpImpl->mnRelativeWidth)
515  return nullptr;
516 
517  return &*mpImpl->mnRelativeWidth;
518 }
519 
521 {
522  return mpImpl->meRelativeWidthRelation;
523 }
524 
525 const double* SdrObject::GetRelativeHeight( ) const
526 {
527  if (!mpImpl->mnRelativeHeight)
528  return nullptr;
529 
530  return &*mpImpl->mnRelativeHeight;
531 }
532 
534 {
535  return mpImpl->meRelativeHeightRelation;
536 }
537 
538 void SdrObject::SetDiagramData(std::shared_ptr<DiagramDataInterface> pDiagramData)
539 {
540  mpImpl->mpDiagramData = pDiagramData;
541 }
542 
543 std::shared_ptr<DiagramDataInterface> SdrObject::GetDiagramData() const
544 {
545  return mpImpl->mpDiagramData;
546 }
547 
549 {
551 }
552 
554 {
555  return SdrInventor::Default;
556 }
557 
559 {
560  return OBJ_NONE;
561 }
562 
564 {
565  rInfo.bRotateFreeAllowed=false;
566  rInfo.bMirrorFreeAllowed=false;
567  rInfo.bTransparenceAllowed = false;
568  rInfo.bShearAllowed =false;
569  rInfo.bEdgeRadiusAllowed=false;
570  rInfo.bCanConvToPath =false;
571  rInfo.bCanConvToPoly =false;
572  rInfo.bCanConvToContour = false;
573  rInfo.bCanConvToPathLineToArea=false;
574  rInfo.bCanConvToPolyLineToArea=false;
575 }
576 
578 {
579  return mnLayerID;
580 }
581 
583 {
584  rSet.Set(GetLayer());
585  SdrObjList* pOL=GetSubList();
586  if (pOL!=nullptr) {
587  const size_t nObjCount = pOL->GetObjCount();
588  for (size_t nObjNum = 0; nObjNum<nObjCount; ++nObjNum) {
589  pOL->GetObj(nObjNum)->getMergedHierarchySdrLayerIDSet(rSet);
590  }
591  }
592 }
593 
595 {
596  mnLayerID = nLayer;
597 }
598 
600 {
601  NbcSetLayer(nLayer);
602  SetChanged();
604 }
605 
607 {
609  if (pPlusData->pBroadcast==nullptr) pPlusData->pBroadcast.reset(new SfxBroadcaster);
610 
611  // SdrEdgeObj may be connected to same SdrObject on both ends so allow it
612  // to listen twice
613  SdrEdgeObj const*const pEdge(dynamic_cast<SdrEdgeObj const*>(&rListener));
614  rListener.StartListening(*pPlusData->pBroadcast, pEdge ? DuplicateHandling::Allow : DuplicateHandling::Unexpected);
615 }
616 
618 {
619  if (pPlusData!=nullptr && pPlusData->pBroadcast!=nullptr) {
620  rListener.EndListening(*pPlusData->pBroadcast);
621  if (!pPlusData->pBroadcast->HasListeners()) {
622  pPlusData->pBroadcast.reset();
623  }
624  }
625 }
626 
628 {
629  return pPlusData!=nullptr ? pPlusData->pBroadcast.get() : nullptr;
630 }
631 
633 {
634  AddListener(rVrtObj);
635 }
636 
638 {
639  RemoveListener(rVrtObj);
640 }
641 
643 {
644  return GetSubList()!=nullptr;
645 }
646 
648 {
649  return nullptr;
650 }
651 
653 {
655 
656  if(nullptr == pParent)
657  {
658  return nullptr;
659  }
660 
661  return pParent->getSdrObjectFromSdrObjList();
662 }
663 
664 void SdrObject::SetName(const OUString& rStr, const bool bSetChanged)
665 {
666  if (!rStr.isEmpty() && !pPlusData)
667  {
669  }
670 
671  if(!(pPlusData && pPlusData->aObjName != rStr))
672  return;
673 
674  // Undo/Redo for setting object's name (#i73249#)
675  bool bUndo( false );
676  if ( getSdrModelFromSdrObject().IsUndoEnabled() )
677  {
678  bUndo = true;
679  std::unique_ptr<SdrUndoAction> pUndoAction =
681  *this,
683  GetName(),
684  rStr );
685  getSdrModelFromSdrObject().BegUndo( pUndoAction->GetComment() );
686  getSdrModelFromSdrObject().AddUndo( std::move(pUndoAction) );
687  }
688  pPlusData->aObjName = rStr;
689  // Undo/Redo for setting object's name (#i73249#)
690  if ( bUndo )
691  {
693  }
694  if (bSetChanged)
695  {
696  SetChanged();
698  }
699 }
700 
701 OUString SdrObject::GetName() const
702 {
703  if(pPlusData)
704  {
705  return pPlusData->aObjName;
706  }
707 
708  return OUString();
709 }
710 
711 void SdrObject::SetTitle(const OUString& rStr)
712 {
713  if (!rStr.isEmpty() && !pPlusData)
714  {
716  }
717 
718  if(!(pPlusData && pPlusData->aObjTitle != rStr))
719  return;
720 
721  // Undo/Redo for setting object's title (#i73249#)
722  bool bUndo( false );
723  if ( getSdrModelFromSdrObject().IsUndoEnabled() )
724  {
725  bUndo = true;
726  std::unique_ptr<SdrUndoAction> pUndoAction =
728  *this,
730  GetTitle(),
731  rStr );
732  getSdrModelFromSdrObject().BegUndo( pUndoAction->GetComment() );
733  getSdrModelFromSdrObject().AddUndo( std::move(pUndoAction) );
734  }
735  pPlusData->aObjTitle = rStr;
736  // Undo/Redo for setting object's title (#i73249#)
737  if ( bUndo )
738  {
740  }
741  SetChanged();
743 }
744 
745 OUString SdrObject::GetTitle() const
746 {
747  if(pPlusData)
748  {
749  return pPlusData->aObjTitle;
750  }
751 
752  return OUString();
753 }
754 
755 void SdrObject::SetDescription(const OUString& rStr)
756 {
757  if (!rStr.isEmpty() && !pPlusData)
758  {
760  }
761 
762  if(!(pPlusData && pPlusData->aObjDescription != rStr))
763  return;
764 
765  // Undo/Redo for setting object's description (#i73249#)
766  bool bUndo( false );
767  if ( getSdrModelFromSdrObject().IsUndoEnabled() )
768  {
769  bUndo = true;
770  std::unique_ptr<SdrUndoAction> pUndoAction =
772  *this,
774  GetDescription(),
775  rStr );
776  getSdrModelFromSdrObject().BegUndo( pUndoAction->GetComment() );
777  getSdrModelFromSdrObject().AddUndo( std::move(pUndoAction) );
778  }
779  pPlusData->aObjDescription = rStr;
780  // Undo/Redo for setting object's description (#i73249#)
781  if ( bUndo )
782  {
784  }
785  SetChanged();
787 }
788 
790 {
791  if(pPlusData)
792  {
793  return pPlusData->aObjDescription;
794  }
795 
796  return OUString();
797 }
798 
799 sal_uInt32 SdrObject::GetOrdNum() const
800 {
801  if (nullptr != getParentSdrObjListFromSdrObject())
802  {
803  if (getParentSdrObjListFromSdrObject()->IsObjOrdNumsDirty())
804  {
806  }
807  } else const_cast<SdrObject*>(this)->nOrdNum=0;
808  return nOrdNum;
809 }
810 
811 
812 void SdrObject::SetOrdNum(sal_uInt32 nNum)
813 {
814  nOrdNum = nNum;
815 }
816 
817 void SdrObject::GetGrabBagItem(css::uno::Any& rVal) const
818 {
819  if (pGrabBagItem != nullptr)
820  pGrabBagItem->QueryValue(rVal);
821  else
822  rVal <<= uno::Sequence<beans::PropertyValue>();
823 }
824 
825 void SdrObject::SetGrabBagItem(const css::uno::Any& rVal)
826 {
827  if (pGrabBagItem == nullptr)
828  pGrabBagItem.reset(new SfxGrabBagItem);
829 
830  pGrabBagItem->PutValue(rVal, 0);
831 
832  SetChanged();
834 }
835 
837 {
838  if (nullptr != getParentSdrObjListFromSdrObject() && getParentSdrObjListFromSdrObject()->RecalcNavigationPositions())
839  {
840  return mnNavigationPosition;
841  }
842  else
843  return GetOrdNum();
844 }
845 
846 
847 void SdrObject::SetNavigationPosition (const sal_uInt32 nNewPosition)
848 {
849  mnNavigationPosition = nNewPosition;
850 }
851 
852 
853 // To make clearer that this method may trigger RecalcBoundRect and thus may be
854 // expensive and sometimes problematic (inside a bigger object change you will get
855 // non-useful BoundRects sometimes) I rename that method from GetBoundRect() to
856 // GetCurrentBoundRect().
858 {
859  if(aOutRect.IsEmpty())
860  {
861  const_cast< SdrObject* >(this)->RecalcBoundRect();
862  }
863 
864  return aOutRect;
865 }
866 
867 // To have a possibility to get the last calculated BoundRect e.g for producing
868 // the first rectangle for repaints (old and new need to be used) without forcing
869 // a RecalcBoundRect (which may be problematical and expensive sometimes) I add here
870 // a new method for accessing the last BoundRect.
872 {
873  return aOutRect;
874 }
875 
877 {
878  // #i101680# suppress BoundRect calculations on import(s)
880  return;
881 
882  // central new method which will calculate the BoundRect using primitive geometry
883  if(!aOutRect.IsEmpty())
884  return;
885 
886  // Use view-independent data - we do not want any connections
887  // to e.g. GridOffset in SdrObject-level
888  const drawinglayer::primitive2d::Primitive2DContainer& xPrimitives(GetViewContact().getViewIndependentPrimitive2DContainer());
889 
890  if(xPrimitives.empty())
891  return;
892 
893  // use neutral ViewInformation and get the range of the primitives
894  const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
895  const basegfx::B2DRange aRange(xPrimitives.getB2DRange(aViewInformation2D));
896 
897  if(!aRange.isEmpty())
898  {
900  static_cast<tools::Long>(floor(aRange.getMinX())),
901  static_cast<tools::Long>(floor(aRange.getMinY())),
902  static_cast<tools::Long>(ceil(aRange.getMaxX())),
903  static_cast<tools::Long>(ceil(aRange.getMaxY())));
904  return;
905  }
906 }
907 
909 {
911  return;
912 
913  bool bPlusDataBroadcast(pPlusData && pPlusData->pBroadcast);
914  bool bObjectChange(IsInserted());
915 
916  if(!(bPlusDataBroadcast || bObjectChange))
917  return;
918 
919  SdrHint aHint(SdrHintKind::ObjectChange, *this);
920 
921  if(bPlusDataBroadcast)
922  {
923  pPlusData->pBroadcast->Broadcast(aHint);
924  }
925 
926  if(bObjectChange)
927  {
929  }
930 }
931 
933 {
934  // For testing purposes, use the new ViewContact for change
935  // notification now.
936  ActionChanged();
937 
938  // TTTT Need to check meaning/usage of IsInserted in one
939  // of the next changes. It should not mean to have a SdrModel
940  // set (this is guaranteed now), but should be connected to
941  // being added to a SdrPage (?)
942  // TTTT tdf#120066 Indeed - This triggers e.g. by CustomShape
943  // geometry-presenting SdrObjects that are in a SdrObjGroup,
944  // but the SdrObjGroup is *by purpose* not inserted.
945  // Need to check deeper and maybe identify all ::IsInserted()
946  // calls by rename and let the compiler work...
947  if(nullptr != getSdrPageFromSdrObject())
948  {
950  }
951 }
952 
953 // tooling for painting a single object to an OutputDevice.
955 {
956  sdr::contact::SdrObjectVector aObjectVector;
957  aObjectVector.push_back(const_cast< SdrObject* >(this));
958 
960  sdr::contact::DisplayInfo aDisplayInfo;
961 
962  aPainter.ProcessDisplay(aDisplayInfo);
963 }
964 
966 {
967  drawing::LineStyle eXLS = GetMergedItem(XATTR_LINESTYLE).GetValue();
968  return (eXLS != drawing::LineStyle_NONE);
969 }
970 
972 {
973  // RotGrfFlyFrame: Default is false, support full rotation
974  return false;
975 }
976 
978 {
979  return CloneHelper< SdrObject >(rTargetModel);
980 }
981 
983 {
984  if( this == &rObj )
985  return *this;
986 
987  mpProperties.reset();
988  mpViewContact.reset();
989 
990  // The CloneSdrObject() method uses the local copy constructor from the individual
991  // sdr::properties::BaseProperties class. Since the target class maybe for another
992  // draw object, an SdrObject needs to be provided, as in the normal constructor.
993  mpProperties = rObj.GetProperties().Clone(*this);
994 
995  aOutRect=rObj.aOutRect;
996  mnLayerID = rObj.mnLayerID;
997  aAnchor =rObj.aAnchor;
998  bVirtObj=rObj.bVirtObj;
999  bSizProt=rObj.bSizProt;
1000  bMovProt=rObj.bMovProt;
1001  bNoPrint=rObj.bNoPrint;
1002  mbVisible=rObj.mbVisible;
1003  bMarkProt=rObj.bMarkProt;
1006  bSnapRectDirty=true;
1007  pPlusData.reset();
1008  if (rObj.pPlusData!=nullptr) {
1009  pPlusData.reset(rObj.pPlusData->Clone(this));
1010  }
1011  if (pPlusData!=nullptr && pPlusData->pBroadcast!=nullptr) {
1012  pPlusData->pBroadcast.reset(); // broadcaster isn't copied
1013  }
1014 
1015  pGrabBagItem.reset();
1016  if (rObj.pGrabBagItem!=nullptr)
1017  pGrabBagItem.reset(rObj.pGrabBagItem->Clone());
1018  return *this;
1019 }
1020 
1022 {
1023  OUStringBuffer sName(SvxResId(STR_ObjNameSingulNONE));
1024 
1025  OUString aName(GetName());
1026  if (!aName.isEmpty())
1027  {
1028  sName.append(' ');
1029  sName.append('\'');
1030  sName.append(aName);
1031  sName.append('\'');
1032  }
1033  return sName.makeStringAndClear();
1034 }
1035 
1037 {
1038  return SvxResId(STR_ObjNamePluralNONE);
1039 }
1040 
1041 OUString SdrObject::ImpGetDescriptionStr(const char* pStrCacheID) const
1042 {
1043  OUString aStr = SvxResId(pStrCacheID);
1044  sal_Int32 nPos = aStr.indexOf("%1");
1045  if (nPos >= 0)
1046  {
1047  // Replace '%1' with the object name.
1048  OUString aObjName(TakeObjNameSingul());
1049  aStr = aStr.replaceAt(nPos, 2, aObjName);
1050  }
1051 
1052  nPos = aStr.indexOf("%2");
1053  if (nPos >= 0)
1054  // Replace '%2' with the passed value.
1055  aStr = aStr.replaceAt(nPos, 2, "0");
1056  return aStr;
1057 }
1058 
1060 {
1061  if (!pPlusData)
1062  pPlusData.reset( new SdrObjPlusData );
1063 }
1064 
1066 {
1068 }
1069 
1071 {
1072  basegfx::B2DPolyPolygon aRetval;
1075 
1076  return aRetval;
1077 }
1078 
1080 {
1081  basegfx::B2DPolyPolygon aRetval;
1082 
1083  // create cloned object without text, but with drawing::LineStyle_SOLID,
1084  // COL_BLACK as line color and drawing::FillStyle_NONE
1086 
1087  if(pClone)
1088  {
1089  const SdrTextObj* pTextObj = dynamic_cast< const SdrTextObj* >(this);
1090 
1091  if(pTextObj)
1092  {
1093  // no text and no text animation
1095  pClone->SetOutlinerParaObject(nullptr);
1096  }
1097 
1098  const SdrEdgeObj* pEdgeObj = dynamic_cast< const SdrEdgeObj* >(this);
1099 
1100  if(pEdgeObj)
1101  {
1102  // create connections if connector, will be cleaned up when
1103  // deleting the connector again
1104  SdrObject* pLeft = pEdgeObj->GetConnectedNode(true);
1105  SdrObject* pRight = pEdgeObj->GetConnectedNode(false);
1106 
1107  if(pLeft)
1108  {
1109  pClone->ConnectToNode(true, pLeft);
1110  }
1111 
1112  if(pRight)
1113  {
1114  pClone->ConnectToNode(false, pRight);
1115  }
1116  }
1117 
1118  SfxItemSet aNewSet(GetObjectItemPool());
1119 
1120  // #i101980# ignore LineWidth; that's what the old implementation
1121  // did. With line width, the result may be huge due to fat/thick
1122  // line decompositions
1123  aNewSet.Put(XLineWidthItem(0));
1124 
1125  // solid black lines and no fill
1126  aNewSet.Put(XLineStyleItem(drawing::LineStyle_SOLID));
1127  aNewSet.Put(XLineColorItem(OUString(), COL_BLACK));
1128  aNewSet.Put(XFillStyleItem(drawing::FillStyle_NONE));
1129  pClone->SetMergedItemSet(aNewSet);
1130 
1131  // get sequence from clone
1132  const sdr::contact::ViewContact& rVC(pClone->GetViewContact());
1133  const drawinglayer::primitive2d::Primitive2DContainer& xSequence(rVC.getViewIndependentPrimitive2DContainer());
1134 
1135  if(!xSequence.empty())
1136  {
1137  // use neutral ViewInformation
1138  const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
1139 
1140  // create extractor, process and get result (with hairlines as opened polygons)
1141  drawinglayer::processor2d::ContourExtractor2D aExtractor(aViewInformation2D, false);
1142  aExtractor.process(xSequence);
1143  const basegfx::B2DPolyPolygonVector& rResult(aExtractor.getExtractedContour());
1144  const sal_uInt32 nSize(rResult.size());
1145 
1146  // when count is one, it is implied that the object has only its normal
1147  // contour anyways and TakeContour() is to return an empty PolyPolygon
1148  // (see old implementation for historical reasons)
1149  if(nSize > 1)
1150  {
1151  // the topology for contour is correctly a vector of PolyPolygons; for
1152  // historical reasons cut it back to a single tools::PolyPolygon here
1153  for(sal_uInt32 a(0); a < nSize; a++)
1154  {
1155  aRetval.append(rResult[a]);
1156  }
1157  }
1158  }
1159 
1160  // Always use SdrObject::Free to delete SdrObjects (!)
1161  SdrObject::Free(pClone);
1162  }
1163 
1164  return aRetval;
1165 }
1166 
1167 sal_uInt32 SdrObject::GetHdlCount() const
1168 {
1169  return 8;
1170 }
1171 
1173 {
1174  const tools::Rectangle& rR=GetSnapRect();
1175  for (sal_uInt32 nHdlNum=0; nHdlNum<8; ++nHdlNum)
1176  {
1177  std::unique_ptr<SdrHdl> pH;
1178  switch (nHdlNum) {
1179  case 0: pH.reset(new SdrHdl(rR.TopLeft(), SdrHdlKind::UpperLeft)); break;
1180  case 1: pH.reset(new SdrHdl(rR.TopCenter(), SdrHdlKind::Upper)); break;
1181  case 2: pH.reset(new SdrHdl(rR.TopRight(), SdrHdlKind::UpperRight)); break;
1182  case 3: pH.reset(new SdrHdl(rR.LeftCenter(), SdrHdlKind::Left )); break;
1183  case 4: pH.reset(new SdrHdl(rR.RightCenter(), SdrHdlKind::Right)); break;
1184  case 5: pH.reset(new SdrHdl(rR.BottomLeft(), SdrHdlKind::LowerLeft)); break;
1185  case 6: pH.reset(new SdrHdl(rR.BottomCenter(),SdrHdlKind::Lower)); break;
1186  case 7: pH.reset(new SdrHdl(rR.BottomRight(), SdrHdlKind::LowerRight)); break;
1187  }
1188  rHdlList.AddHdl(std::move(pH));
1189  }
1190 }
1191 
1193 {
1194 }
1195 
1196 void SdrObject::addCropHandles(SdrHdlList& /*rTarget*/) const
1197 {
1198  // Default implementation, does nothing. Overloaded in
1199  // SdrGrafObj and SwVirtFlyDrawObj
1200 }
1201 
1203 {
1204  tools::Rectangle aTmpRect(GetSnapRect());
1205  tools::Rectangle aRect(aTmpRect);
1206  const SdrHdl* pHdl=rDrag.GetHdl();
1207  SdrHdlKind eHdl=pHdl==nullptr ? SdrHdlKind::Move : pHdl->GetKind();
1208  bool bEcke=(eHdl==SdrHdlKind::UpperLeft || eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::LowerLeft || eHdl==SdrHdlKind::LowerRight);
1209  bool bOrtho=rDrag.GetView()!=nullptr && rDrag.GetView()->IsOrtho();
1210  bool bBigOrtho=bEcke && bOrtho && rDrag.GetView()->IsBigOrtho();
1211  Point aPos(rDrag.GetNow());
1212  bool bLft=(eHdl==SdrHdlKind::UpperLeft || eHdl==SdrHdlKind::Left || eHdl==SdrHdlKind::LowerLeft);
1213  bool bRgt=(eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::Right || eHdl==SdrHdlKind::LowerRight);
1214  bool bTop=(eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::Upper || eHdl==SdrHdlKind::UpperLeft);
1215  bool bBtm=(eHdl==SdrHdlKind::LowerRight || eHdl==SdrHdlKind::Lower || eHdl==SdrHdlKind::LowerLeft);
1216  if (bLft) aTmpRect.SetLeft(aPos.X() );
1217  if (bRgt) aTmpRect.SetRight(aPos.X() );
1218  if (bTop) aTmpRect.SetTop(aPos.Y() );
1219  if (bBtm) aTmpRect.SetBottom(aPos.Y() );
1220  if (bOrtho) { // Ortho
1221  tools::Long nWdt0=aRect.Right() -aRect.Left();
1222  tools::Long nHgt0=aRect.Bottom()-aRect.Top();
1223  tools::Long nXMul=aTmpRect.Right() -aTmpRect.Left();
1224  tools::Long nYMul=aTmpRect.Bottom()-aTmpRect.Top();
1225  tools::Long nXDiv=nWdt0;
1226  tools::Long nYDiv=nHgt0;
1227  bool bXNeg=(nXMul<0)!=(nXDiv<0);
1228  bool bYNeg=(nYMul<0)!=(nYDiv<0);
1229  nXMul=std::abs(nXMul);
1230  nYMul=std::abs(nYMul);
1231  nXDiv=std::abs(nXDiv);
1232  nYDiv=std::abs(nYDiv);
1233  Fraction aXFact(nXMul,nXDiv); // fractions for canceling
1234  Fraction aYFact(nYMul,nYDiv); // and for comparing
1235  nXMul=aXFact.GetNumerator();
1236  nYMul=aYFact.GetNumerator();
1237  nXDiv=aXFact.GetDenominator();
1238  nYDiv=aYFact.GetDenominator();
1239  if (bEcke) { // corner point handles
1240  bool bUseX=(aXFact<aYFact) != bBigOrtho;
1241  if (bUseX) {
1242  tools::Long nNeed=tools::Long(BigInt(nHgt0)*BigInt(nXMul)/BigInt(nXDiv));
1243  if (bYNeg) nNeed=-nNeed;
1244  if (bTop) aTmpRect.SetTop(aTmpRect.Bottom()-nNeed );
1245  if (bBtm) aTmpRect.SetBottom(aTmpRect.Top()+nNeed );
1246  } else {
1247  tools::Long nNeed=tools::Long(BigInt(nWdt0)*BigInt(nYMul)/BigInt(nYDiv));
1248  if (bXNeg) nNeed=-nNeed;
1249  if (bLft) aTmpRect.SetLeft(aTmpRect.Right()-nNeed );
1250  if (bRgt) aTmpRect.SetRight(aTmpRect.Left()+nNeed );
1251  }
1252  } else { // apex handles
1253  if ((bLft || bRgt) && nXDiv!=0) {
1254  tools::Long nHgt0b=aRect.Bottom()-aRect.Top();
1255  tools::Long nNeed=tools::Long(BigInt(nHgt0b)*BigInt(nXMul)/BigInt(nXDiv));
1256  aTmpRect.AdjustTop( -((nNeed-nHgt0b)/2) );
1257  aTmpRect.SetBottom(aTmpRect.Top()+nNeed );
1258  }
1259  if ((bTop || bBtm) && nYDiv!=0) {
1260  tools::Long nWdt0b=aRect.Right()-aRect.Left();
1261  tools::Long nNeed=tools::Long(BigInt(nWdt0b)*BigInt(nYMul)/BigInt(nYDiv));
1262  aTmpRect.AdjustLeft( -((nNeed-nWdt0b)/2) );
1263  aTmpRect.SetRight(aTmpRect.Left()+nNeed );
1264  }
1265  }
1266  }
1267  aTmpRect.Justify();
1268  return aTmpRect;
1269 }
1270 
1271 
1273 {
1274  return false;
1275 }
1276 
1278 {
1279  return true;
1280 }
1281 
1283 {
1284  // default uses simple clone
1286 }
1287 
1289 {
1290  const SdrHdl* pHdl = rDrag.GetHdl();
1291 
1292  SdrHdlKind eHdl = (pHdl == nullptr) ? SdrHdlKind::Move : pHdl->GetKind();
1293 
1294  return eHdl==SdrHdlKind::UpperLeft || eHdl==SdrHdlKind::Upper || eHdl==SdrHdlKind::UpperRight ||
1295  eHdl==SdrHdlKind::Left || eHdl==SdrHdlKind::Right || eHdl==SdrHdlKind::LowerLeft ||
1297 }
1298 
1300 {
1301  tools::Rectangle aNewRect(ImpDragCalcRect(rDrag));
1302 
1303  if(aNewRect != GetSnapRect())
1304  {
1305  NbcSetSnapRect(aNewRect);
1306  }
1307 
1308  return true;
1309 }
1310 
1311 OUString SdrObject::getSpecialDragComment(const SdrDragStat& /*rDrag*/) const
1312 {
1313  return OUString();
1314 }
1315 
1317 {
1318  // default has nothing to add
1319  return basegfx::B2DPolyPolygon();
1320 }
1321 
1322 
1323 // Create
1325 {
1326  rStat.SetOrtho4Possible();
1327  tools::Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
1328  aRect1.Justify();
1329  rStat.SetActionRect(aRect1);
1330  aOutRect = aRect1;
1331  return true;
1332 }
1333 
1335 {
1336  rStat.TakeCreateRect(aOutRect);
1337  rStat.SetActionRect(aOutRect);
1338  aOutRect.Justify();
1339 
1340  return true;
1341 }
1342 
1344 {
1345  rStat.TakeCreateRect(aOutRect);
1346  aOutRect.Justify();
1347 
1348  return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
1349 }
1350 
1352 {
1353 }
1354 
1356 {
1357  return false;
1358 }
1359 
1361 {
1362  tools::Rectangle aRect1;
1363  rDrag.TakeCreateRect(aRect1);
1364  aRect1.Justify();
1365 
1366  basegfx::B2DPolyPolygon aRetval;
1368  return aRetval;
1369 }
1370 
1372 {
1373  return PointerStyle::Cross;
1374 }
1375 
1376 // transformations
1377 void SdrObject::NbcMove(const Size& rSiz)
1378 {
1379  aOutRect.Move(rSiz);
1380  SetRectsDirty();
1381 }
1382 
1383 void SdrObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
1384 {
1385  bool bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
1386  bool bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
1387  if (bXMirr || bYMirr) {
1388  Point aRef1(GetSnapRect().Center());
1389  if (bXMirr) {
1390  Point aRef2(aRef1);
1391  aRef2.AdjustY( 1 );
1392  NbcMirrorGluePoints(aRef1,aRef2);
1393  }
1394  if (bYMirr) {
1395  Point aRef2(aRef1);
1396  aRef2.AdjustX( 1 );
1397  NbcMirrorGluePoints(aRef1,aRef2);
1398  }
1399  }
1400  ResizeRect(aOutRect,rRef,xFact,yFact);
1401  SetRectsDirty();
1402 }
1403 
1404 void SdrObject::NbcRotate(const Point& rRef, Degree100 nAngle)
1405 {
1406  if (nAngle)
1407  {
1408  double a = nAngle.get() * F_PI18000;
1409  NbcRotate( rRef, nAngle, sin( a ), cos( a ) );
1410  }
1411 }
1412 
1413 void SdrObject::NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs)
1414 {
1415  SetGlueReallyAbsolute(true);
1416  aOutRect.Move(-rRef.X(),-rRef.Y());
1418  if (sn==1.0 && cs==0.0) { // 90deg
1419  aOutRect.SetLeft(-R.Bottom() );
1420  aOutRect.SetRight(-R.Top() );
1421  aOutRect.SetTop(R.Left() );
1422  aOutRect.SetBottom(R.Right() );
1423  } else if (sn==0.0 && cs==-1.0) { // 180deg
1424  aOutRect.SetLeft(-R.Right() );
1425  aOutRect.SetRight(-R.Left() );
1426  aOutRect.SetTop(-R.Bottom() );
1427  aOutRect.SetBottom(-R.Top() );
1428  } else if (sn==-1.0 && cs==0.0) { // 270deg
1429  aOutRect.SetLeft(R.Top() );
1430  aOutRect.SetRight(R.Bottom() );
1431  aOutRect.SetTop(-R.Right() );
1432  aOutRect.SetBottom(-R.Left() );
1433  }
1434  aOutRect.Move(rRef.X(),rRef.Y());
1435  aOutRect.Justify(); // just in case
1436  SetRectsDirty();
1437  NbcRotateGluePoints(rRef,nAngle,sn,cs);
1438  SetGlueReallyAbsolute(false);
1439 }
1440 
1441 void SdrObject::NbcMirror(const Point& rRef1, const Point& rRef2)
1442 {
1443  SetGlueReallyAbsolute(true);
1444  aOutRect.Move(-rRef1.X(),-rRef1.Y());
1446  tools::Long dx=rRef2.X()-rRef1.X();
1447  tools::Long dy=rRef2.Y()-rRef1.Y();
1448  if (dx==0) { // vertical axis
1449  aOutRect.SetLeft(-R.Right() );
1450  aOutRect.SetRight(-R.Left() );
1451  } else if (dy==0) { // horizontal axis
1452  aOutRect.SetTop(-R.Bottom() );
1453  aOutRect.SetBottom(-R.Top() );
1454  } else if (dx==dy) { // 45deg axis
1455  aOutRect.SetLeft(R.Top() );
1456  aOutRect.SetRight(R.Bottom() );
1457  aOutRect.SetTop(R.Left() );
1458  aOutRect.SetBottom(R.Right() );
1459  } else if (dx==-dy) { // 45deg axis
1460  aOutRect.SetLeft(-R.Bottom() );
1461  aOutRect.SetRight(-R.Top() );
1462  aOutRect.SetTop(-R.Right() );
1463  aOutRect.SetBottom(-R.Left() );
1464  }
1465  aOutRect.Move(rRef1.X(),rRef1.Y());
1466  aOutRect.Justify(); // just in case
1467  SetRectsDirty();
1468  NbcMirrorGluePoints(rRef1,rRef2);
1469  SetGlueReallyAbsolute(false);
1470 }
1471 
1472 void SdrObject::NbcShear(const Point& rRef, Degree100 /*nAngle*/, double tn, bool bVShear)
1473 {
1474  SetGlueReallyAbsolute(true);
1475  NbcShearGluePoints(rRef,tn,bVShear);
1476  SetGlueReallyAbsolute(false);
1477 }
1478 
1479 void SdrObject::Move(const Size& rSiz)
1480 {
1481  if (rSiz.Width()!=0 || rSiz.Height()!=0) {
1482  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1483  NbcMove(rSiz);
1484  SetChanged();
1487  }
1488 }
1489 
1490 void SdrObject::NbcCrop(const basegfx::B2DPoint& /*aRef*/, double /*fxFact*/, double /*fyFact*/)
1491 {
1492  // Default: does nothing. Real behaviour in SwVirtFlyDrawObj and SdrDragCrop::EndSdrDrag.
1493  // Where SwVirtFlyDrawObj is the only real user of it to do something local
1494 }
1495 
1496 void SdrObject::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative)
1497 {
1498  if (xFact.GetNumerator() == xFact.GetDenominator() && yFact.GetNumerator() == yFact.GetDenominator())
1499  return;
1500 
1501  if (bUnsetRelative)
1502  {
1503  mpImpl->mnRelativeWidth.reset();
1504  mpImpl->meRelativeWidthRelation = text::RelOrientation::PAGE_FRAME;
1505  mpImpl->meRelativeHeightRelation = text::RelOrientation::PAGE_FRAME;
1506  mpImpl->mnRelativeHeight.reset();
1507  }
1508  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1509  NbcResize(rRef,xFact,yFact);
1510  SetChanged();
1513 }
1514 
1515 void SdrObject::Crop(const basegfx::B2DPoint& rRef, double fxFact, double fyFact)
1516 {
1517  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1518  NbcCrop(rRef, fxFact, fyFact);
1519  SetChanged();
1522 }
1523 
1524 void SdrObject::Rotate(const Point& rRef, Degree100 nAngle, double sn, double cs)
1525 {
1526  if (nAngle) {
1527  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1528  NbcRotate(rRef,nAngle,sn,cs);
1529  SetChanged();
1532  }
1533 }
1534 
1535 void SdrObject::Mirror(const Point& rRef1, const Point& rRef2)
1536 {
1537  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1538  NbcMirror(rRef1,rRef2);
1539  SetChanged();
1542 }
1543 
1544 void SdrObject::Shear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear)
1545 {
1546  if (nAngle) {
1547  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1548  NbcShear(rRef,nAngle,tn,bVShear);
1549  SetChanged();
1552  }
1553 }
1554 
1555 void SdrObject::NbcSetRelativePos(const Point& rPnt)
1556 {
1557  Point aRelPos0(GetSnapRect().TopLeft()-aAnchor);
1558  Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
1559  NbcMove(aSiz); // This also calls SetRectsDirty()
1560 }
1561 
1562 void SdrObject::SetRelativePos(const Point& rPnt)
1563 {
1564  if (rPnt!=GetRelativePos()) {
1565  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1566  NbcSetRelativePos(rPnt);
1567  SetChanged();
1570  }
1571 }
1572 
1574 {
1575  return GetSnapRect().TopLeft()-aAnchor;
1576 }
1577 
1578 void SdrObject::ImpSetAnchorPos(const Point& rPnt)
1579 {
1580  aAnchor = rPnt;
1581 }
1582 
1583 void SdrObject::NbcSetAnchorPos(const Point& rPnt)
1584 {
1585  Size aSiz(rPnt.X()-aAnchor.X(),rPnt.Y()-aAnchor.Y());
1586  aAnchor=rPnt;
1587  NbcMove(aSiz); // This also calls SetRectsDirty()
1588 }
1589 
1590 void SdrObject::SetAnchorPos(const Point& rPnt)
1591 {
1592  if (rPnt!=aAnchor) {
1593  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1594  NbcSetAnchorPos(rPnt);
1595  SetChanged();
1598  }
1599 }
1600 
1602 {
1603  return aAnchor;
1604 }
1605 
1607 {
1608 }
1609 
1611 {
1612  return aOutRect;
1613 }
1614 
1616 {
1617  aOutRect=rRect;
1618 }
1619 
1621 {
1622  return GetSnapRect();
1623 }
1624 
1626 {
1627  NbcSetSnapRect(rRect);
1628 }
1629 
1630 void SdrObject::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool /* bShrinkOnly = false */ )
1631 {
1632  SetLogicRect( rMaxRect );
1633 }
1634 
1636 {
1637  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1638  NbcSetSnapRect(rRect);
1639  SetChanged();
1642 }
1643 
1645 {
1646  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1647  NbcSetLogicRect(rRect);
1648  SetChanged();
1651 }
1652 
1654 {
1655  return 0_deg100;
1656 }
1657 
1658 Degree100 SdrObject::GetShearAngle(bool /*bVertical*/) const
1659 {
1660  return 0_deg100;
1661 }
1662 
1664 {
1665  return GetPointCount();
1666 }
1667 
1668 Point SdrObject::GetSnapPoint(sal_uInt32 i) const
1669 {
1670  return GetPoint(i);
1671 }
1672 
1674 {
1675  return false;
1676 }
1677 
1678 sal_uInt32 SdrObject::GetPointCount() const
1679 {
1680  return 0;
1681 }
1682 
1683 Point SdrObject::GetPoint(sal_uInt32 /*i*/) const
1684 {
1685  return Point();
1686 }
1687 
1688 void SdrObject::SetPoint(const Point& rPnt, sal_uInt32 i)
1689 {
1690  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1691  NbcSetPoint(rPnt, i);
1692  SetChanged();
1695 }
1696 
1697 void SdrObject::NbcSetPoint(const Point& /*rPnt*/, sal_uInt32 /*i*/)
1698 {
1699 }
1700 
1702 {
1703  return false;
1704 }
1705 
1706 bool SdrObject::Equals(const SdrObject& rOtherObj) const
1707 {
1708  return (aAnchor.X() == rOtherObj.aAnchor.X() && aAnchor.Y() == rOtherObj.aAnchor.Y() &&
1709  nOrdNum == rOtherObj.nOrdNum && mnNavigationPosition == rOtherObj.mnNavigationPosition &&
1711  mbLineIsOutsideGeometry == rOtherObj.mbLineIsOutsideGeometry && bMarkProt == rOtherObj.bMarkProt &&
1712  bIs3DObj == rOtherObj.bIs3DObj && bIsEdge == rOtherObj.bIsEdge && bClosedObj == rOtherObj.bClosedObj &&
1713  bNotVisibleAsMaster == rOtherObj.bNotVisibleAsMaster && bEmptyPresObj == rOtherObj.bEmptyPresObj &&
1714  mbVisible == rOtherObj.mbVisible && bNoPrint == rOtherObj.bNoPrint && bSizProt == rOtherObj.bSizProt &&
1715  bMovProt == rOtherObj.bMovProt && bVirtObj == rOtherObj.bVirtObj &&
1716  mnLayerID == rOtherObj.mnLayerID && GetMergedItemSet().Equals(rOtherObj.GetMergedItemSet(), false) );
1717 }
1718 
1720 {
1721  xmlTextWriterStartElement(pWriter, BAD_CAST("SdrObject"));
1722  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
1723  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s", BAD_CAST(typeid(*this).name()));
1724  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("name"), "%s", BAD_CAST(GetName().toUtf8().getStr()));
1725  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("title"), "%s", BAD_CAST(GetTitle().toUtf8().getStr()));
1726  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("description"), "%s", BAD_CAST(GetDescription().toUtf8().getStr()));
1727  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("nOrdNum"), "%" SAL_PRIuUINT32, GetOrdNumDirect());
1728  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("aOutRect"), BAD_CAST(aOutRect.toString().getStr()));
1729 
1730  if (pGrabBagItem)
1731  {
1732  pGrabBagItem->dumpAsXml(pWriter);
1733  }
1734 
1735  if (mpProperties)
1736  {
1737  mpProperties->dumpAsXml(pWriter);
1738  }
1739 
1740  if (const OutlinerParaObject* pOutliner = GetOutlinerParaObject())
1741  pOutliner->dumpAsXml(pWriter);
1742 
1743  xmlTextWriterEndElement(pWriter);
1744 }
1745 
1746 void SdrObject::SetOutlinerParaObject(std::unique_ptr<OutlinerParaObject> pTextObject)
1747 {
1748  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1749  NbcSetOutlinerParaObject(std::move(pTextObject));
1750  SetChanged();
1752  if (GetCurrentBoundRect()!=aBoundRect0) {
1754  }
1755 }
1756 
1757 void SdrObject::NbcSetOutlinerParaObject(std::unique_ptr<OutlinerParaObject> /*pTextObject*/)
1758 {
1759 }
1760 
1762 {
1763  return nullptr;
1764 }
1765 
1767 {
1768 }
1769 
1771 {
1773 }
1774 
1776 {
1777  return false;
1778 }
1779 
1781 {
1782  if(rRec.pPageView)
1783  {
1784  return SdrObjectPrimitiveHit(*this, rRec.aPos, rRec.nTol, *rRec.pPageView, rRec.pVisiLayer, false);
1785  }
1786 
1787  return nullptr;
1788 }
1789 
1791 {
1792  return PointerStyle::RefHand;
1793 }
1794 
1796 {
1797  const RasterOp eRop(rOut.GetRasterOp());
1798  const basegfx::B2DPolyPolygon aPolyPolygon(TakeXorPoly());
1799 
1800  rOut.SetLineColor(COL_BLACK);
1801  rOut.SetFillColor();
1802  rOut.SetRasterOp(RasterOp::Invert);
1803 
1804  for(auto const& rPolygon : aPolyPolygon)
1805  {
1806  rOut.DrawPolyLine(rPolygon);
1807  }
1808 
1809  rOut.SetRasterOp(eRop);
1810 }
1811 
1813 {
1814  return false;
1815 }
1816 
1818 {
1819  return CheckMacroHit(rRec) != nullptr;
1820 }
1821 
1822 
1824 {
1825  return new SdrObjGeoData;
1826 }
1827 
1829 {
1831  rGeo.aAnchor =aAnchor ;
1832  rGeo.bMovProt =bMovProt ;
1833  rGeo.bSizProt =bSizProt ;
1834  rGeo.bNoPrint =bNoPrint ;
1835  rGeo.mbVisible =mbVisible ;
1836  rGeo.bClosedObj =bClosedObj ;
1837  rGeo.mnLayerID = mnLayerID;
1838 
1839  // user-defined glue points
1840  if (pPlusData!=nullptr && pPlusData->pGluePoints!=nullptr) {
1841  if (rGeo.pGPL!=nullptr) {
1842  *rGeo.pGPL=*pPlusData->pGluePoints;
1843  } else {
1844  rGeo.pGPL.reset( new SdrGluePointList(*pPlusData->pGluePoints) );
1845  }
1846  } else {
1847  rGeo.pGPL.reset();
1848  }
1849 }
1850 
1852 {
1853  SetRectsDirty();
1854  aOutRect =rGeo.aBoundRect ;
1855  aAnchor =rGeo.aAnchor ;
1856  bMovProt =rGeo.bMovProt ;
1857  bSizProt =rGeo.bSizProt ;
1858  bNoPrint =rGeo.bNoPrint ;
1859  mbVisible =rGeo.mbVisible ;
1860  bClosedObj =rGeo.bClosedObj ;
1861  mnLayerID = rGeo.mnLayerID;
1862 
1863  // user-defined glue points
1864  if (rGeo.pGPL!=nullptr) {
1865  ImpForcePlusData();
1866  if (pPlusData->pGluePoints!=nullptr) {
1867  *pPlusData->pGluePoints=*rGeo.pGPL;
1868  } else {
1869  pPlusData->pGluePoints.reset(new SdrGluePointList(*rGeo.pGPL));
1870  }
1871  } else {
1872  if (pPlusData!=nullptr && pPlusData->pGluePoints!=nullptr) {
1873  pPlusData->pGluePoints.reset();
1874  }
1875  }
1876 }
1877 
1879 {
1880  SdrObjGeoData* pGeo=NewGeoData();
1881  SaveGeoData(*pGeo);
1882  return pGeo;
1883 }
1884 
1886 {
1887  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1888  RestGeoData(rGeo);
1889  SetChanged();
1892 }
1893 
1894 
1895 // ItemSet access
1896 
1898 {
1899  return GetProperties().GetObjectItemSet();
1900 }
1901 
1903 {
1904  return GetProperties().GetMergedItemSet();
1905 }
1906 
1908 {
1909  GetProperties().SetObjectItem(rItem);
1910 }
1911 
1913 {
1914  GetProperties().SetMergedItem(rItem);
1915 }
1916 
1917 void SdrObject::ClearMergedItem(const sal_uInt16 nWhich)
1918 {
1919  GetProperties().ClearMergedItem(nWhich);
1920 }
1921 
1923 {
1925 }
1926 
1927 void SdrObject::SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems)
1928 {
1929  GetProperties().SetMergedItemSet(rSet, bClearAllItems);
1930 }
1931 
1932 const SfxPoolItem& SdrObject::GetObjectItem(const sal_uInt16 nWhich) const
1933 {
1934  return GetObjectItemSet().Get(nWhich);
1935 }
1936 
1937 const SfxPoolItem& SdrObject::GetMergedItem(const sal_uInt16 nWhich) const
1938 {
1939  return GetMergedItemSet().Get(nWhich);
1940 }
1941 
1942 void SdrObject::SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, bool bClearAllItems)
1943 {
1944  GetProperties().SetMergedItemSetAndBroadcast(rSet, bClearAllItems);
1945 }
1946 
1948 {
1949  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1950  NbcApplyNotPersistAttr(rAttr);
1951  SetChanged();
1954 }
1955 
1957 {
1958  const tools::Rectangle& rSnap=GetSnapRect();
1959  const tools::Rectangle& rLogic=GetLogicRect();
1960  Point aRef1(rSnap.Center());
1961  const SfxPoolItem *pPoolItem=nullptr;
1962  if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1X,true,&pPoolItem)==SfxItemState::SET) {
1963  aRef1.setX(static_cast<const SdrTransformRef1XItem*>(pPoolItem)->GetValue() );
1964  }
1965  if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1Y,true,&pPoolItem)==SfxItemState::SET) {
1966  aRef1.setY(static_cast<const SdrTransformRef1YItem*>(pPoolItem)->GetValue() );
1967  }
1968 
1969  tools::Rectangle aNewSnap(rSnap);
1970  if (rAttr.GetItemState(SDRATTR_MOVEX,true,&pPoolItem)==SfxItemState::SET) {
1971  tools::Long n=static_cast<const SdrMoveXItem*>(pPoolItem)->GetValue();
1972  aNewSnap.Move(n,0);
1973  }
1974  if (rAttr.GetItemState(SDRATTR_MOVEY,true,&pPoolItem)==SfxItemState::SET) {
1975  tools::Long n=static_cast<const SdrMoveYItem*>(pPoolItem)->GetValue();
1976  aNewSnap.Move(0,n);
1977  }
1978  if (rAttr.GetItemState(SDRATTR_ONEPOSITIONX,true,&pPoolItem)==SfxItemState::SET) {
1979  tools::Long n=static_cast<const SdrOnePositionXItem*>(pPoolItem)->GetValue();
1980  aNewSnap.Move(n-aNewSnap.Left(),0);
1981  }
1982  if (rAttr.GetItemState(SDRATTR_ONEPOSITIONY,true,&pPoolItem)==SfxItemState::SET) {
1983  tools::Long n=static_cast<const SdrOnePositionYItem*>(pPoolItem)->GetValue();
1984  aNewSnap.Move(0,n-aNewSnap.Top());
1985  }
1986  if (rAttr.GetItemState(SDRATTR_ONESIZEWIDTH,true,&pPoolItem)==SfxItemState::SET) {
1987  tools::Long n=static_cast<const SdrOneSizeWidthItem*>(pPoolItem)->GetValue();
1988  aNewSnap.SetRight(aNewSnap.Left()+n );
1989  }
1990  if (rAttr.GetItemState(SDRATTR_ONESIZEHEIGHT,true,&pPoolItem)==SfxItemState::SET) {
1991  tools::Long n=static_cast<const SdrOneSizeHeightItem*>(pPoolItem)->GetValue();
1992  aNewSnap.SetBottom(aNewSnap.Top()+n );
1993  }
1994  if (aNewSnap!=rSnap) {
1995  if (aNewSnap.GetSize()==rSnap.GetSize()) {
1996  NbcMove(Size(aNewSnap.Left()-rSnap.Left(),aNewSnap.Top()-rSnap.Top()));
1997  } else {
1998  NbcSetSnapRect(aNewSnap);
1999  }
2000  }
2001 
2002  if (rAttr.GetItemState(SDRATTR_SHEARANGLE,true,&pPoolItem)==SfxItemState::SET) {
2003  Degree100 n=static_cast<const SdrShearAngleItem*>(pPoolItem)->GetValue();
2004  n-=GetShearAngle();
2005  if (n) {
2006  double nTan = tan(n.get() * F_PI18000);
2007  NbcShear(aRef1,n,nTan,false);
2008  }
2009  }
2010  if (rAttr.GetItemState(SDRATTR_ROTATEANGLE,true,&pPoolItem)==SfxItemState::SET) {
2011  Degree100 n=static_cast<const SdrAngleItem*>(pPoolItem)->GetValue();
2012  n-=GetRotateAngle();
2013  if (n) {
2014  NbcRotate(aRef1,n);
2015  }
2016  }
2017  if (rAttr.GetItemState(SDRATTR_ROTATEONE,true,&pPoolItem)==SfxItemState::SET) {
2018  Degree100 n=static_cast<const SdrRotateOneItem*>(pPoolItem)->GetValue();
2019  NbcRotate(aRef1,n);
2020  }
2021  if (rAttr.GetItemState(SDRATTR_HORZSHEARONE,true,&pPoolItem)==SfxItemState::SET) {
2022  Degree100 n=static_cast<const SdrHorzShearOneItem*>(pPoolItem)->GetValue();
2023  double nTan = tan(n.get() * F_PI18000);
2024  NbcShear(aRef1,n,nTan,false);
2025  }
2026  if (rAttr.GetItemState(SDRATTR_VERTSHEARONE,true,&pPoolItem)==SfxItemState::SET) {
2027  Degree100 n=static_cast<const SdrVertShearOneItem*>(pPoolItem)->GetValue();
2028  double nTan = tan(n.get() * F_PI18000);
2029  NbcShear(aRef1,n,nTan,true);
2030  }
2031 
2032  if (rAttr.GetItemState(SDRATTR_OBJMOVEPROTECT,true,&pPoolItem)==SfxItemState::SET) {
2033  bool b=static_cast<const SdrYesNoItem*>(pPoolItem)->GetValue();
2034  SetMoveProtect(b);
2035  }
2036  if (rAttr.GetItemState(SDRATTR_OBJSIZEPROTECT,true,&pPoolItem)==SfxItemState::SET) {
2037  bool b=static_cast<const SdrYesNoItem*>(pPoolItem)->GetValue();
2038  SetResizeProtect(b);
2039  }
2040 
2041  /* move protect always sets size protect */
2042  if( IsMoveProtect() )
2043  SetResizeProtect( true );
2044 
2045  if (rAttr.GetItemState(SDRATTR_OBJPRINTABLE,true,&pPoolItem)==SfxItemState::SET) {
2046  bool b=static_cast<const SdrObjPrintableItem*>(pPoolItem)->GetValue();
2047  SetPrintable(b);
2048  }
2049 
2050  if (rAttr.GetItemState(SDRATTR_OBJVISIBLE,true,&pPoolItem)==SfxItemState::SET) {
2051  bool b=static_cast<const SdrObjVisibleItem*>(pPoolItem)->GetValue();
2052  SetVisible(b);
2053  }
2054 
2056  if (rAttr.GetItemState(SDRATTR_LAYERID,true,&pPoolItem)==SfxItemState::SET) {
2057  nLayer=static_cast<const SdrLayerIdItem*>(pPoolItem)->GetValue();
2058  }
2059  if (rAttr.GetItemState(SDRATTR_LAYERNAME,true,&pPoolItem)==SfxItemState::SET)
2060  {
2061  OUString aLayerName = static_cast<const SdrLayerNameItem*>(pPoolItem)->GetValue();
2062  const SdrLayerAdmin& rLayAd(nullptr != getSdrPageFromSdrObject()
2063  ? getSdrPageFromSdrObject()->GetLayerAdmin()
2064  : getSdrModelFromSdrObject().GetLayerAdmin());
2065  const SdrLayer* pLayer = rLayAd.GetLayer(aLayerName);
2066 
2067  if(nullptr != pLayer)
2068  {
2069  nLayer=pLayer->GetID();
2070  }
2071  }
2072  if (nLayer!=SDRLAYER_NOTFOUND) {
2073  NbcSetLayer(nLayer);
2074  }
2075 
2076  if (rAttr.GetItemState(SDRATTR_OBJECTNAME,true,&pPoolItem)==SfxItemState::SET) {
2077  OUString aName=static_cast<const SfxStringItem*>(pPoolItem)->GetValue();
2078  SetName(aName);
2079  }
2080  tools::Rectangle aNewLogic(rLogic);
2081  if (rAttr.GetItemState(SDRATTR_LOGICSIZEWIDTH,true,&pPoolItem)==SfxItemState::SET) {
2082  tools::Long n=static_cast<const SdrLogicSizeWidthItem*>(pPoolItem)->GetValue();
2083  aNewLogic.SetRight(aNewLogic.Left()+n );
2084  }
2085  if (rAttr.GetItemState(SDRATTR_LOGICSIZEHEIGHT,true,&pPoolItem)==SfxItemState::SET) {
2086  tools::Long n=static_cast<const SdrLogicSizeHeightItem*>(pPoolItem)->GetValue();
2087  aNewLogic.SetBottom(aNewLogic.Top()+n );
2088  }
2089  if (aNewLogic!=rLogic) {
2090  NbcSetLogicRect(aNewLogic);
2091  }
2092  Fraction aResizeX(1,1);
2093  Fraction aResizeY(1,1);
2094  if (rAttr.GetItemState(SDRATTR_RESIZEXONE,true,&pPoolItem)==SfxItemState::SET) {
2095  aResizeX*=static_cast<const SdrResizeXOneItem*>(pPoolItem)->GetValue();
2096  }
2097  if (rAttr.GetItemState(SDRATTR_RESIZEYONE,true,&pPoolItem)==SfxItemState::SET) {
2098  aResizeY*=static_cast<const SdrResizeYOneItem*>(pPoolItem)->GetValue();
2099  }
2100  if (aResizeX!=Fraction(1,1) || aResizeY!=Fraction(1,1)) {
2101  NbcResize(aRef1,aResizeX,aResizeY);
2102  }
2103 }
2104 
2106 {
2107  const tools::Rectangle& rSnap=GetSnapRect();
2108  const tools::Rectangle& rLogic=GetLogicRect();
2112  rAttr.Put(SdrObjVisibleItem(IsVisible()));
2115  rAttr.Put(SdrOneSizeWidthItem(rSnap.GetWidth()-1));
2116  rAttr.Put(SdrOneSizeHeightItem(rSnap.GetHeight()-1));
2117  rAttr.Put(SdrOnePositionXItem(rSnap.Left()));
2118  rAttr.Put(SdrOnePositionYItem(rSnap.Top()));
2119  if (rLogic.GetWidth()!=rSnap.GetWidth()) {
2120  rAttr.Put(SdrLogicSizeWidthItem(rLogic.GetWidth()-1));
2121  }
2122  if (rLogic.GetHeight()!=rSnap.GetHeight()) {
2123  rAttr.Put(SdrLogicSizeHeightItem(rLogic.GetHeight()-1));
2124  }
2125  OUString aName(GetName());
2126 
2127  if (!aName.isEmpty())
2128  {
2129  rAttr.Put(SfxStringItem(SDRATTR_OBJECTNAME, aName));
2130  }
2131 
2132  rAttr.Put(SdrLayerIdItem(GetLayer()));
2133  const SdrLayerAdmin& rLayAd(nullptr != getSdrPageFromSdrObject()
2134  ? getSdrPageFromSdrObject()->GetLayerAdmin()
2135  : getSdrModelFromSdrObject().GetLayerAdmin());
2136  const SdrLayer* pLayer = rLayAd.GetLayerPerID(GetLayer());
2137  if(nullptr != pLayer)
2138  {
2139  rAttr.Put(SdrLayerNameItem(pLayer->GetName()));
2140  }
2141  Point aRef1(rSnap.Center());
2142  Point aRef2(aRef1); aRef2.AdjustY( 1 );
2143  rAttr.Put(SdrTransformRef1XItem(aRef1.X()));
2144  rAttr.Put(SdrTransformRef1YItem(aRef1.Y()));
2145  rAttr.Put(SdrTransformRef2XItem(aRef2.X()));
2146  rAttr.Put(SdrTransformRef2YItem(aRef2.Y()));
2147 }
2148 
2150 {
2151  return GetProperties().GetStyleSheet();
2152 }
2153 
2154 void SdrObject::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
2155 {
2156  tools::Rectangle aBoundRect0;
2157 
2158  if(pUserCall)
2159  aBoundRect0 = GetLastBoundRect();
2160 
2161  NbcSetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
2162  SetChanged();
2165 }
2166 
2167 void SdrObject::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
2168 {
2169  GetProperties().SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
2170 }
2171 
2172 // Broadcasting while setting attributes is managed by the AttrObj.
2173 
2174 
2176 {
2177  // #i41936# Use SnapRect for default GluePoints
2178  const tools::Rectangle aR(GetSnapRect());
2179  Point aPt;
2180 
2181  switch(nPosNum)
2182  {
2183  case 0 : aPt = aR.TopCenter(); break;
2184  case 1 : aPt = aR.RightCenter(); break;
2185  case 2 : aPt = aR.BottomCenter(); break;
2186  case 3 : aPt = aR.LeftCenter(); break;
2187  }
2188 
2189  aPt -= aR.Center();
2190  SdrGluePoint aGP(aPt);
2191  aGP.SetPercent(false);
2192 
2193  return aGP;
2194 }
2195 
2197 {
2199  Point aPt;
2200  switch (nPosNum) {
2201  case 0 : aPt=aR.TopLeft(); break;
2202  case 1 : aPt=aR.TopRight(); break;
2203  case 2 : aPt=aR.BottomRight(); break;
2204  case 3 : aPt=aR.BottomLeft(); break;
2205  }
2206  aPt-=GetSnapRect().Center();
2207  SdrGluePoint aGP(aPt);
2208  aGP.SetPercent(false);
2209  return aGP;
2210 }
2211 
2213 {
2214  if (pPlusData!=nullptr) return pPlusData->pGluePoints.get();
2215  return nullptr;
2216 }
2217 
2218 
2220 {
2221  ImpForcePlusData();
2222  if (pPlusData->pGluePoints==nullptr) {
2223  pPlusData->pGluePoints.reset(new SdrGluePointList);
2224  }
2225  return pPlusData->pGluePoints.get();
2226 }
2227 
2229 {
2230  // First a const call to see whether there are any glue points.
2231  // Force const call!
2232  if (GetGluePointList()!=nullptr) {
2234  pGPL->SetReallyAbsolute(bOn,*this);
2235  }
2236 }
2237 
2238 void SdrObject::NbcRotateGluePoints(const Point& rRef, Degree100 nAngle, double sn, double cs)
2239 {
2240  // First a const call to see whether there are any glue points.
2241  // Force const call!
2242  if (GetGluePointList()!=nullptr) {
2244  pGPL->Rotate(rRef,nAngle,sn,cs,this);
2245  }
2246 }
2247 
2248 void SdrObject::NbcMirrorGluePoints(const Point& rRef1, const Point& rRef2)
2249 {
2250  // First a const call to see whether there are any glue points.
2251  // Force const call!
2252  if (GetGluePointList()!=nullptr) {
2254  pGPL->Mirror(rRef1,rRef2,this);
2255  }
2256 }
2257 
2258 void SdrObject::NbcShearGluePoints(const Point& rRef, double tn, bool bVShear)
2259 {
2260  // First a const call to see whether there are any glue points.
2261  // Force const call!
2262  if (GetGluePointList()!=nullptr) {
2264  pGPL->Shear(rRef,tn,bVShear,this);
2265  }
2266 }
2267 
2268 void SdrObject::ConnectToNode(bool /*bTail1*/, SdrObject* /*pObj*/)
2269 {
2270 }
2271 
2272 void SdrObject::DisconnectFromNode(bool /*bTail1*/)
2273 {
2274 }
2275 
2277 {
2278  return nullptr;
2279 }
2280 
2281 
2284  basegfx::B2DPolygonVector& rExtractedHairlines,
2285  basegfx::B2DPolyPolygonVector& rExtractedLineFills)
2286 {
2287  rExtractedHairlines.clear();
2288  rExtractedLineFills.clear();
2289 
2290  if(rxSequence.empty())
2291  return;
2292 
2293  // use neutral ViewInformation
2294  const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
2295 
2296  // create extractor, process and get result
2297  drawinglayer::processor2d::LineGeometryExtractor2D aExtractor(aViewInformation2D);
2298  aExtractor.process(rxSequence);
2299 
2300  // copy line results
2301  rExtractedHairlines = aExtractor.getExtractedHairlines();
2302 
2303  // copy fill rsults
2304  rExtractedLineFills = aExtractor.getExtractedLineFills();
2305 }
2306 
2307 
2309 {
2310  SdrObject* pRetval(nullptr);
2311 
2313  {
2314  basegfx::B2DPolyPolygon aMergedLineFillPolyPolygon;
2315  basegfx::B2DPolyPolygon aMergedHairlinePolyPolygon;
2316  const drawinglayer::primitive2d::Primitive2DContainer & xSequence(GetViewContact().getViewIndependentPrimitive2DContainer());
2317 
2318  if(!xSequence.empty())
2319  {
2320  basegfx::B2DPolygonVector aExtractedHairlines;
2321  basegfx::B2DPolyPolygonVector aExtractedLineFills;
2322 
2323  extractLineContourFromPrimitive2DSequence(xSequence, aExtractedHairlines, aExtractedLineFills);
2324 
2325  // for SdrObject creation, just copy all to a single Hairline-PolyPolygon
2326  for(const basegfx::B2DPolygon & rExtractedHairline : aExtractedHairlines)
2327  {
2328  aMergedHairlinePolyPolygon.append(rExtractedHairline);
2329  }
2330 
2331  // check for fill rsults
2332  if (!aExtractedLineFills.empty() && !utl::ConfigManager::IsFuzzing())
2333  {
2334  // merge to a single tools::PolyPolygon (OR)
2335  aMergedLineFillPolyPolygon = basegfx::utils::mergeToSinglePolyPolygon(aExtractedLineFills);
2336  }
2337  }
2338 
2339  if(aMergedLineFillPolyPolygon.count() || (bForceLineDash && aMergedHairlinePolyPolygon.count()))
2340  {
2341  SfxItemSet aSet(GetMergedItemSet());
2342  drawing::FillStyle eOldFillStyle = aSet.Get(XATTR_FILLSTYLE).GetValue();
2343  SdrPathObj* aLinePolygonPart = nullptr;
2344  SdrPathObj* aLineHairlinePart = nullptr;
2345  bool bBuildGroup(false);
2346 
2347  if(aMergedLineFillPolyPolygon.count())
2348  {
2349  // create SdrObject for filled line geometry
2350  aLinePolygonPart = new SdrPathObj(
2352  OBJ_PATHFILL,
2353  aMergedLineFillPolyPolygon);
2354 
2355  // correct item properties
2356  aSet.Put(XLineWidthItem(0));
2357  aSet.Put(XLineStyleItem(drawing::LineStyle_NONE));
2358  Color aColorLine = aSet.Get(XATTR_LINECOLOR).GetColorValue();
2359  sal_uInt16 nTransLine = aSet.Get(XATTR_LINETRANSPARENCE).GetValue();
2360  aSet.Put(XFillColorItem(OUString(), aColorLine));
2361  aSet.Put(XFillStyleItem(drawing::FillStyle_SOLID));
2362  aSet.Put(XFillTransparenceItem(nTransLine));
2363 
2364  aLinePolygonPart->SetMergedItemSet(aSet);
2365  }
2366 
2367  if(aMergedHairlinePolyPolygon.count())
2368  {
2369  // create SdrObject for hairline geometry
2370  // OBJ_PATHLINE is necessary here, not OBJ_PATHFILL. This is intended
2371  // to get a non-filled object. If the poly is closed, the PathObj takes care for
2372  // the correct closed state.
2373  aLineHairlinePart = new SdrPathObj(
2375  OBJ_PATHLINE,
2376  aMergedHairlinePolyPolygon);
2377 
2378  aSet.Put(XLineWidthItem(0));
2379  aSet.Put(XFillStyleItem(drawing::FillStyle_NONE));
2380  aSet.Put(XLineStyleItem(drawing::LineStyle_SOLID));
2381 
2382  // it is also necessary to switch off line start and ends here
2383  aSet.Put(XLineStartWidthItem(0));
2384  aSet.Put(XLineEndWidthItem(0));
2385 
2386  aLineHairlinePart->SetMergedItemSet(aSet);
2387 
2388  if(aLinePolygonPart)
2389  {
2390  bBuildGroup = true;
2391  }
2392  }
2393 
2394  // check if original geometry should be added (e.g. filled and closed)
2395  bool bAddOriginalGeometry(false);
2396  SdrPathObj* pPath = dynamic_cast<SdrPathObj*>(this);
2397 
2398  if(pPath && pPath->IsClosed())
2399  {
2400  if(eOldFillStyle != drawing::FillStyle_NONE)
2401  {
2402  bAddOriginalGeometry = true;
2403  }
2404  }
2405 
2406  // do we need a group?
2407  if(bBuildGroup || bAddOriginalGeometry)
2408  {
2410 
2411  if(bAddOriginalGeometry)
2412  {
2413  // Add a clone of the original geometry.
2414  aSet.ClearItem();
2415  aSet.Put(GetMergedItemSet());
2416  aSet.Put(XLineStyleItem(drawing::LineStyle_NONE));
2417  aSet.Put(XLineWidthItem(0));
2418 
2420  pClone->SetMergedItemSet(aSet);
2421 
2422  pGroup->GetSubList()->NbcInsertObject(pClone);
2423  }
2424 
2425  if(aLinePolygonPart)
2426  {
2427  pGroup->GetSubList()->NbcInsertObject(aLinePolygonPart);
2428  }
2429 
2430  if(aLineHairlinePart)
2431  {
2432  pGroup->GetSubList()->NbcInsertObject(aLineHairlinePart);
2433  }
2434 
2435  pRetval = pGroup;
2436  }
2437  else
2438  {
2439  if(aLinePolygonPart)
2440  {
2441  pRetval = aLinePolygonPart;
2442  }
2443  else if(aLineHairlinePart)
2444  {
2445  pRetval = aLineHairlinePart;
2446  }
2447  }
2448  }
2449  }
2450 
2451  if(nullptr == pRetval)
2452  {
2453  // due to current method usage, create and return a clone when nothing has changed
2455  pRetval = pClone;
2456  }
2457 
2458  return pRetval;
2459 }
2460 
2461 
2463 {
2464  bMarkProt = bProt;
2465 }
2466 
2467 
2469 {
2470  bEmptyPresObj = bEpt;
2471 }
2472 
2473 
2475 {
2476  bNotVisibleAsMaster=bFlg;
2477 }
2478 
2479 
2480 // convert this path object to contour object, even when it is a group
2481 SdrObject* SdrObject::ConvertToContourObj(SdrObject* pRet, bool bForceLineDash) const
2482 {
2483  if(dynamic_cast<const SdrObjGroup*>( pRet) != nullptr)
2484  {
2485  SdrObjList* pObjList2 = pRet->GetSubList();
2487 
2488  for(size_t a=0; a<pObjList2->GetObjCount(); ++a)
2489  {
2490  SdrObject* pIterObj = pObjList2->GetObj(a);
2491  pGroup->GetSubList()->NbcInsertObject(ConvertToContourObj(pIterObj, bForceLineDash));
2492  }
2493 
2494  pRet = pGroup;
2495  }
2496  else
2497  {
2498  if (SdrPathObj *pPathObj = dynamic_cast<SdrPathObj*>(pRet))
2499  {
2500  // bezier geometry got created, even for straight edges since the given
2501  // object is a result of DoConvertToPolyObj. For conversion to contour
2502  // this is not really needed and can be reduced again AFAP
2503  pPathObj->SetPathPoly(basegfx::utils::simplifyCurveSegments(pPathObj->GetPathPoly()));
2504  }
2505 
2506  pRet = pRet->ImpConvertToContourObj(bForceLineDash);
2507  }
2508 
2509  // #i73441# preserve LayerID
2510  if(pRet && pRet->GetLayer() != GetLayer())
2511  {
2512  pRet->SetLayer(GetLayer());
2513  }
2514 
2515  return pRet;
2516 }
2517 
2518 
2519 SdrObjectUniquePtr SdrObject::ConvertToPolyObj(bool bBezier, bool bLineToArea) const
2520 {
2521  SdrObjectUniquePtr pRet = DoConvertToPolyObj(bBezier, true);
2522 
2523  if(pRet && bLineToArea)
2524  {
2525  SdrObject* pNewRet = ConvertToContourObj(pRet.get());
2526  pRet.reset(pNewRet);
2527  }
2528 
2529  // #i73441# preserve LayerID
2530  if(pRet && pRet->GetLayer() != GetLayer())
2531  {
2532  pRet->SetLayer(GetLayer());
2533  }
2534 
2535  return pRet;
2536 }
2537 
2538 
2539 SdrObjectUniquePtr SdrObject::DoConvertToPolyObj(bool /*bBezier*/, bool /*bAddText*/) const
2540 {
2541  return nullptr;
2542 }
2543 
2544 
2546 {
2547  const bool bIsInserted(nullptr != getParentSdrObjListFromSdrObject());
2548  const tools::Rectangle aBoundRect0(GetLastBoundRect());
2549 
2550  if(bIsInserted)
2551  {
2553  }
2554  else
2555  {
2556  SendUserCall(SdrUserCallType::Removed, aBoundRect0);
2557  }
2558 
2559  if(nullptr != pPlusData && nullptr != pPlusData->pBroadcast)
2560  {
2561  SdrHint aHint(bIsInserted ? SdrHintKind::ObjectInserted : SdrHintKind::ObjectRemoved, *this);
2562  pPlusData->pBroadcast->Broadcast(aHint);
2563  }
2564 }
2565 
2567 {
2568  if(IsMoveProtect() != bProt)
2569  {
2570  // #i77187# secured and simplified
2571  bMovProt = bProt;
2572  SetChanged();
2574  }
2575 }
2576 
2578 {
2579  if(IsResizeProtect() != bProt)
2580  {
2581  // #i77187# secured and simplified
2582  bSizProt = bProt;
2583  SetChanged();
2585  }
2586 }
2587 
2589 {
2590  if( bPrn == bNoPrint )
2591  {
2592  bNoPrint=!bPrn;
2593  SetChanged();
2594  if (IsInserted())
2595  {
2596  SdrHint aHint(SdrHintKind::ObjectChange, *this);
2598  }
2599  }
2600 }
2601 
2602 void SdrObject::SetVisible(bool bVisible)
2603 {
2604  if( bVisible != mbVisible )
2605  {
2606  mbVisible = bVisible;
2607  SetChanged();
2608  if (IsInserted())
2609  {
2610  SdrHint aHint(SdrHintKind::ObjectChange, *this);
2612  }
2613  }
2614 }
2615 
2616 
2618 {
2619  if (pPlusData==nullptr || pPlusData->pUserDataList==nullptr) return 0;
2620  return pPlusData->pUserDataList->GetUserDataCount();
2621 }
2622 
2624 {
2625  if (pPlusData==nullptr || pPlusData->pUserDataList==nullptr) return nullptr;
2626  return &pPlusData->pUserDataList->GetUserData(nNum);
2627 }
2628 
2629 void SdrObject::AppendUserData(std::unique_ptr<SdrObjUserData> pData)
2630 {
2631  if (!pData)
2632  {
2633  OSL_FAIL("SdrObject::AppendUserData(): pData is NULL pointer.");
2634  return;
2635  }
2636 
2637  ImpForcePlusData();
2638  if (!pPlusData->pUserDataList)
2639  pPlusData->pUserDataList.reset( new SdrObjUserDataList );
2640 
2641  pPlusData->pUserDataList->AppendUserData(std::move(pData));
2642 }
2643 
2644 void SdrObject::DeleteUserData(sal_uInt16 nNum)
2645 {
2646  sal_uInt16 nCount=GetUserDataCount();
2647  if (nNum<nCount) {
2648  pPlusData->pUserDataList->DeleteUserData(nNum);
2649  if (nCount==1) {
2650  pPlusData->pUserDataList.reset();
2651  }
2652  } else {
2653  OSL_FAIL("SdrObject::DeleteUserData(): Invalid Index.");
2654  }
2655 }
2656 
2658 {
2659  pUserCall = pUser;
2660 }
2661 
2662 
2663 void SdrObject::SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle& rBoundRect) const
2664 {
2666 
2667  if ( pUserCall )
2668  {
2669  pUserCall->Changed( *this, eUserCall, rBoundRect );
2670  }
2671 
2672  if(nullptr != pGroup && pGroup->GetUserCall())
2673  {
2674  // broadcast to group
2676 
2677  switch( eUserCall )
2678  {
2680  eChildUserType = SdrUserCallType::ChildMoveOnly;
2681  break;
2682 
2684  eChildUserType = SdrUserCallType::ChildResize;
2685  break;
2686 
2688  eChildUserType = SdrUserCallType::ChildChangeAttr;
2689  break;
2690 
2692  eChildUserType = SdrUserCallType::ChildDelete;
2693  break;
2694 
2696  eChildUserType = SdrUserCallType::ChildInserted;
2697  break;
2698 
2700  eChildUserType = SdrUserCallType::ChildRemoved;
2701  break;
2702 
2703  default: break;
2704  }
2705 
2706  pGroup->GetUserCall()->Changed( *this, eChildUserType, rBoundRect );
2707  }
2708 
2709  // notify our UNO shape listeners
2710  switch ( eUserCall )
2711  {
2714  [[fallthrough]]; // RESIZE might also imply a change of the position
2717  break;
2718  default:
2719  // not interested in
2720  break;
2721  }
2722 }
2723 
2724 void SdrObject::impl_setUnoShape( const uno::Reference< uno::XInterface >& _rxUnoShape )
2725 {
2726  const uno::Reference< uno::XInterface>& xOldUnoShape( maWeakUnoShape );
2727  // the UNO shape would be gutted by the following code; return early
2728  if ( _rxUnoShape == xOldUnoShape )
2729  {
2730  if ( !xOldUnoShape.is() )
2731  {
2732  // make sure there is no stale impl. pointer if the UNO
2733  // shape was destroyed meanwhile (remember we only hold weak
2734  // reference to it!)
2735  mpSvxShape = nullptr;
2736  }
2737  return;
2738  }
2739 
2740  bool bTransferOwnership( false );
2741  if ( xOldUnoShape.is() )
2742  {
2743  bTransferOwnership = mpSvxShape->HasSdrObjectOwnership();
2744  // Remove yourself from the current UNO shape. Its destructor
2745  // will reset our UNO shape otherwise.
2747  }
2748 
2749  maWeakUnoShape = _rxUnoShape;
2750  mpSvxShape = comphelper::getUnoTunnelImplementation<SvxShape>( _rxUnoShape );
2751 
2752  // I think this may never happen... But I am not sure enough .-)
2753  if ( bTransferOwnership )
2754  {
2755  if (mpSvxShape)
2757  SAL_WARN( "svx.uno", "a UNO shape took over an SdrObject previously owned by another UNO shape!");
2758  }
2759 }
2760 
2763 {
2765  // retrieving the impl pointer and subsequently using it is not thread-safe, of course, so it needs to be
2766  // guarded by the SolarMutex
2767 
2768  uno::Reference< uno::XInterface > xShape( maWeakUnoShape );
2769 #if OSL_DEBUG_LEVEL > 0
2770  OSL_ENSURE( !( !xShape.is() && mpSvxShape ),
2771  "SdrObject::getSvxShape: still having IMPL-Pointer to dead object!" );
2772 #endif
2773  //#113608#, make sure mpSvxShape is always synchronized with maWeakUnoShape
2774  if ( mpSvxShape && !xShape.is() )
2775  mpSvxShape = nullptr;
2776 
2777  return mpSvxShape;
2778 }
2779 
2780 css::uno::Reference< css::uno::XInterface > SdrObject::getUnoShape()
2781 {
2782  // try weak reference first
2783  uno::Reference< uno::XInterface > xShape( getWeakUnoShape() );
2784  if( !xShape.is() )
2785  {
2786  OSL_ENSURE( mpSvxShape == nullptr, "SdrObject::getUnoShape: XShape already dead, but still an IMPL pointer!" );
2787 
2788  // try to access SdrPage from this SdrObject. This will only exist if the SdrObject is
2789  // inserted in a SdrObjList (page/group/3dScene)
2790  SdrPage* pPageCandidate(getSdrPageFromSdrObject());
2791 
2792  // tdf#12152, tdf#120728
2793  //
2794  // With the paradigm change to only get a SdrPage for a SdrObject when the SdrObject
2795  // is *inserted*, the functionality for creating 1:1 associated UNO API implementation
2796  // SvxShapes was partially broken: The used ::CreateShape relies on the SvxPage being
2797  // derived and the CreateShape method overloaded, implementing additional SdrInventor
2798  // types as needed.
2799  //
2800  // The fallback to use SvxDrawPage::CreateShapeByTypeAndInventor is a trap: It's only
2801  // a static fallback that handles the SdrInventor types SdrInventor::E3d and
2802  // SdrInventor::Default. Due to that, e.g. the ReportDesigner broke in various conditions.
2803  //
2804  // That again has to do with the ReportDesigner being implemented using the UNO API
2805  // aspects of SdrObjects early during their construction, not just after these are
2806  // inserted to a SdrPage - but that is not illegal or wrong, the SdrObject exists already.
2807  //
2808  // As a current solution, use the (now always available) SdrModel and any of the
2809  // existing SdrPages. The only important thing is to get a SdrPage where ::CreateShape is
2810  // overloaded and implemented as needed.
2811  //
2812  // Note for the future:
2813  // In a more ideal world there would be only one factory method for creating SdrObjects (not
2814  // ::CreateShape and ::CreateShapeByTypeAndInventor). This also would not be placed at
2815  // SdrPage/SvxPage at all, but at the Model where it belongs - where else would you expect
2816  // objects for the current Model to be constructed? To have this at the Page only would make
2817  // sense if different shapes would need to be constructed for different Pages in the same Model
2818  // - this is never the case.
2819  // At that Model extended functionality for that factory (or overloads and implementations)
2820  // should be placed. But to be realistic, migrating the factories to Model now is too much
2821  // work - maybe over time when melting SdrObject/SvxObject one day...
2822  if(nullptr == pPageCandidate)
2823  {
2824  // If not inserted, alternatively access a SdrPage using the SdrModel. There is
2825  // no reason not to create and return a UNO API XShape when the SdrObject is not
2826  // inserted - it may be in construction. Main paradigm is that it exists.
2827  if(0 != getSdrModelFromSdrObject().GetPageCount())
2828  {
2829  // Take 1st SdrPage. That may be e.g. a special page (in SD), but the
2830  // to-be-used method ::CreateShape will be correctly overloaded in
2831  // all cases
2832  pPageCandidate = getSdrModelFromSdrObject().GetPage(0);
2833  }
2834  }
2835 
2836  if(nullptr != pPageCandidate)
2837  {
2838  uno::Reference< uno::XInterface > xPage(pPageCandidate->getUnoPage());
2839  if( xPage.is() )
2840  {
2841  SvxDrawPage* pDrawPage = comphelper::getUnoTunnelImplementation<SvxDrawPage>(xPage);
2842  if( pDrawPage )
2843  {
2844  // create one
2845  xShape = pDrawPage->CreateShape( this );
2846  impl_setUnoShape( xShape );
2847  }
2848  }
2849  }
2850  else
2851  {
2852  // Fallback to static base functionality. CAUTION: This will only support
2853  // the most basic stuff like SdrInventor::E3d and SdrInventor::Default. All
2854  // the other SdrInventor enum entries are from overloads and are *not accessible*
2855  // using this fallback (!) - what a bad trap
2857  maWeakUnoShape = xShape = static_cast< ::cppu::OWeakObject* >( mpSvxShape );
2858  }
2859  }
2860 
2861  return xShape;
2862 }
2863 
2864 void SdrObject::setUnoShape(const uno::Reference<uno::XInterface >& _rxUnoShape)
2865 {
2866  impl_setUnoShape( _rxUnoShape );
2867 }
2868 
2870 {
2872 
2873  SvxShape* pSvxShape = getSvxShape();
2874  ENSURE_OR_THROW( pSvxShape, "no SvxShape, yet!" );
2875  return pSvxShape->getShapePropertyChangeNotifier();
2876 }
2877 
2879 {
2881 
2882  SvxShape* pSvxShape = const_cast< SdrObject* >( this )->getSvxShape();
2883  if ( pSvxShape )
2884  return pSvxShape->getShapePropertyChangeNotifier().notifyPropertyChange( _eProperty );
2885 }
2886 
2887 
2888 // transformation interface for StarOfficeAPI. This implements support for
2889 // homogeneous 3x3 matrices containing the transformation of the SdrObject. At the
2890 // moment it contains a shearX, rotation and translation, but for setting all linear
2891 // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
2892 
2893 
2894 // gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
2895 // with the base geometry and returns TRUE. Otherwise it returns FALSE.
2897 {
2898  // any kind of SdrObject, just use SnapRect
2899  tools::Rectangle aRectangle(GetSnapRect());
2900 
2901  // convert to transformation values
2902  basegfx::B2DTuple aScale(aRectangle.GetWidth(), aRectangle.GetHeight());
2903  basegfx::B2DTuple aTranslate(aRectangle.Left(), aRectangle.Top());
2904 
2905  // position maybe relative to anchorpos, convert
2907  {
2908  if(GetAnchorPos().X() || GetAnchorPos().Y())
2909  {
2910  aTranslate -= basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
2911  }
2912  }
2913 
2914  // build matrix
2915  rMatrix = basegfx::utils::createScaleTranslateB2DHomMatrix(aScale, aTranslate);
2916 
2917  return false;
2918 }
2919 
2920 // sets the base geometry of the object using infos contained in the homogeneous 3x3 matrix.
2921 // If it's an SdrPathObj it will use the provided geometry information. The Polygon has
2922 // to use (0,0) as upper left and will be scaled to the given size in the matrix.
2924 {
2925  // break up matrix
2926  basegfx::B2DTuple aScale;
2927  basegfx::B2DTuple aTranslate;
2928  double fRotate, fShearX;
2929  rMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
2930 
2931  // #i75086# Old DrawingLayer (GeoStat and geometry) does not support holding negative scalings
2932  // in X and Y which equal a 180 degree rotation. Recognize it and react accordingly
2933  if(basegfx::fTools::less(aScale.getX(), 0.0) && basegfx::fTools::less(aScale.getY(), 0.0))
2934  {
2935  aScale.setX(fabs(aScale.getX()));
2936  aScale.setY(fabs(aScale.getY()));
2937  }
2938 
2939  // if anchor is used, make position relative to it
2941  {
2942  if(GetAnchorPos().X() || GetAnchorPos().Y())
2943  {
2944  aTranslate += basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
2945  }
2946  }
2947 
2948  // build BaseRect
2949  Point aPoint(FRound(aTranslate.getX()), FRound(aTranslate.getY()));
2950  tools::Rectangle aBaseRect(aPoint, Size(FRound(aScale.getX()), FRound(aScale.getY())));
2951 
2952  // set BaseRect
2953  SetSnapRect(aBaseRect);
2954 }
2955 
2956 // Give info if object is in destruction
2958 {
2960 }
2961 
2962 // return if fill is != drawing::FillStyle_NONE
2964 {
2965  return GetObjectItem(XATTR_FILLSTYLE).GetValue() != drawing::FillStyle_NONE;
2966 }
2967 
2969 {
2970  return GetObjectItem(XATTR_LINESTYLE).GetValue() != drawing::LineStyle_NONE;
2971 }
2972 
2973 
2974 // #i52224#
2975 // on import of OLE object from MS documents the BLIP size might be retrieved,
2976 // the following four methods are used to control it;
2977 // usually this data makes no sense after the import is finished, since the object
2978 // might be resized
2979 
2980 
2982 {
2983  maBLIPSizeRectangle = aRect;
2984 }
2985 
2986 void SdrObject::SetContextWritingMode( const sal_Int16 /*_nContextWritingMode*/ )
2987 {
2988  // this base class does not support different writing modes, so ignore the call
2989 }
2990 
2992 {
2994 }
2995 
2996 
2997 // #i121917#
2999 {
3000  return false;
3001 }
3002 
3004 {
3005  return false;
3006 }
3007 
3009 {
3010  std::unordered_set<OUString> aNameSet;
3011  MakeNameUnique(aNameSet);
3012 }
3013 
3014 void SdrObject::MakeNameUnique(std::unordered_set<OUString>& rNameSet)
3015 {
3016  if (GetName().isEmpty())
3017  return;
3018 
3019  if (rNameSet.empty())
3020  {
3021  SdrPage* pPage;
3022  SdrObject* pObj;
3023  for (sal_uInt16 nPage(0); nPage < mrSdrModelFromSdrObject.GetPageCount(); ++nPage)
3024  {
3025  pPage = mrSdrModelFromSdrObject.GetPage(nPage);
3027  while (aIter.IsMore())
3028  {
3029  pObj = aIter.Next();
3030  if (pObj != this)
3031  rNameSet.insert(pObj->GetName());
3032  }
3033  }
3034  }
3035 
3036  OUString sName(GetName());
3037  OUString sRootName(GetName());
3038  sal_Int32 index = sName.lastIndexOf("_");
3039  if ( index > 0)
3040  sRootName = sRootName.copy(0, index);
3041 
3042  sal_uInt32 n = 0;
3043  while (rNameSet.find(sName) != rNameSet.end())
3044  {
3045  sName = sRootName + "_" + OUString::number(n++);
3046  }
3047  rNameSet.insert(sName);
3048 
3049  SetName(sName);
3050 }
3051 
3053 {
3054  SdrObjCreatorParams aParams { nInventor, nObjIdentifier, rSdrModel };
3055  for (const auto & i : ImpGetUserMakeObjHdl()) {
3056  SdrObject* pObj = i.Call(aParams);
3057  if (pObj) {
3058  return pObj;
3059  }
3060  }
3061  return nullptr;
3062 }
3063 
3065  SdrModel& rSdrModel,
3066  SdrInventor nInventor,
3067  SdrObjKind nIdentifier,
3068  const tools::Rectangle* pSnapRect)
3069 {
3070  SdrObject* pObj(nullptr);
3071  bool bSetSnapRect(nullptr != pSnapRect);
3072 
3073  if (nInventor == SdrInventor::Default)
3074  {
3075  switch (nIdentifier)
3076  {
3077  case OBJ_MEASURE:
3078  {
3079  if(nullptr != pSnapRect)
3080  {
3081  pObj = new SdrMeasureObj(
3082  rSdrModel,
3083  pSnapRect->TopLeft(),
3084  pSnapRect->BottomRight());
3085  }
3086  else
3087  {
3088  pObj = new SdrMeasureObj(rSdrModel);
3089  }
3090  }
3091  break;
3092  case OBJ_LINE:
3093  {
3094  if(nullptr != pSnapRect)
3095  {
3096  basegfx::B2DPolygon aPoly;
3097 
3098  aPoly.append(
3100  pSnapRect->Left(),
3101  pSnapRect->Top()));
3102  aPoly.append(
3104  pSnapRect->Right(),
3105  pSnapRect->Bottom()));
3106  pObj = new SdrPathObj(
3107  rSdrModel,
3108  OBJ_LINE,
3109  basegfx::B2DPolyPolygon(aPoly));
3110  }
3111  else
3112  {
3113  pObj = new SdrPathObj(
3114  rSdrModel,
3115  OBJ_LINE);
3116  }
3117  }
3118  break;
3119  case OBJ_TEXT:
3120  case OBJ_TITLETEXT:
3121  case OBJ_OUTLINETEXT:
3122  {
3123  if(nullptr != pSnapRect)
3124  {
3125  pObj = new SdrRectObj(
3126  rSdrModel,
3127  nIdentifier,
3128  *pSnapRect);
3129  bSetSnapRect = false;
3130  }
3131  else
3132  {
3133  pObj = new SdrRectObj(
3134  rSdrModel,
3135  nIdentifier);
3136  }
3137  }
3138  break;
3139  case OBJ_CIRC:
3140  case OBJ_SECT:
3141  case OBJ_CARC:
3142  case OBJ_CCUT:
3143  {
3144  SdrCircKind eCircKind = ToSdrCircKind(nIdentifier);
3145  if(nullptr != pSnapRect)
3146  {
3147  pObj = new SdrCircObj(rSdrModel, eCircKind, *pSnapRect);
3148  bSetSnapRect = false;
3149  }
3150  else
3151  {
3152  pObj = new SdrCircObj(rSdrModel, eCircKind);
3153  }
3154  }
3155  break;
3156  case OBJ_NONE : pObj=new SdrObject(rSdrModel); break;
3157  case OBJ_GRUP : pObj=new SdrObjGroup(rSdrModel); break;
3158  case OBJ_POLY : pObj=new SdrPathObj(rSdrModel, OBJ_POLY ); break;
3159  case OBJ_PLIN : pObj=new SdrPathObj(rSdrModel, OBJ_PLIN ); break;
3160  case OBJ_PATHLINE : pObj=new SdrPathObj(rSdrModel, OBJ_PATHLINE ); break;
3161  case OBJ_PATHFILL : pObj=new SdrPathObj(rSdrModel, OBJ_PATHFILL ); break;
3162  case OBJ_FREELINE : pObj=new SdrPathObj(rSdrModel, OBJ_FREELINE ); break;
3163  case OBJ_FREEFILL : pObj=new SdrPathObj(rSdrModel, OBJ_FREEFILL ); break;
3164  case OBJ_PATHPOLY : pObj=new SdrPathObj(rSdrModel, OBJ_POLY ); break;
3165  case OBJ_PATHPLIN : pObj=new SdrPathObj(rSdrModel, OBJ_PLIN ); break;
3166  case OBJ_EDGE : pObj=new SdrEdgeObj(rSdrModel); break;
3167  case OBJ_RECT : pObj=new SdrRectObj(rSdrModel); break;
3168  case OBJ_GRAF : pObj=new SdrGrafObj(rSdrModel); break;
3169  case OBJ_OLE2 : pObj=new SdrOle2Obj(rSdrModel); break;
3170  case OBJ_FRAME : pObj=new SdrOle2Obj(rSdrModel, true); break;
3171  case OBJ_CAPTION : pObj=new SdrCaptionObj(rSdrModel); break;
3172  case OBJ_PAGE : pObj=new SdrPageObj(rSdrModel); break;
3173  case OBJ_UNO : pObj=new SdrUnoObj(rSdrModel, OUString()); break;
3174  case OBJ_CUSTOMSHAPE: pObj=new SdrObjCustomShape(rSdrModel); break;
3175 #if HAVE_FEATURE_AVMEDIA
3176  case OBJ_MEDIA : pObj=new SdrMediaObj(rSdrModel); break;
3177 #endif
3178  case OBJ_TABLE : pObj=new sdr::table::SdrTableObj(rSdrModel); break;
3179  default: break;
3180  }
3181  }
3182 
3183  if (!pObj)
3184  {
3185  pObj = CreateObjectFromFactory(rSdrModel, nInventor, nIdentifier);
3186  }
3187 
3188  if (!pObj)
3189  {
3190  // Well, if no one wants it...
3191  return nullptr;
3192  }
3193 
3194  if(bSetSnapRect && nullptr != pSnapRect)
3195  {
3196  pObj->SetSnapRect(*pSnapRect);
3197  }
3198 
3199  return pObj;
3200 }
3201 
3203 {
3204  std::vector<Link<SdrObjCreatorParams, SdrObject*>>& rLL=ImpGetUserMakeObjHdl();
3205  auto it = std::find(rLL.begin(), rLL.end(), rLink);
3206  if (it != rLL.end()) {
3207  OSL_FAIL("SdrObjFactory::InsertMakeObjectHdl(): Link already in place.");
3208  } else {
3209  rLL.push_back(rLink);
3210  }
3211 }
3212 
3214 {
3215  std::vector<Link<SdrObjCreatorParams, SdrObject*>>& rLL=ImpGetUserMakeObjHdl();
3216  auto it = std::find(rLL.begin(), rLL.end(), rLink);
3217  if (it != rLL.end())
3218  rLL.erase(it);
3219 }
3220 
3221 namespace svx
3222 {
3224  {
3225  }
3226 }
3227 
3228 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void TakeNotPersistAttr(SfxItemSet &rAttr) const
Definition: svdobj.cxx:2105
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1544
SdrCircKind
Definition: svdocirc.hxx:39
Point TopLeft() const
virtual bool HasTextEdit() const
Definition: svdobj.cxx:1701
virtual const SfxItemSet & GetObjectItemSet() const =0
std::shared_ptr< DiagramDataInterface > mpDiagramData
Definition: svdobj.cxx:185
virtual bool BckCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1355
User data of a drawing object, e.g.
Definition: svdobj.hxx:153
void SetRelativeWidthRelation(sal_Int16 eValue)
Definition: svdobj.cxx:497
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
Definition: svdobj.cxx:1070
bool IsMacroHit(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1817
void SetNavigationPosition(const sal_uInt32 nPosition)
Definition: svdobj.cxx:847
const css::uno::WeakReference< css::uno::XInterface > & getWeakUnoShape() const
Definition: svdobj.hxx:868
void setX(double fX)
caption object
Definition: svdobjkind.hxx:49
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
Definition: svdobj.cxx:563
bool bEmptyPresObj
Definition: svdobj.hxx:891
static std::unique_ptr< SdrUndoAction > CreateUndoObjectStrAttr(SdrObject &rObject, SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType, const OUString &sOldStr, const OUString &sNewStr)
Definition: svdundo.cxx:1699
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
svx::PropertyChangeNotifier & getShapePropertyChangeNotifier()
Definition: svdobj.cxx:2869
line
Definition: svdobjkind.hxx:29
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:857
std::optional< double > mnRelativeHeight
Definition: svdobj.cxx:187
virtual bool BegCreate(SdrDragStat &rStat)
Every object must be able to create itself interactively.
Definition: svdobj.cxx:1324
void Set(SdrLayerID a)
Definition: svdsob.hxx:48
SfxItemPool & GetObjectItemPool() const
Definition: svdobj.cxx:548
Polygon/PolyPolygon represented by SdrPathObj.
Definition: svdobjkind.hxx:50
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
Definition: svdobj.cxx:1496
bool mbVisible
Definition: svdobj.hxx:963
static SVX_DLLPRIVATE SdrObject * CreateObjectFromFactory(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nIdentifier)
Definition: svdobj.cxx:3052
void SetResizeProtect(bool bProt)
Definition: svdobj.cxx:2577
void SetPoint(const Point &rPnt, sal_uInt32 i)
Definition: svdobj.cxx:1688
struct _xmlTextWriter * xmlTextWriterPtr
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const
Definition: svdobj.cxx:1311
SdrObjUserCall * pUserCall
Definition: svdobj.hxx:877
constexpr TypedWhichId< SdrTransformRef1XItem > SDRATTR_TRANSFORMREF1X(SDRATTR_NOTPERSIST_FIRST+30)
void DelReference(SdrVirtObj &rVrtObj)
Definition: svdobj.cxx:637
std::shared_ptr< DiagramDataInterface > GetDiagramData() const
Definition: svdobj.cxx:543
bool bMarkProt
Definition: svdobj.hxx:964
std::string GetValue
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage)
Definition: svdobj.cxx:449
void SetName(const OUString &rStr, const bool bSetChanged=true)
Definition: svdobj.cxx:664
virtual SdrObjList * getChildrenOfSdrObject() const
Definition: svdobj.cxx:304
virtual bool IsPolyObj() const
Definition: svdobj.cxx:1673
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
Definition: svdobj.cxx:1383
OUString GetMetrStr(tools::Long nVal) const
Definition: svdobj.cxx:1065
abstract object (SdrObject)
Definition: svdobjkind.hxx:27
static SvxShape * CreateShapeByTypeAndInventor(sal_uInt16 nType, SdrInventor nInventor, SdrObject *pObj, SvxDrawPage *pPage=nullptr, OUString const &referer=OUString())
Definition: unopage.cxx:611
void RemoveObjectUser(sdr::ObjectUser &rOldUser)
Definition: svdobj.cxx:227
const Point & GetStart() const
Definition: svddrag.hxx:92
rectangle (round corners optional)
Definition: svdobjkind.hxx:30
Point BottomLeft() const
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:1413
SdrHdlKind
Definition: svdhdl.hxx:52
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties()
Definition: svdobj.cxx:199
std::vector< Link< SdrObjCreatorParams, SdrObject * > > & ImpGetUserMakeObjHdl()
Definition: svdetc.cxx:342
constexpr TypedWhichId< SdrObjPrintableItem > SDRATTR_OBJPRINTABLE(SDRATTR_NOTPERSIST_FIRST+2)
long Long
bool IsInDestruction() const
Definition: svdobj.cxx:2957
constexpr TypedWhichId< SdrMoveYItem > SDRATTR_MOVEY(SDRATTR_NOTPERSIST_FIRST+19)
void impAddIncarnatedSdrObjectToSdrModel(const SdrObject &rSdrObject, SdrModel &rSdrModel)
Definition: svdobj.cxx:317
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:292
OUString GetDescription() const
Definition: svdobj.cxx:789
bool HasFillStyle() const
Definition: svdobj.cxx:2963
object group
Definition: svdobjkind.hxx:28
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
virtual Point GetRelativePos() const
Definition: svdobj.cxx:1573
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const
Definition: svdobj.cxx:2539
class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) ObjectContactPainter typedef::std::vector< SdrObject * > SdrObjectVector
void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
Definition: svdobj.cxx:2154
SdrUserCallType
Definition: svdobj.hxx:115
double getX() const
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1472
sal_Int64 n
virtual bool HasText() const
Definition: svdobj.cxx:2998
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:758
void RecalcObjOrdNums()
recalculate order numbers / ZIndex
Definition: svdpage.cxx:244
bool IsInserted() const
Definition: svdobj.hxx:744
virtual bool IsTextBox() const
Is this a textbox of a drawinglayer shape?
Definition: svdobj.cxx:3003
size_t GetObjCount() const
Definition: svdpage.cxx:752
circle cut
Definition: svdobjkind.hxx:34
virtual void SetBoundRectDirty()
Definition: svdobj.cxx:310
void SetGlueReallyAbsolute(bool bOn)
Definition: svdobj.cxx:2228
virtual ~SdrObjUserCall()
Definition: svdobj.cxx:124
virtual void addCropHandles(SdrHdlList &rTarget) const
Definition: svdobj.cxx:1196
void setUnoShape(const css::uno::Reference< css::uno::XInterface > &_rxUnoShape)
Definition: svdobj.cxx:2864
void SetRelativeHeightRelation(sal_Int16 eValue)
Definition: svdobj.cxx:507
virtual bool hasSpecialDrag() const
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdobj.cxx:1272
static SdrObject * MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
Definition: svdobj.cxx:3064
void DrawPolyLine(const tools::Polygon &rPoly)
SdrObjUserData(SdrInventor nInv, sal_uInt16 nId)
Definition: svdobj.cxx:138
static void extractLineContourFromPrimitive2DSequence(const drawinglayer::primitive2d::Primitive2DContainer &rxSequence, basegfx::B2DPolygonVector &rExtractedHairlines, basegfx::B2DPolyPolygonVector &rExtractedLineFills)
Definition: svdobj.cxx:2282
circle section
Definition: svdobjkind.hxx:32
double getY() const
tools::Long GetWidth() const
SdrInventor
Definition: svdobj.hxx:101
virtual OUString TakeObjNameSingul() const
Definition: svdobj.cxx:1021
constexpr TypedWhichId< XLineStyleItem > XATTR_LINESTYLE(XATTR_LINE_FIRST)
const SfxBroadcaster * GetBroadcaster() const
Definition: svdobj.cxx:627
static void InsertMakeObjectHdl(Link< SdrObjCreatorParams, SdrObject * > const &rLink)
Definition: svdobj.cxx:3202
constexpr TypedWhichId< SdrVertShearOneItem > SDRATTR_VERTSHEARONE(SDRATTR_NOTPERSIST_FIRST+24)
constexpr TypedWhichId< SdrYesNoItem > SDRATTR_OBJMOVEPROTECT(SDRATTR_NOTPERSIST_FIRST+0)
tools::Rectangle ImpDragCalcRect(const SdrDragStat &rDrag) const
Definition: svdobj.cxx:1202
virtual void ConnectToNode(bool bTail1, SdrObject *pObj)
Definition: svdobj.cxx:2268
virtual void AddToHdlList(SdrHdlList &rHdlList) const
Definition: svdobj.cxx:1172
void NbcMirrorGluePoints(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:2248
void SetEmptyPresObj(bool bEpt)
Definition: svdobj.cxx:2468
virtual sal_uInt32 GetPointCount() const
Definition: svdobj.cxx:1678
static void Free(SdrObject *&_rpObject)
Definition: svdobj.cxx:396
virtual SdrObjKind GetObjIdentifier() const
Definition: svdobj.cxx:558
virtual ~SdrObject() override
Definition: svdobj.cxx:369
virtual sdr::properties::BaseProperties & GetProperties() const
Definition: svdobj.cxx:204
::std::vector< ObjectUser * > ObjectUserVector
media shape
Definition: svdobjkind.hxx:57
Center
EmbeddedObjectRef * pObject
void FreezeIdRanges()
bool bSizProt
Definition: svdobj.hxx:183
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:175
SVX_DLLPRIVATE void setParentOfSdrObject(SdrObjList *pNew)
Definition: svdobj.cxx:278
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:647
SdrObjKind
Definition: svdobjkind.hxx:24
void BegUndo()
Definition: svdmodel.cxx:412
virtual SdrObjGeoData * GetGeoData() const
Definition: svdobj.cxx:1878
void AddListener(SfxListener &rListener)
Definition: svdobj.cxx:606
void SetRight(tools::Long v)
virtual void AddToPlusHdlList(SdrHdlList &rHdlList, SdrHdl &rHdl) const
Definition: svdobj.cxx:1192
measurement object
Definition: svdobjkind.hxx:53
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:245
B2DPolyPolygon mergeToSinglePolyPolygon(const B2DPolyPolygonVector &rInput)
void SetGrabBagItem(const css::uno::Any &rVal)
Definition: svdobj.cxx:825
SdrCircKind ToSdrCircKind(SdrObjKind eKind)
Definition: svdocirc.cxx:104
void AddObjectUser(sdr::ObjectUser &rNewUser)
Definition: svdobj.cxx:222
virtual const SfxItemSet & GetMergedItemSet() const
Definition: properties.cxx:69
void ImpSetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1578
bool bSnapRectDirty
Definition: svdobj.hxx:882
Point RightCenter() const
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1610
constexpr TypedWhichId< SdrOneSizeHeightItem > SDRATTR_ONESIZEHEIGHT(SDRATTR_NOTPERSIST_FIRST+13)
void impRemoveIncarnatedSdrObjectToSdrModel(const SdrObject &rSdrObject, SdrModel &rSdrModel)
Definition: svdobj.cxx:321
circle, ellipse
Definition: svdobjkind.hxx:31
virtual void ForceStyleToHardAttributes()
Definition: properties.cxx:99
bool IsVisible() const
Definition: svdobj.hxx:756
Rectangle objects (rectangle, circle, ...)
Definition: svdorect.hxx:39
virtual SdrObject * CheckMacroHit(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1780
virtual void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: properties.cxx:75
bool IsEmpty() const
#define SAL_MAX_UINT32
constexpr TypedWhichId< XLineTransparenceItem > XATTR_LINETRANSPARENCE(XATTR_LINE_FIRST+10)
Provides information about various ZObject properties.
Definition: svdobj.hxx:197
const SdrHdl * GetHdl() const
Definition: svddrag.hxx:101
SdrObjList * mpParentOfSdrObject
Definition: svdobj.hxx:956
bool bIs3DObj
Definition: svdobj.hxx:897
void ClearMergedItem(const sal_uInt16 nWhich=0)
Definition: svdobj.cxx:1917
virtual void BrkCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1351
void reset_preserve_ptr_during(uniqueptr &ptr)
constexpr TypedWhichId< SdrResizeYOneItem > SDRATTR_RESIZEYONE(SDRATTR_NOTPERSIST_FIRST+21)
bool IsOrtho() const
Definition: svdsnpv.hxx:247
virtual css::uno::Reference< css::uno::XInterface > getUnoShape()
Definition: svdobj.cxx:2780
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd)
Definition: svdobj.cxx:1343
tools::Long Left() const
void Mirror(const Point &rRef1, const Point &rRef2, const SdrObject *pObj)
Definition: svdglue.cxx:370
bool IsMore() const
Definition: svditer.hxx:62
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:263
SdrLayerID GetID() const
Definition: svdlayer.hxx:94
virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const
Definition: svdobj.cxx:2175
void SetLeft(tools::Long v)
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:25
RasterOp
virtual Point GetSnapPoint(sal_uInt32 i) const
Definition: svdobj.cxx:1668
#define X
virtual void SetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1590
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdmodel.cxx:546
static bool IsFuzzing()
Point BottomCenter() const
int nCount
bool IsClosed() const
Definition: svdopath.hxx:144
tools::Long Bottom() const
bool bVirtObj
Definition: svdobj.hxx:881
void SetRelativeHeight(double nValue)
Definition: svdobj.cxx:502
const SfxItemSet & GetObjectItemSet() const
Definition: svdobj.cxx:1897
SfxStyleSheet * GetStyleSheet() const
Definition: svdobj.cxx:2149
SdrObject * SdrObjectPrimitiveHit(const SdrObject &rObject, const Point &rPnt, sal_uInt16 nTol, const SdrPageView &rSdrPageView, const SdrLayerIDSet *pVisiLayer, bool bTextOnly, drawinglayer::primitive2d::Primitive2DContainer *pHitContainer)
void MakeNameUnique()
Definition: svdobj.cxx:3008
void SetOrtho4Possible(bool bOn=true)
Definition: svddrag.hxx:126
virtual void Crop(const basegfx::B2DPoint &rRef, double fxFact, double fyFact)
Definition: svdobj.cxx:1515
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:1927
void getMergedHierarchySdrLayerIDSet(SdrLayerIDSet &rSet) const
Definition: svdobj.cxx:582
void TakeCreateRect(tools::Rectangle &rRect) const
Definition: svddrag.cxx:115
void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs, const SdrObject *pObj)
Definition: svdglue.cxx:364
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
virtual void RecalcSnapRect()
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: svdobj.cxx:1606
void BurnInStyleSheetAttributes()
Definition: svdobj.cxx:1770
constexpr TypedWhichId< SdrOnePositionYItem > SDRATTR_ONEPOSITIONY(SDRATTR_NOTPERSIST_FIRST+11)
bool bClosedObj
Definition: svdobj.hxx:895
SdrLayerID mnLayerID
Definition: svdobj.hxx:961
void SetDiagramData(std::shared_ptr< DiagramDataInterface > pDiagramData)
Definition: svdobj.cxx:538
constexpr TypedWhichId< SdrAngleItem > SDRATTR_ROTATEANGLE(SDRATTR_NOTPERSIST_FIRST+16)
constexpr SdrLayerID SDRLAYER_NOTFOUND(0xff)
void SetObjectItem(const SfxPoolItem &rItem)
Definition: svdobj.cxx:1907
void SetRelativeWidth(double nValue)
Definition: svdobj.cxx:492
std::unique_ptr< SfxGrabBagItem > pGrabBagItem
Definition: svdobj.hxx:958
bool Equals(const SfxItemSet &, bool bComparePool) const
virtual ~SdrObjUserData()
Definition: svdobj.cxx:146
void NbcApplyNotPersistAttr(const SfxItemSet &rAttr)
Definition: svdobj.cxx:1956
Point LeftCenter() const
void SetMoveProtect(bool bProt)
Definition: svdobj.cxx:2566
virtual void SetChanged(bool bFlg=true)
Definition: svdmodel.cxx:1261
std::optional< double > mnRelativeWidth
Definition: svdobj.cxx:186
virtual SdrObject * GetConnectedNode(bool bTail1) const
Definition: svdobj.cxx:2276
virtual void Changed(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle &rOldBoundRect)
Definition: svdobj.cxx:128
SdrObject & operator=(const SdrObject &rObj)
Definition: svdobj.cxx:982
virtual bool HasLimitedRotation() const
Definition: svdobj.cxx:971
SdrLayer * GetLayer(sal_uInt16 i)
Definition: svdlayer.hxx:139
void SetMarkProtect(bool bProt)
Definition: svdobj.cxx:2462
sal_uInt32 GetOrdNumDirect() const
Definition: svdobj.hxx:843
SdrObject * GetConnectedNode(bool bTail1) const override
Definition: svdoedge.cxx:472
void ImpForcePlusData()
Definition: svdobj.cxx:1059
constexpr TypedWhichId< SdrHorzShearOneItem > SDRATTR_HORZSHEARONE(SDRATTR_NOTPERSIST_FIRST+23)
static bool less(const double &rfValA, const double &rfValB)
virtual ~ISdrObjectFilter()=0
Definition: svdobj.cxx:3223
virtual void ProcessDisplay(DisplayInfo &rDisplayInfo) override
Polyline represented by SdrPathObj.
Definition: svdobjkind.hxx:51
virtual SfxStyleSheet * GetStyleSheet() const =0
exports com.sun.star. text
void notifyPropertyChange(const ShapeProperty _eProperty) const
notifies changes in the given property to all registered listeners
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)=0
constexpr TypedWhichId< SdrOneSizeWidthItem > SDRATTR_ONESIZEWIDTH(SDRATTR_NOTPERSIST_FIRST+12)
Point BottomRight() const
const SfxPoolItem & GetObjectItem(const sal_uInt16 nWhich) const
Definition: svdobj.cxx:1932
SdrLayerID mnLayerID
Definition: svdobj.hxx:187
virtual bool MovCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1334
std::unordered_set< const SdrObject * > maAllIncarnatedObjects
Definition: svdmodel.hxx:162
virtual void NbcSetPoint(const Point &rPnt, sal_uInt32 i)
Definition: svdobj.cxx:1697
void ResizeRect(tools::Rectangle &rRect, const Point &rRef, const Fraction &rxFact, const Fraction &ryFact)
Definition: svdtrans.cxx:37
virtual void SetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:599
#define DBG_UNHANDLED_EXCEPTION(...)
void SetLineColor()
void AddReference(SdrVirtObj &rVrtObj)
Definition: svdobj.cxx:632
open Bezier-curve
Definition: svdobjkind.hxx:37
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
UNDERLYING_TYPE get() const
virtual const SdrGluePointList * GetGluePointList() const
Definition: svdobj.cxx:2212
bool mbSupportTextIndentingOnLineWidthChange
Definition: svdobj.hxx:902
virtual void SetObjectItem(const SfxPoolItem &rItem)=0
css::uno::WeakReference< css::uno::XInterface > maWeakUnoShape
Definition: svdobj.hxx:979
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define DBG_ASSERT(sCon, aError)
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: properties.cxx:106
std::unique_ptr< sdr::properties::BaseProperties > mpProperties
Definition: svdobj.hxx:969
int i
const basegfx::B2DPolyPolygonVector & getExtractedLineFills() const
uno_Any a
bool IsWriter() const
Definition: svdmodel.hxx:576
void SingleObjectPainter(OutputDevice &rOut) const
Definition: svdobj.cxx:954
OUString sName
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
tools::Long FRound(double fVal)
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1441
SdrObject(SdrModel &rSdrModel)
Definition: svdobj.cxx:330
void TakeSdrObjectOwnership()
takes the ownership of the SdrObject.
Definition: unoshape.cxx:249
constexpr TypedWhichId< SdrLayerNameItem > SDRATTR_LAYERNAME(SDRATTR_NOTPERSIST_FIRST+4)
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon)
Definition: svdobj.cxx:2923
tools::Rectangle aOutRect
Definition: svdobj.hxx:875
bool Equals(const SdrObject &) const
Definition: svdobj.cxx:1706
virtual void AdjustToMaxRect(const tools::Rectangle &rMaxRect, bool bShrinkOnly=false)
Definition: svdobj.cxx:1630
connector object
Definition: svdobjkind.hxx:48
void BroadcastObjectChange() const
Definition: svdobj.cxx:908
constexpr TypedWhichId< SdrMoveXItem > SDRATTR_MOVEX(SDRATTR_NOTPERSIST_FIRST+18)
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
sal_Int32 GetPointCount() const
Definition: svddrag.hxx:91
virtual void SetGeoData(const SdrObjGeoData &rGeo)
Definition: svdobj.cxx:1885
virtual Degree100 GetShearAngle(bool bVertical=false) const
Definition: svdobj.cxx:1658
virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat &rDrag) const
Definition: svdobj.cxx:1316
virtual bool supportsFullDrag() const
Definition: svdobj.cxx:1277
sal_uInt32 mnNavigationPosition
Definition: svdobj.hxx:960
OutlineText, special text object for StarDraw.
Definition: svdobjkind.hxx:45
bool IsPrintable() const
Definition: svdobj.hxx:754
const SdrPage * GetPage(sal_uInt16 nPgNum) const
Definition: svdmodel.cxx:1904
void ActionChanged() const
Definition: svdobj.cxx:257
virtual void impl_setUnoShape(const css::uno::Reference< css::uno::XInterface > &_rxUnoShape)
Sets a new UNO shape.
Definition: svdobj.cxx:2724
SdrView * GetView() const
Definition: svddrag.hxx:86
virtual void SaveGeoData(SdrObjGeoData &rGeo) const
Definition: svdobj.cxx:1828
constexpr TypedWhichId< SdrObjVisibleItem > SDRATTR_OBJVISIBLE(SDRATTR_NOTPERSIST_FIRST+35)
void SetFillColor()
tools::Long Width() const
const OUString & GetName() const
Definition: svdlayer.hxx:77
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:1942
const basegfx::B2DPolygonVector & getExtractedHairlines() const
open free-hand line
Definition: svdobjkind.hxx:39
void DeleteUserData(sal_uInt16 nNum)
Definition: svdobj.cxx:2644
OUString GetTitle() const
Definition: svdobj.cxx:745
void NbcShearGluePoints(const Point &rRef, double tn, bool bVShear)
Definition: svdobj.cxx:2258
virtual basegfx::B2DPolyPolygon TakeContour() const
contour for TextToContour
Definition: svdobj.cxx:1079
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:273
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:799
polygon, PolyPolygon
Definition: svdobjkind.hxx:35
void process(const primitive2d::Primitive2DContainer &rSource)
closed Bezier-curve
Definition: svdobjkind.hxx:38
SdrLayer * GetLayerPerID(SdrLayerID nID)
Definition: svdlayer.hxx:147
virtual bool HasMacro() const
Definition: svdobj.cxx:1775
void SetPercent(bool bOn)
Definition: svdglue.hxx:90
bool IsGroupObject() const
Definition: svdobj.cxx:642
void SetVisible(bool bVisible)
Definition: svdobj.cxx:2602
constexpr TypedWhichId< SdrLogicSizeWidthItem > SDRATTR_LOGICSIZEWIDTH(SDRATTR_NOTPERSIST_FIRST+14)
sal_Int16 meRelativeWidthRelation
Definition: svdobj.cxx:188
virtual void SetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1644
void SetTop(tools::Long v)
virtual void Move(const Size &rSiz)
Definition: svdobj.cxx:1479
void SetMergedItem(const SfxPoolItem &rItem)
Definition: svdobj.cxx:1912
void SetBottom(tools::Long v)
bool IsResizeProtect() const
Definition: svdobj.hxx:752
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
virtual void RecalcBoundRect()
Definition: svdobj.cxx:876
virtual void SetRelativePos(const Point &rPnt)
Definition: svdobj.cxx:1562
tuple index
void SetUserCall(SdrObjUserCall *pUser)
Definition: svdobj.cxx:2657
constexpr TypedWhichId< SdrShearAngleItem > SDRATTR_SHEARANGLE(SDRATTR_NOTPERSIST_FIRST+17)
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
Definition: svdobj.cxx:1937
const basegfx::B2DPolyPolygonVector & getExtractedContour() const
virtual void PaintMacro(OutputDevice &rOut, const tools::Rectangle &rDirtyRect, const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1795
virtual css::uno::Reference< css::drawing::XShape > CreateShape(SdrObject *pObj) const
Definition: unopage.cxx:825
This class represents an embedded or linked bitmap graphic object.
Definition: svdograf.hxx:77
constexpr TypedWhichId< SdrLayerIdItem > SDRATTR_LAYERID(SDRATTR_NOTPERSIST_FIRST+3)
const SdrLayerIDSet * pVisiLayer
Definition: svdobj.hxx:141
virtual sal_uInt32 GetHdlCount() const
Via GetHdlCount the number of Handles can be retrieved.
Definition: svdobj.cxx:1167
tools::Long Top() const
Abstract DrawObject.
Definition: svdobj.hxx:261
void SetReallyAbsolute(bool bOn, const SdrObject &rObj)
Definition: svdglue.cxx:358
virtual void ActionChanged()
bool bNoPrint
Definition: svdobj.hxx:184
void notifyShapePropertyChange(const svx::ShapeProperty _eProperty) const
Definition: svdobj.cxx:2878
const double * GetRelativeWidth() const
Definition: svdobj.cxx:512
virtual void Mirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1535
sal_Int16 GetRelativeWidthRelation() const
Definition: svdobj.cxx:520
OUString GetName() const
Definition: svdobj.cxx:701
Size GetSize() const
Point aAnchor
Definition: svdobj.hxx:876
#define Y
virtual SdrInventor GetObjInventor() const
Definition: svdobj.cxx:553
virtual void DisconnectFromNode(bool bTail1)
Definition: svdobj.cxx:2272
constexpr TypedWhichId< SdrYesNoItem > SDRATTR_OBJSIZEPROTECT(SDRATTR_NOTPERSIST_FIRST+1)
SdrModel & mrSdrModelFromSdrObject
Definition: svdobj.hxx:290
void AppendUserData(std::unique_ptr< SdrObjUserData > pData)
Definition: svdobj.cxx:2629
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:577
bool HasLineStyle() const
Definition: svdobj.cxx:2968
tools::Long AdjustTop(tools::Long nVertMoveDelta)
static SfxItemPool * CreatePool()
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
MapUnit GetMapUnit()
Definition: svdetc.hxx:78
constexpr TypedWhichId< SdrRotateOneItem > SDRATTR_ROTATEONE(SDRATTR_NOTPERSIST_FIRST+22)
SvxShape * getSvxShape()
only for internal use!
Definition: svdobj.cxx:2762
void EndUndo()
Definition: svdmodel.cxx:483
Point aAnchor
Definition: svdobj.hxx:179
#define ENSURE_OR_THROW(c, m)
SvxShape * mpSvxShape
Definition: svdobj.hxx:977
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
virtual void RestGeoData(const SdrObjGeoData &rGeo)
Definition: svdobj.cxx:1851
static void RemoveMakeObjectHdl(Link< SdrObjCreatorParams, SdrObject * > const &rLink)
Definition: svdobj.cxx:3213
bool bMovProt
Definition: svdobj.hxx:182
virtual const tools::Rectangle & GetLastBoundRect() const
Definition: svdobj.cxx:871
virtual void NbcReformatText()
Definition: svdobj.cxx:1766
static SdrItemPool * mpGlobalItemPool
Definition: svdobj.hxx:974
SdrObject * Next()
Definition: svditer.hxx:63
void InsertedStateChange()
Definition: svdobj.cxx:2545
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const
Definition: svdobj.cxx:2196
void SetActionRect(const tools::Rectangle &rR)
Definition: svddrag.hxx:157
void Broadcast(const SfxHint &rHint)
SdrObjectUniquePtr ConvertToPolyObj(bool bBezier, bool bLineToArea) const
Definition: svdobj.cxx:2519
bool bSizProt
Definition: svdobj.hxx:885
void SetDoNotInsertIntoPageAutomatically(bool bSet)
Definition: svdobj.cxx:2991
void SetDefaultMetric(MapUnit eNewMetric)
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact()
Definition: svdobj.cxx:240
sal_uInt32 count() const
bool mbVisible
virtual void NbcSetOutlinerParaObject(std::unique_ptr< OutlinerParaObject > pTextObject)
Definition: svdobj.cxx:1757
sal_Int32 GetDenominator() const
virtual SdrGluePointList * ForceGluePointList()
Definition: svdobj.cxx:2219
virtual PointerStyle GetMacroPointer(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1790
void setY(double fY)
virtual SdrObjGeoData * NewGeoData() const
A derived class must override these 3 methods if it has own geometric data that must be saved for Und...
Definition: svdobj.cxx:1823
bool bIsUnoObj
Definition: svdobj.hxx:898
static SdrItemPool & GetGlobalDrawObjectItemPool()
Definition: svdobj.cxx:478
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1615
void GetGrabBagItem(css::uno::Any &rVal) const
Definition: svdobj.cxx:817
virtual void NbcSetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1625
virtual std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const =0
void SetBLIPSizeRectangle(const tools::Rectangle &aRect)
Definition: svdobj.cxx:2981
void SetOrdNum(sal_uInt32 nNum)
Definition: svdobj.cxx:812
void SetObjectItemSet(const SfxItemSet &rSet)
Definition: svdobj.cxx:1922
OUString ImpGetDescriptionStr(const char *pStrCacheID) const
Definition: svdobj.cxx:1041
object that represents a SdrPage
Definition: svdobjkind.hxx:52
css::uno::Reference< css::uno::XInterface > const & getUnoPage()
Definition: svdpage.cxx:1666
SdrObject * ConvertToContourObj(SdrObject *pRet, bool bForceLineDash=false) const
Definition: svdobj.cxx:2481
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdobj.cxx:1377
bool mbVisible
Definition: svdobj.hxx:186
OUString aName
const SfxItemSet & GetMergedItemSet() const
Definition: svdobj.cxx:1902
SdrObjUserData * GetUserData(sal_uInt16 nNum) const
Definition: svdobj.cxx:2623
void SetRasterOp(RasterOp eRasterOp)
virtual PointerStyle GetCreatePointer() const
get the cursor/pointer that signals creating this object
Definition: svdobj.cxx:1371
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdobj.cxx:1719
bool bMovProt
Definition: svdobj.hxx:884
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
virtual SdrObject * CloneSdrObject(SdrModel &rTargetModel) const
Definition: svdobj.cxx:977
#define F_PI18000
void SetOutlinerParaObject(std::unique_ptr< OutlinerParaObject > pTextObject)
Definition: svdobj.cxx:1746
void SetDescription(const OUString &rStr)
Definition: svdobj.cxx:755
void RemoveListener(SfxListener &rListener)
Definition: svdobj.cxx:617
tools::Long Height() const
virtual SdrPage * getSdrPageFromSdrObjList() const
Definition: svdpage.cxx:131
virtual ~SdrObjGeoData()
Definition: svdobj.cxx:158
virtual void NbcCrop(const basegfx::B2DPoint &rRef, double fxFact, double fyFact)
Definition: svdobj.cxx:1490
FIXME: The virtual object is not yet fully implemented and tested.
Definition: svdovirt.hxx:30
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
sal_Int32 GetNumerator() const
tools::Rectangle aBoundRect
Definition: svdobj.hxx:178
sal_uInt32 GetNavigationPosition() const
Definition: svdobj.cxx:836
constexpr TypedWhichId< SdrLogicSizeHeightItem > SDRATTR_LOGICSIZEHEIGHT(SDRATTR_NOTPERSIST_FIRST+15)
bool bNotVisibleAsMaster
Definition: svdobj.hxx:893
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
Definition: svdobj.hxx:99
RasterOp GetRasterOp() const
virtual SdrObjectUniquePtr getFullDragClone() const
Definition: svdobj.cxx:1282
void SetSdrObjListRectsDirty()
Definition: svdpage.cxx:271
const Point & GetNow() const
Definition: svddrag.hxx:95
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const
Definition: svdobj.cxx:1288
sal_uInt16 GetUserDataCount() const
Definition: svdobj.cxx:2617
PointerStyle
const Point & GetAnchorPos() const
Definition: svdobj.cxx:1601
text object
Definition: svdobjkind.hxx:43
virtual OUString TakeObjNamePlural() const
Definition: svdobj.cxx:1036
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:1524
SdrObject * getParentSdrObjectFromSdrObject() const
Definition: svdobj.cxx:652
bool bNoPrint
Definition: svdobj.hxx:962
std::unique_ptr< SdrObjPlusData > pPlusData
Definition: svdobj.hxx:879
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:435
Universal Network Object packed into SvDraw object.
Definition: svdobjkind.hxx:55
std::unique_ptr< SdrGluePointList > pGPL
Definition: svdobj.hxx:181
tools::Long GetHeight() const
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1635
virtual bool applySpecialDrag(SdrDragStat &rDrag)
Definition: svdobj.cxx:1299
PolyLine.
Definition: svdobjkind.hxx:36
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
constexpr TypedWhichId< SdrTransformRef1YItem > SDRATTR_TRANSFORMREF1Y(SDRATTR_NOTPERSIST_FIRST+31)
sal_Int16 GetRelativeHeightRelation() const
Definition: svdobj.cxx:533
virtual void SetMergedItem(const SfxPoolItem &rItem)
Definition: properties.cxx:87
std::unique_ptr< sdr::contact::ViewContact > mpViewContact
Definition: svdobj.hxx:971
tools::Long AdjustLeft(tools::Long nHorzMoveDelta)
#define SAL_WARN(area, stream)
void SetNotVisibleAsMaster(bool bFlg)
Definition: svdobj.cxx:2474
const SfxItemPool & GetItemPool() const
Definition: svdmodel.hxx:314
virtual void NbcSetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1583
basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &aViewInformation) const
virtual Degree100 GetRotateAngle() const
Definition: svdobj.cxx:1653
OUString GetMetricString(tools::Long nVal, bool bNoUnitChars=false, sal_Int32 nNumDigits=-1) const
Definition: svdmodel.cxx:1083
bool LineGeometryUsageIsNecessary() const
Definition: svdobj.cxx:965
virtual void SetContextWritingMode(const sal_Int16 _nContextWritingMode)
Definition: svdobj.cxx:2986
tools::Rectangle maBLIPSizeRectangle
Definition: svdobj.hxx:967
#define DBG_TESTSOLARMUTEX()
std::unique_ptr< Impl > mpImpl
Definition: svdobj.hxx:954
virtual const tools::Rectangle & GetLogicRect() const
Definition: svdobj.cxx:1620
sal_uInt16 nTol
Definition: svdobj.hxx:143
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:365
virtual bool DoMacro(const SdrObjMacroHitRec &rRec)
Definition: svdobj.cxx:1812
void Shear(const Point &rRef, double tn, bool bVShear, const SdrObject *pObj)
Definition: svdglue.cxx:383
sdr::ObjectUserVector maObjectUsers
Definition: svdobj.cxx:184
bool IsInDestruction() const
Definition: svdmodel.hxx:589
continuously activated OLE (PlugIn-Frame or similar)
Definition: svdobjkind.hxx:54
OLE object.
Definition: svdobjkind.hxx:47
B2DPolygon simplifyCurveSegments(const B2DPolygon &rCandidate)
SdrObjList * getParentSdrObjListFromSdrObject() const
Definition: svdobj.cxx:299
void InvalidateSdrObject()
Definition: unoshape.cxx:255
virtual void NbcSetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
Definition: svdobj.cxx:2167
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const
Definition: svdobj.cxx:2896
SdrCreateCmd
Definition: svdtypes.hxx:27
helper class for notifying XPropertyChangeListeners
bool IsBigOrtho() const
Definition: svdsnpv.hxx:259
virtual void SetChanged()
Definition: svdobj.cxx:932
TitleText, special text object for StarDraw.
Definition: svdobjkind.hxx:44
rtl::OString toString() const
constexpr TypedWhichId< SdrOnePositionXItem > SDRATTR_ONEPOSITIONX(SDRATTR_NOTPERSIST_FIRST+10)
void SetPrintable(bool bPrn)
Definition: svdobj.cxx:2588
circle arc
Definition: svdobjkind.hxx:33
periodic cubic Spline (ni)
Definition: svdobjkind.hxx:42
constexpr TypedWhichId< XLineColorItem > XATTR_LINECOLOR(XATTR_LINE_FIRST+3)
bool bIsEdge
Definition: svdobj.hxx:896
virtual Point GetPoint(sal_uInt32 i) const
Definition: svdobj.cxx:1683
sal_uInt32 nOrdNum
Definition: svdobj.hxx:957
bool HasSdrObjectOwnership() const
Definition: unoshape.cxx:268
foreign graphic (StarView Graphic)
Definition: svdobjkind.hxx:46
virtual void NbcSetRelativePos(const Point &rPnt)
The relative position of a SdrObject is the distance of the upper left corner of the logic bounding r...
Definition: svdobj.cxx:1555
SdrObjUserCall * GetUserCall() const
Definition: svdobj.hxx:836
virtual SdrObject * getSdrObjectFromSdrObjList() const
Definition: svdpage.cxx:137
virtual OutlinerParaObject * GetOutlinerParaObject() const
Definition: svdobj.cxx:1761
bool bClosedObj
Definition: svdobj.hxx:185
aStr
void SetTitle(const OUString &rStr)
Definition: svdobj.cxx:711
bool mbLineIsOutsideGeometry
Definition: svdobj.hxx:900
Point TopRight() const
virtual void ClearMergedItem(const sal_uInt16 nWhich)
Definition: properties.cxx:93
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const
Polygon dragged by the user when creating the object.
Definition: svdobj.cxx:1360
tools::Long Right() const
const SdrPageView * pPageView
Definition: svdobj.hxx:142
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
Definition: svdobj.cxx:2663
void ApplyNotPersistAttr(const SfxItemSet &rAttr)
Definition: svdobj.cxx:1947
svx::PropertyChangeNotifier & getShapePropertyChangeNotifier()
Definition: unoshape.cxx:331
bool mbDoNotInsertIntoPageAutomatically
Definition: svdobj.hxx:982
::std::vector< B2DPolygon > B2DPolygonVector
SdrObject * ImpConvertToContourObj(bool bForceLineDash)
Definition: svdobj.cxx:2308
constexpr TypedWhichId< SfxStringItem > SDRATTR_OBJECTNAME(SDRATTR_NOTPERSIST_FIRST+5)
sal_Int16 meRelativeHeightRelation
Definition: svdobj.cxx:189
void SetSecondaryPool(SfxItemPool *pPool)
Point Center() const
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
Definition: svdhdl.cxx:2289
custom shape
Definition: svdobjkind.hxx:56
sal_uInt16 GetPageCount() const
Definition: svdmodel.cxx:1916
bool IsMoveProtect() const
Definition: svdobj.hxx:750
virtual void SetObjectItemSet(const SfxItemSet &rSet)=0
sal_uInt16 nPos
Point TopCenter() const
SdrHdlKind GetKind() const
Definition: svdhdl.hxx:194
const double * GetRelativeHeight() const
Definition: svdobj.cxx:525
Utility class SdrEdgeObj.
Definition: svdoedge.hxx:128
virtual sal_uInt32 GetSnapPointCount() const
snap to special points of an Object (polygon points, center of circle)
Definition: svdobj.cxx:1663
sal_Int16 nValue
Definition: fmsrccfg.cxx:81
constexpr TypedWhichId< SdrResizeXOneItem > SDRATTR_RESIZEXONE(SDRATTR_NOTPERSIST_FIRST+20)
const sal_uInt8 R
void NbcRotateGluePoints(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:2238
::std::vector< B2DPolyPolygon > B2DPolyPolygonVector
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:594