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