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