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