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