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 nullptr;
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
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 if (rSet.IsSet(GetLayer()))
653 return true;
654 SdrObjList* pOL=GetSubList();
655 if (!pOL)
656 return false;
657 const size_t nObjCount = pOL->GetObjCount();
658 for (size_t nObjNum = 0; nObjNum<nObjCount; ++nObjNum)
659 if (pOL->GetObj(nObjNum)->isVisibleOnAnyOfTheseLayers(rSet))
660 return true;
661 return false;
662}
663
665{
666 mnLayerID = nLayer;
667}
668
670{
671 NbcSetLayer(nLayer);
672 SetChanged();
674}
675
677{
679 if (m_pPlusData->pBroadcast==nullptr) m_pPlusData->pBroadcast.reset(new SfxBroadcaster);
680
681 // SdrEdgeObj may be connected to same SdrObject on both ends so allow it
682 // to listen twice
683 SdrEdgeObj const*const pEdge(dynamic_cast<SdrEdgeObj const*>(&rListener));
684 rListener.StartListening(*m_pPlusData->pBroadcast, pEdge ? DuplicateHandling::Allow : DuplicateHandling::Unexpected);
685}
686
688{
689 if (m_pPlusData!=nullptr && m_pPlusData->pBroadcast!=nullptr) {
690 rListener.EndListening(*m_pPlusData->pBroadcast);
691 if (!m_pPlusData->pBroadcast->HasListeners()) {
692 m_pPlusData->pBroadcast.reset();
693 }
694 }
695}
696
698{
699 return m_pPlusData!=nullptr ? m_pPlusData->pBroadcast.get() : nullptr;
700}
701
703{
704 AddListener(rVrtObj);
705}
706
708{
709 RemoveListener(rVrtObj);
710}
711
713{
714 return GetSubList()!=nullptr;
715}
716
718{
719 return nullptr;
720}
721
723{
725
726 if(nullptr == pParent)
727 {
728 return nullptr;
729 }
730
731 return pParent->getSdrObjectFromSdrObjList();
732}
733
734void SdrObject::SetName(const OUString& rStr, const bool bSetChanged)
735{
736 if (!rStr.isEmpty() && !m_pPlusData)
737 {
739 }
740
741 if(!(m_pPlusData && m_pPlusData->aObjName != rStr))
742 return;
743
744 // Undo/Redo for setting object's name (#i73249#)
745 bool bUndo( false );
746 if ( getSdrModelFromSdrObject().IsUndoEnabled() )
747 {
748 bUndo = true;
749 std::unique_ptr<SdrUndoAction> pUndoAction =
751 *this,
753 GetName(),
754 rStr );
755 getSdrModelFromSdrObject().BegUndo( pUndoAction->GetComment() );
756 getSdrModelFromSdrObject().AddUndo( std::move(pUndoAction) );
757 }
758 m_pPlusData->aObjName = rStr;
759 // Undo/Redo for setting object's name (#i73249#)
760 if ( bUndo )
761 {
763 }
764 if (bSetChanged)
765 {
766 SetChanged();
768 }
769}
770
771const OUString & SdrObject::GetName() const
772{
773 static const OUString EMPTY = u"";
774
775 if(m_pPlusData)
776 {
777 return m_pPlusData->aObjName;
778 }
779
780 return EMPTY;
781}
782
783void SdrObject::SetTitle(const OUString& rStr)
784{
785 if (!rStr.isEmpty() && !m_pPlusData)
786 {
788 }
789
790 if(!(m_pPlusData && m_pPlusData->aObjTitle != rStr))
791 return;
792
793 // Undo/Redo for setting object's title (#i73249#)
794 bool bUndo( false );
795 if ( getSdrModelFromSdrObject().IsUndoEnabled() )
796 {
797 bUndo = true;
798 std::unique_ptr<SdrUndoAction> pUndoAction =
800 *this,
802 GetTitle(),
803 rStr );
804 getSdrModelFromSdrObject().BegUndo( pUndoAction->GetComment() );
805 getSdrModelFromSdrObject().AddUndo( std::move(pUndoAction) );
806 }
807 m_pPlusData->aObjTitle = rStr;
808 // Undo/Redo for setting object's title (#i73249#)
809 if ( bUndo )
810 {
812 }
813 SetChanged();
815}
816
817OUString SdrObject::GetTitle() const
818{
819 if(m_pPlusData)
820 {
821 return m_pPlusData->aObjTitle;
822 }
823
824 return OUString();
825}
826
827void SdrObject::SetDescription(const OUString& rStr)
828{
829 if (!rStr.isEmpty() && !m_pPlusData)
830 {
832 }
833
834 if(!(m_pPlusData && m_pPlusData->aObjDescription != rStr))
835 return;
836
837 // Undo/Redo for setting object's description (#i73249#)
838 bool bUndo( false );
839 if ( getSdrModelFromSdrObject().IsUndoEnabled() )
840 {
841 bUndo = true;
842 std::unique_ptr<SdrUndoAction> pUndoAction =
844 *this,
847 rStr );
848 getSdrModelFromSdrObject().BegUndo( pUndoAction->GetComment() );
849 getSdrModelFromSdrObject().AddUndo( std::move(pUndoAction) );
850 }
851 m_pPlusData->aObjDescription = rStr;
852 // Undo/Redo for setting object's description (#i73249#)
853 if ( bUndo )
854 {
856 }
857 SetChanged();
859}
860
862{
863 if(m_pPlusData)
864 {
865 return m_pPlusData->aObjDescription;
866 }
867
868 return OUString();
869}
870
871void SdrObject::SetDecorative(bool const isDecorative)
872{
874
875 if (m_pPlusData->isDecorative == isDecorative)
876 {
877 return;
878 }
879
880 if (getSdrModelFromSdrObject().IsUndoEnabled())
881 {
882 std::unique_ptr<SdrUndoAction> pUndoAction(
884 *this, m_pPlusData->isDecorative));
885 getSdrModelFromSdrObject().BegUndo(pUndoAction->GetComment());
886 getSdrModelFromSdrObject().AddUndo(std::move(pUndoAction));
887 }
888
889 m_pPlusData->isDecorative = isDecorative;
890
891 if (getSdrModelFromSdrObject().IsUndoEnabled())
892 {
894 }
895
896 SetChanged();
898}
899
901{
902 return m_pPlusData == nullptr ? false : m_pPlusData->isDecorative;
903}
904
905sal_uInt32 SdrObject::GetOrdNum() const
906{
907 if (SdrObjList* pParentList = getParentSdrObjListFromSdrObject())
908 {
909 if (pParentList->IsObjOrdNumsDirty())
910 {
911 pParentList->RecalcObjOrdNums();
912 }
913 } else const_cast<SdrObject*>(this)->m_nOrdNum=0;
914 return m_nOrdNum;
915}
916
917void SdrObject::SetOrdNum(sal_uInt32 nNum)
918{
919 m_nOrdNum = nNum;
920}
921
922void SdrObject::GetGrabBagItem(css::uno::Any& rVal) const
923{
924 if (m_pGrabBagItem != nullptr)
925 m_pGrabBagItem->QueryValue(rVal);
926 else
927 rVal <<= uno::Sequence<beans::PropertyValue>();
928}
929
930void SdrObject::SetGrabBagItem(const css::uno::Any& rVal)
931{
932 if (m_pGrabBagItem == nullptr)
934
935 m_pGrabBagItem->PutValue(rVal, 0);
936
937 SetChanged();
939}
940
942{
943 if (nullptr != getParentSdrObjListFromSdrObject() && getParentSdrObjListFromSdrObject()->RecalcNavigationPositions())
944 {
946 }
947 else
948 return GetOrdNum();
949}
950
951
952void SdrObject::SetNavigationPosition (const sal_uInt32 nNewPosition)
953{
954 mnNavigationPosition = nNewPosition;
955}
956
957
958// To make clearer that this method may trigger RecalcBoundRect and thus may be
959// expensive and sometimes problematic (inside a bigger object change you will get
960// non-useful BoundRects sometimes) I rename that method from GetBoundRect() to
961// GetCurrentBoundRect().
963{
964 auto const& rRectangle = getOutRectangle();
965 if (rRectangle.IsEmpty())
966 {
967 const_cast< SdrObject* >(this)->RecalcBoundRect();
968 }
969
970 return rRectangle;
971}
972
973// To have a possibility to get the last calculated BoundRect e.g for producing
974// the first rectangle for repaints (old and new need to be used) without forcing
975// a RecalcBoundRect (which may be problematical and expensive sometimes) I add here
976// a new method for accessing the last BoundRect.
978{
979 return getOutRectangle();
980}
981
983{
984 // #i101680# suppress BoundRect calculations on import(s)
986 return;
987
988 auto const& rRectangle = getOutRectangle();
989
990 // central new method which will calculate the BoundRect using primitive geometry
991 if (!rRectangle.IsEmpty())
992 return;
993
994 // Use view-independent data - we do not want any connections
995 // to e.g. GridOffset in SdrObject-level
998
999 if (xPrimitives.empty())
1000 return;
1001
1002 // use neutral ViewInformation and get the range of the primitives
1003 const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
1004 const basegfx::B2DRange aRange(xPrimitives.getB2DRange(aViewInformation2D));
1005
1006 if (!aRange.isEmpty())
1007 {
1008 tools::Rectangle aNewRectangle(
1009 tools::Long(floor(aRange.getMinX())),
1010 tools::Long(floor(aRange.getMinY())),
1011 tools::Long(ceil(aRange.getMaxX())),
1012 tools::Long(ceil(aRange.getMaxY())));
1013 setOutRectangle(aNewRectangle);
1014 return;
1015 }
1016}
1017
1019{
1021 return;
1022
1023 bool bPlusDataBroadcast(m_pPlusData && m_pPlusData->pBroadcast);
1024 bool bObjectChange(IsInserted());
1025
1026 if(!(bPlusDataBroadcast || bObjectChange))
1027 return;
1028
1029 SdrHint aHint(SdrHintKind::ObjectChange, *this);
1030
1031 if(bPlusDataBroadcast)
1032 {
1033 m_pPlusData->pBroadcast->Broadcast(aHint);
1034 }
1035
1036 if(bObjectChange)
1037 {
1039 }
1040}
1041
1043{
1044 // For testing purposes, use the new ViewContact for change
1045 // notification now.
1046 ActionChanged();
1047
1048 // TTTT Need to check meaning/usage of IsInserted in one
1049 // of the next changes. It should not mean to have a SdrModel
1050 // set (this is guaranteed now), but should be connected to
1051 // being added to a SdrPage (?)
1052 // TTTT tdf#120066 Indeed - This triggers e.g. by CustomShape
1053 // geometry-presenting SdrObjects that are in a SdrObjGroup,
1054 // but the SdrObjGroup is *by purpose* not inserted.
1055 // Need to check deeper and maybe identify all ::IsInserted()
1056 // calls by rename and let the compiler work...
1057 if(nullptr != getSdrPageFromSdrObject())
1058 {
1060 }
1061}
1062
1063// tooling for painting a single object to an OutputDevice.
1065{
1066 sdr::contact::SdrObjectVector aObjectVector;
1067 aObjectVector.push_back(const_cast< SdrObject* >(this));
1068
1069 sdr::contact::ObjectContactOfObjListPainter aPainter(rOut, std::move(aObjectVector), getSdrPageFromSdrObject());
1070 sdr::contact::DisplayInfo aDisplayInfo;
1071
1072 aPainter.ProcessDisplay(aDisplayInfo);
1073}
1074
1076{
1077 drawing::LineStyle eXLS = GetMergedItem(XATTR_LINESTYLE).GetValue();
1078 return (eXLS != drawing::LineStyle_NONE);
1079}
1080
1082{
1083 // RotGrfFlyFrame: Default is false, support full rotation
1084 return false;
1085}
1086
1088{
1089 OUString sName(SvxResId(STR_ObjNameSingulNONE));
1090
1091 OUString aName(GetName());
1092 if (!aName.isEmpty())
1093 sName += " '" + aName + "'";
1094 return sName;
1095}
1096
1098{
1099 return SvxResId(STR_ObjNamePluralNONE);
1100}
1101
1103{
1104 OUString aStr = SvxResId(pStrCacheID);
1105 sal_Int32 nPos = aStr.indexOf("%1");
1106 if (nPos >= 0)
1107 {
1108 // Replace '%1' with the object name.
1109 OUString aObjName(TakeObjNameSingul());
1110 aStr = aStr.replaceAt(nPos, 2, aObjName);
1111 }
1112
1113 nPos = aStr.indexOf("%2");
1114 if (nPos >= 0)
1115 // Replace '%2' with the passed value.
1116 aStr = aStr.replaceAt(nPos, 2, u"0");
1117 return aStr;
1118}
1119
1121{
1122 if (!m_pPlusData)
1123 m_pPlusData.reset( new SdrObjPlusData );
1124}
1125
1127{
1129}
1130
1132{
1136
1137 return aRetval;
1138}
1139
1141{
1143
1144 // create cloned object without text, but with drawing::LineStyle_SOLID,
1145 // COL_BLACK as line color and drawing::FillStyle_NONE
1147
1148 if(pClone)
1149 {
1150 const SdrTextObj* pTextObj = DynCastSdrTextObj(this);
1151
1152 if(pTextObj)
1153 {
1154 // no text and no text animation
1155 pClone->SetMergedItem(SdrTextAniKindItem(SdrTextAniKind::NONE));
1156 pClone->SetOutlinerParaObject(std::nullopt);
1157 }
1158
1159 const SdrEdgeObj* pEdgeObj = dynamic_cast< const SdrEdgeObj* >(this);
1160
1161 if(pEdgeObj)
1162 {
1163 // create connections if connector, will be cleaned up when
1164 // deleting the connector again
1165 SdrObject* pLeft = pEdgeObj->GetConnectedNode(true);
1166 SdrObject* pRight = pEdgeObj->GetConnectedNode(false);
1167
1168 if(pLeft)
1169 {
1170 pClone->ConnectToNode(true, pLeft);
1171 }
1172
1173 if(pRight)
1174 {
1175 pClone->ConnectToNode(false, pRight);
1176 }
1177 }
1178
1179 SfxItemSet aNewSet(GetObjectItemPool());
1180
1181 // #i101980# ignore LineWidth; that's what the old implementation
1182 // did. With line width, the result may be huge due to fat/thick
1183 // line decompositions
1184 aNewSet.Put(XLineWidthItem(0));
1185
1186 // solid black lines and no fill
1187 aNewSet.Put(XLineStyleItem(drawing::LineStyle_SOLID));
1188 aNewSet.Put(XLineColorItem(OUString(), COL_BLACK));
1189 aNewSet.Put(XFillStyleItem(drawing::FillStyle_NONE));
1190 pClone->SetMergedItemSet(aNewSet);
1191
1192 // get sequence from clone
1193 const sdr::contact::ViewContact& rVC(pClone->GetViewContact());
1196
1197 if(!xSequence.empty())
1198 {
1199 // use neutral ViewInformation
1200 const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
1201
1202 // create extractor, process and get result (with hairlines as opened polygons)
1203 drawinglayer::processor2d::ContourExtractor2D aExtractor(aViewInformation2D, false);
1204 aExtractor.process(xSequence);
1205 const basegfx::B2DPolyPolygonVector& rResult(aExtractor.getExtractedContour());
1206 const sal_uInt32 nSize(rResult.size());
1207
1208 // when count is one, it is implied that the object has only its normal
1209 // contour anyways and TakeContour() is to return an empty PolyPolygon
1210 // (see old implementation for historical reasons)
1211 if(nSize > 1)
1212 {
1213 // the topology for contour is correctly a vector of PolyPolygons; for
1214 // historical reasons cut it back to a single tools::PolyPolygon here
1215 for(sal_uInt32 a(0); a < nSize; a++)
1216 {
1217 aRetval.append(rResult[a]);
1218 }
1219 }
1220 }
1221 }
1222
1223 return aRetval;
1224}
1225
1226sal_uInt32 SdrObject::GetHdlCount() const
1227{
1228 return 8;
1229}
1230
1232{
1233 const tools::Rectangle& rR=GetSnapRect();
1234 for (sal_uInt32 nHdlNum=0; nHdlNum<8; ++nHdlNum)
1235 {
1236 std::unique_ptr<SdrHdl> pH;
1237 switch (nHdlNum) {
1238 case 0: pH.reset(new SdrHdl(rR.TopLeft(), SdrHdlKind::UpperLeft)); break;
1239 case 1: pH.reset(new SdrHdl(rR.TopCenter(), SdrHdlKind::Upper)); break;
1240 case 2: pH.reset(new SdrHdl(rR.TopRight(), SdrHdlKind::UpperRight)); break;
1241 case 3: pH.reset(new SdrHdl(rR.LeftCenter(), SdrHdlKind::Left )); break;
1242 case 4: pH.reset(new SdrHdl(rR.RightCenter(), SdrHdlKind::Right)); break;
1243 case 5: pH.reset(new SdrHdl(rR.BottomLeft(), SdrHdlKind::LowerLeft)); break;
1244 case 6: pH.reset(new SdrHdl(rR.BottomCenter(),SdrHdlKind::Lower)); break;
1245 case 7: pH.reset(new SdrHdl(rR.BottomRight(), SdrHdlKind::LowerRight)); break;
1246 }
1247 rHdlList.AddHdl(std::move(pH));
1248 }
1249}
1250
1252{
1253}
1254
1256{
1257 // Default implementation, does nothing. Overloaded in
1258 // SdrGrafObj and SwVirtFlyDrawObj
1259}
1260
1262{
1263 tools::Rectangle aTmpRect(GetSnapRect());
1264 tools::Rectangle aRect(aTmpRect);
1265 const SdrHdl* pHdl=rDrag.GetHdl();
1266 SdrHdlKind eHdl=pHdl==nullptr ? SdrHdlKind::Move : pHdl->GetKind();
1268 bool bOrtho=rDrag.GetView()!=nullptr && rDrag.GetView()->IsOrtho();
1269 bool bBigOrtho=bEcke && bOrtho && rDrag.GetView()->IsBigOrtho();
1270 Point aPos(rDrag.GetNow());
1271 bool bLft=(eHdl==SdrHdlKind::UpperLeft || eHdl==SdrHdlKind::Left || eHdl==SdrHdlKind::LowerLeft);
1272 bool bRgt=(eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::Right || eHdl==SdrHdlKind::LowerRight);
1273 bool bTop=(eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::Upper || eHdl==SdrHdlKind::UpperLeft);
1274 bool bBtm=(eHdl==SdrHdlKind::LowerRight || eHdl==SdrHdlKind::Lower || eHdl==SdrHdlKind::LowerLeft);
1275 if (bLft) aTmpRect.SetLeft(aPos.X() );
1276 if (bRgt) aTmpRect.SetRight(aPos.X() );
1277 if (bTop) aTmpRect.SetTop(aPos.Y() );
1278 if (bBtm) aTmpRect.SetBottom(aPos.Y() );
1279 if (bOrtho) { // Ortho
1280 tools::Long nWdt0=aRect.Right() -aRect.Left();
1281 tools::Long nHgt0=aRect.Bottom()-aRect.Top();
1282 tools::Long nXMul=aTmpRect.Right() -aTmpRect.Left();
1283 tools::Long nYMul=aTmpRect.Bottom()-aTmpRect.Top();
1284 tools::Long nXDiv=nWdt0;
1285 tools::Long nYDiv=nHgt0;
1286 bool bXNeg=(nXMul<0)!=(nXDiv<0);
1287 bool bYNeg=(nYMul<0)!=(nYDiv<0);
1288 nXMul=std::abs(nXMul);
1289 nYMul=std::abs(nYMul);
1290 nXDiv=std::abs(nXDiv);
1291 nYDiv=std::abs(nYDiv);
1292 Fraction aXFact(nXMul,nXDiv); // fractions for canceling
1293 Fraction aYFact(nYMul,nYDiv); // and for comparing
1294 nXMul=aXFact.GetNumerator();
1295 nYMul=aYFact.GetNumerator();
1296 nXDiv=aXFact.GetDenominator();
1297 nYDiv=aYFact.GetDenominator();
1298 if (bEcke) { // corner point handles
1299 bool bUseX=(aXFact<aYFact) != bBigOrtho;
1300 if (bUseX) {
1301 tools::Long nNeed=tools::Long(BigInt(nHgt0)*BigInt(nXMul)/BigInt(nXDiv));
1302 if (bYNeg) nNeed=-nNeed;
1303 if (bTop) aTmpRect.SetTop(aTmpRect.Bottom()-nNeed );
1304 if (bBtm) aTmpRect.SetBottom(aTmpRect.Top()+nNeed );
1305 } else {
1306 tools::Long nNeed=tools::Long(BigInt(nWdt0)*BigInt(nYMul)/BigInt(nYDiv));
1307 if (bXNeg) nNeed=-nNeed;
1308 if (bLft) aTmpRect.SetLeft(aTmpRect.Right()-nNeed );
1309 if (bRgt) aTmpRect.SetRight(aTmpRect.Left()+nNeed );
1310 }
1311 } else { // apex handles
1312 if ((bLft || bRgt) && nXDiv!=0) {
1313 tools::Long nHgt0b=aRect.Bottom()-aRect.Top();
1314 tools::Long nNeed=tools::Long(BigInt(nHgt0b)*BigInt(nXMul)/BigInt(nXDiv));
1315 aTmpRect.AdjustTop( -((nNeed-nHgt0b)/2) );
1316 aTmpRect.SetBottom(aTmpRect.Top()+nNeed );
1317 }
1318 if ((bTop || bBtm) && nYDiv!=0) {
1319 tools::Long nWdt0b=aRect.Right()-aRect.Left();
1320 tools::Long nNeed=tools::Long(BigInt(nWdt0b)*BigInt(nYMul)/BigInt(nYDiv));
1321 aTmpRect.AdjustLeft( -((nNeed-nWdt0b)/2) );
1322 aTmpRect.SetRight(aTmpRect.Left()+nNeed );
1323 }
1324 }
1325 }
1326 aTmpRect.Normalize();
1327 return aTmpRect;
1328}
1329
1330
1332{
1333 return false;
1334}
1335
1337{
1338 return true;
1339}
1340
1342{
1343 // default uses simple clone
1345}
1346
1348{
1349 const SdrHdl* pHdl = rDrag.GetHdl();
1350
1351 SdrHdlKind eHdl = (pHdl == nullptr) ? SdrHdlKind::Move : pHdl->GetKind();
1352
1353 return eHdl==SdrHdlKind::UpperLeft || eHdl==SdrHdlKind::Upper || eHdl==SdrHdlKind::UpperRight ||
1356}
1357
1359{
1360 tools::Rectangle aNewRect(ImpDragCalcRect(rDrag));
1361
1362 if(aNewRect != GetSnapRect())
1363 {
1364 NbcSetSnapRect(aNewRect);
1365 }
1366
1367 return true;
1368}
1369
1370OUString SdrObject::getSpecialDragComment(const SdrDragStat& /*rDrag*/) const
1371{
1372 return OUString();
1373}
1374
1376{
1377 // default has nothing to add
1378 return basegfx::B2DPolyPolygon();
1379}
1380
1381
1382// Create
1384{
1385 rStat.SetOrtho4Possible();
1386 tools::Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
1387 aRect1.Normalize();
1388 rStat.SetActionRect(aRect1);
1389 setOutRectangle(aRect1);
1390 return true;
1391}
1392
1394{
1395 tools::Rectangle aRectangle;
1396 rStat.TakeCreateRect(aRectangle);
1397 rStat.SetActionRect(aRectangle);
1398 aRectangle.Normalize();
1399 setOutRectangle(aRectangle);
1400 return true;
1401}
1402
1404{
1405 tools::Rectangle aRectangle;
1406 rStat.TakeCreateRect(aRectangle);
1407 aRectangle.Normalize();
1408 setOutRectangle(aRectangle);
1409
1410 return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
1411}
1412
1414{
1415}
1416
1418{
1419 return false;
1420}
1421
1423{
1424 tools::Rectangle aRect1;
1425 rDrag.TakeCreateRect(aRect1);
1426 aRect1.Normalize();
1427
1430 return aRetval;
1431}
1432
1434{
1435 return PointerStyle::Cross;
1436}
1437
1438// transformations
1439void SdrObject::NbcMove(const Size& rSize)
1440{
1441 moveOutRectangle(rSize.Width(), rSize.Height());
1443}
1444
1445void SdrObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
1446{
1447 bool bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
1448 bool bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
1449 if (bXMirr || bYMirr) {
1450 Point aRef1(GetSnapRect().Center());
1451 if (bXMirr) {
1452 Point aRef2(aRef1);
1453 aRef2.AdjustY( 1 );
1454 NbcMirrorGluePoints(aRef1,aRef2);
1455 }
1456 if (bYMirr) {
1457 Point aRef2(aRef1);
1458 aRef2.AdjustX( 1 );
1459 NbcMirrorGluePoints(aRef1,aRef2);
1460 }
1461 }
1462 auto aRectangle = getOutRectangle();
1463 ResizeRect(aRectangle, rRef, xFact, yFact);
1464 setOutRectangle(aRectangle);
1465
1467}
1468
1469void SdrObject::NbcRotate(const Point& rRef, Degree100 nAngle)
1470{
1471 if (nAngle)
1472 {
1473 double a = toRadians(nAngle);
1474 NbcRotate( rRef, nAngle, sin( a ), cos( a ) );
1475 }
1476}
1477
1478namespace
1479{
1480tools::Rectangle lclMirrorRectangle(tools::Rectangle const& rRectangle, Point const& rRef1, Point const& rRef2)
1481{
1482 tools::Rectangle aRectangle(rRectangle);
1483 aRectangle.Move(-rRef1.X(),-rRef1.Y());
1484 tools::Rectangle R(aRectangle);
1485 tools::Long dx=rRef2.X()-rRef1.X();
1486 tools::Long dy=rRef2.Y()-rRef1.Y();
1487 if (dx==0) { // vertical axis
1488 aRectangle.SetLeft(-R.Right() );
1489 aRectangle.SetRight(-R.Left() );
1490 } else if (dy==0) { // horizontal axis
1491 aRectangle.SetTop(-R.Bottom() );
1492 aRectangle.SetBottom(-R.Top() );
1493 } else if (dx==dy) { // 45deg axis
1494 aRectangle.SetLeft(R.Top() );
1495 aRectangle.SetRight(R.Bottom() );
1496 aRectangle.SetTop(R.Left() );
1497 aRectangle.SetBottom(R.Right() );
1498 } else if (dx==-dy) { // 45deg axis
1499 aRectangle.SetLeft(-R.Bottom() );
1500 aRectangle.SetRight(-R.Top() );
1501 aRectangle.SetTop(-R.Right() );
1502 aRectangle.SetBottom(-R.Left() );
1503 }
1504 aRectangle.Move(rRef1.X(),rRef1.Y());
1505 aRectangle.Normalize(); // just in case
1506 return aRectangle;
1507}
1508
1509} // end anonymous namespace
1510
1511void SdrObject::NbcMirror(const Point& rRef1, const Point& rRef2)
1512{
1514
1515 tools::Rectangle aRectangle = getOutRectangle();
1516 aRectangle = lclMirrorRectangle(aRectangle, rRef1, rRef2);
1517 setOutRectangle(aRectangle);
1518
1520 NbcMirrorGluePoints(rRef1,rRef2);
1521 SetGlueReallyAbsolute(false);
1522}
1523
1524void SdrObject::NbcShear(const Point& rRef, Degree100 /*nAngle*/, double tn, bool bVShear)
1525{
1527 NbcShearGluePoints(rRef,tn,bVShear);
1528 SetGlueReallyAbsolute(false);
1529}
1530
1531void SdrObject::Move(const Size& rSiz)
1532{
1533 if (rSiz.Width()!=0 || rSiz.Height()!=0) {
1534 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1535 NbcMove(rSiz);
1536 SetChanged();
1539 }
1540}
1541
1542void SdrObject::NbcCrop(const basegfx::B2DPoint& /*aRef*/, double /*fxFact*/, double /*fyFact*/)
1543{
1544 // Default: does nothing. Real behaviour in SwVirtFlyDrawObj and SdrDragCrop::EndSdrDrag.
1545 // Where SwVirtFlyDrawObj is the only real user of it to do something local
1546}
1547
1548void SdrObject::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative)
1549{
1550 if (xFact.GetNumerator() == xFact.GetDenominator() && yFact.GetNumerator() == yFact.GetDenominator())
1551 return;
1552
1553 if (bUnsetRelative)
1554 {
1555 mpImpl->mnRelativeWidth.reset();
1556 mpImpl->meRelativeWidthRelation = text::RelOrientation::PAGE_FRAME;
1557 mpImpl->meRelativeHeightRelation = text::RelOrientation::PAGE_FRAME;
1558 mpImpl->mnRelativeHeight.reset();
1559 }
1560 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1561 NbcResize(rRef,xFact,yFact);
1562 SetChanged();
1565}
1566
1567void SdrObject::Crop(const basegfx::B2DPoint& rRef, double fxFact, double fyFact)
1568{
1569 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1570 NbcCrop(rRef, fxFact, fyFact);
1571 SetChanged();
1574}
1575
1576void SdrObject::Rotate(const Point& rRef, Degree100 nAngle, double sn, double cs)
1577{
1578 if (nAngle) {
1579 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1580 NbcRotate(rRef,nAngle,sn,cs);
1581 SetChanged();
1584 }
1585}
1586
1587void SdrObject::Mirror(const Point& rRef1, const Point& rRef2)
1588{
1589 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1590 NbcMirror(rRef1,rRef2);
1591 SetChanged();
1594}
1595
1596void SdrObject::Shear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear)
1597{
1598 if (nAngle) {
1599 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1600 NbcShear(rRef,nAngle,tn,bVShear);
1601 SetChanged();
1604 }
1605}
1606
1608{
1609 Point aRelPos0(GetSnapRect().TopLeft()-m_aAnchor);
1610 Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
1611 NbcMove(aSiz); // This also calls SetRectsDirty()
1612}
1613
1615{
1616 if (rPnt!=GetRelativePos()) {
1617 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1618 NbcSetRelativePos(rPnt);
1619 SetChanged();
1622 }
1623}
1624
1626{
1627 return GetSnapRect().TopLeft()-m_aAnchor;
1628}
1629
1631{
1632 m_aAnchor = rPnt;
1633}
1634
1636{
1637 Size aSiz(rPnt.X()-m_aAnchor.X(),rPnt.Y()-m_aAnchor.Y());
1638 m_aAnchor=rPnt;
1639 NbcMove(aSiz); // This also calls SetRectsDirty()
1640}
1641
1643{
1644 if (rPnt!=m_aAnchor) {
1645 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1646 NbcSetAnchorPos(rPnt);
1647 SetChanged();
1650 }
1651}
1652
1654{
1655 return m_aAnchor;
1656}
1657
1659{
1660}
1661
1663{
1664 return getOutRectangle();
1665}
1666
1668{
1669 setOutRectangle(rRect);
1670}
1671
1673{
1674 return GetSnapRect();
1675}
1676
1678{
1679 NbcSetSnapRect(rRect);
1680}
1681
1682void SdrObject::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool /* bShrinkOnly = false */ )
1683{
1684 SetLogicRect( rMaxRect );
1685}
1686
1688{
1689 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1690 NbcSetSnapRect(rRect);
1691 SetChanged();
1694}
1695
1697{
1698 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1699 NbcSetLogicRect(rRect);
1700 SetChanged();
1703}
1704
1706{
1707 return 0_deg100;
1708}
1709
1710Degree100 SdrObject::GetShearAngle(bool /*bVertical*/) const
1711{
1712 return 0_deg100;
1713}
1714
1716{
1717 return GetPointCount();
1718}
1719
1721{
1722 return GetPoint(i);
1723}
1724
1726{
1727 return false;
1728}
1729
1731{
1732 return 0;
1733}
1734
1735Point SdrObject::GetPoint(sal_uInt32 /*i*/) const
1736{
1737 return Point();
1738}
1739
1740void SdrObject::SetPoint(const Point& rPnt, sal_uInt32 i)
1741{
1742 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1743 NbcSetPoint(rPnt, i);
1744 SetChanged();
1747}
1748
1749void SdrObject::NbcSetPoint(const Point& /*rPnt*/, sal_uInt32 /*i*/)
1750{
1751}
1752
1754{
1755 return false;
1756}
1757
1758bool SdrObject::Equals(const SdrObject& rOtherObj) const
1759{
1760 return (m_aAnchor.X() == rOtherObj.m_aAnchor.X() && m_aAnchor.Y() == rOtherObj.m_aAnchor.Y() &&
1761 m_nOrdNum == rOtherObj.m_nOrdNum && mnNavigationPosition == rOtherObj.mnNavigationPosition &&
1764 m_bIs3DObj == rOtherObj.m_bIs3DObj && m_bIsEdge == rOtherObj.m_bIsEdge && m_bClosedObj == rOtherObj.m_bClosedObj &&
1766 mbVisible == rOtherObj.mbVisible && m_bNoPrint == rOtherObj.m_bNoPrint && m_bSizProt == rOtherObj.m_bSizProt &&
1767 m_bMovProt == rOtherObj.m_bMovProt && m_bVirtObj == rOtherObj.m_bVirtObj &&
1768 mnLayerID == rOtherObj.mnLayerID && GetMergedItemSet().Equals(rOtherObj.GetMergedItemSet(), false) );
1769}
1770
1772{
1773 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SdrObject"));
1774 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
1775 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s", BAD_CAST(typeid(*this).name()));
1776 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("name"), "%s", BAD_CAST(GetName().toUtf8().getStr()));
1777 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("title"), "%s", BAD_CAST(GetTitle().toUtf8().getStr()));
1778 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("description"), "%s", BAD_CAST(GetDescription().toUtf8().getStr()));
1779 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("nOrdNum"), "%" SAL_PRIuUINT32, GetOrdNumDirect());
1780 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("aOutRect"), BAD_CAST(getOutRectangle().toString().getStr()));
1781
1782 if (m_pGrabBagItem)
1783 {
1784 m_pGrabBagItem->dumpAsXml(pWriter);
1785 }
1786
1787 if (mpProperties)
1788 {
1789 mpProperties->dumpAsXml(pWriter);
1790 }
1791
1792 if (const OutlinerParaObject* pOutliner = GetOutlinerParaObject())
1793 pOutliner->dumpAsXml(pWriter);
1794
1795 (void)xmlTextWriterEndElement(pWriter);
1796}
1797
1799{
1800 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1801 NbcSetOutlinerParaObject(std::move(pTextObject));
1802 SetChanged();
1804 if (GetCurrentBoundRect()!=aBoundRect0) {
1806 }
1807
1808 if (!getSdrModelFromSdrObject().IsUndoEnabled())
1809 return;
1810
1811 // Don't do this during import.
1812 SdrObject* pTopGroupObj = nullptr;
1814 {
1815 pTopGroupObj = getParentSdrObjectFromSdrObject();
1816 while (pTopGroupObj->getParentSdrObjectFromSdrObject())
1817 {
1818 pTopGroupObj = pTopGroupObj->getParentSdrObjectFromSdrObject();
1819 }
1820 }
1821 if (pTopGroupObj)
1822 {
1823 // A shape was modified, which is in a group shape. Empty the group shape's grab-bag,
1824 // which potentially contains the old text of the shapes in case of diagrams.
1825 pTopGroupObj->SetGrabBagItem(uno::Any(uno::Sequence<beans::PropertyValue>()));
1826 }
1827}
1828
1830{
1831}
1832
1834{
1835 return nullptr;
1836}
1837
1839{
1840}
1841
1843{
1845}
1846
1848{
1849 return false;
1850}
1851
1853{
1854 if(rRec.pPageView)
1855 {
1856 return SdrObjectPrimitiveHit(*this, rRec.aPos, {static_cast<double>(rRec.nTol), static_cast<double>(rRec.nTol)}, *rRec.pPageView, rRec.pVisiLayer, false);
1857 }
1858
1859 return nullptr;
1860}
1861
1863{
1864 return PointerStyle::RefHand;
1865}
1866
1868{
1869 const RasterOp eRop(rOut.GetRasterOp());
1870 const basegfx::B2DPolyPolygon aPolyPolygon(TakeXorPoly());
1871
1872 rOut.SetLineColor(COL_BLACK);
1873 rOut.SetFillColor();
1874 rOut.SetRasterOp(RasterOp::Invert);
1875
1876 for(auto const& rPolygon : aPolyPolygon)
1877 {
1878 rOut.DrawPolyLine(rPolygon);
1879 }
1880
1881 rOut.SetRasterOp(eRop);
1882}
1883
1885{
1886 return false;
1887}
1888
1890{
1891 return CheckMacroHit(rRec) != nullptr;
1892}
1893
1894
1895std::unique_ptr<SdrObjGeoData> SdrObject::NewGeoData() const
1896{
1897 return std::make_unique<SdrObjGeoData>();
1898}
1899
1901{
1903 rGeo.aAnchor =m_aAnchor ;
1904 rGeo.bMovProt =m_bMovProt ;
1905 rGeo.bSizProt =m_bSizProt ;
1906 rGeo.bNoPrint =m_bNoPrint ;
1907 rGeo.mbVisible =mbVisible ;
1908 rGeo.bClosedObj =m_bClosedObj ;
1909 rGeo.mnLayerID = mnLayerID;
1910
1911 // user-defined gluepoints
1912 if (m_pPlusData!=nullptr && m_pPlusData->pGluePoints!=nullptr) {
1913 if (rGeo.pGPL!=nullptr) {
1914 *rGeo.pGPL=*m_pPlusData->pGluePoints;
1915 } else {
1916 rGeo.pGPL.reset( new SdrGluePointList(*m_pPlusData->pGluePoints) );
1917 }
1918 } else {
1919 rGeo.pGPL.reset();
1920 }
1921}
1922
1924{
1927 m_aAnchor =rGeo.aAnchor ;
1928 m_bMovProt =rGeo.bMovProt ;
1929 m_bSizProt =rGeo.bSizProt ;
1930 m_bNoPrint =rGeo.bNoPrint ;
1931 mbVisible =rGeo.mbVisible ;
1932 m_bClosedObj =rGeo.bClosedObj ;
1933 mnLayerID = rGeo.mnLayerID;
1934
1935 // user-defined gluepoints
1936 if (rGeo.pGPL!=nullptr) {
1938 if (m_pPlusData->pGluePoints!=nullptr) {
1939 *m_pPlusData->pGluePoints=*rGeo.pGPL;
1940 } else {
1941 m_pPlusData->pGluePoints.reset(new SdrGluePointList(*rGeo.pGPL));
1942 }
1943 } else {
1944 if (m_pPlusData!=nullptr && m_pPlusData->pGluePoints!=nullptr) {
1945 m_pPlusData->pGluePoints.reset();
1946 }
1947 }
1948}
1949
1950std::unique_ptr<SdrObjGeoData> SdrObject::GetGeoData() const
1951{
1952 std::unique_ptr<SdrObjGeoData> pGeo = NewGeoData();
1953 SaveGeoData(*pGeo);
1954 return pGeo;
1955}
1956
1958{
1959 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
1960 RestoreGeoData(rGeo);
1961 SetChanged();
1964}
1965
1966
1967// ItemSet access
1968
1970{
1972}
1973
1975{
1977}
1978
1980{
1982}
1983
1985{
1987}
1988
1989void SdrObject::ClearMergedItem(const sal_uInt16 nWhich)
1990{
1992}
1993
1995{
1997}
1998
1999void SdrObject::SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems)
2000{
2001 GetProperties().SetMergedItemSet(rSet, bClearAllItems);
2002}
2003
2004const SfxPoolItem& SdrObject::GetObjectItem(const sal_uInt16 nWhich) const
2005{
2006 return GetObjectItemSet().Get(nWhich);
2007}
2008
2009const SfxPoolItem& SdrObject::GetMergedItem(const sal_uInt16 nWhich) const
2010{
2011 return GetMergedItemSet().Get(nWhich);
2012}
2013
2014void SdrObject::SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, bool bClearAllItems)
2015{
2017}
2018
2020{
2021 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
2023 SetChanged();
2026}
2027
2029{
2030 const tools::Rectangle& rSnap=GetSnapRect();
2031 const tools::Rectangle& rLogic=GetLogicRect();
2032 Point aRef1(rSnap.Center());
2033
2034 if (const SdrTransformRef1XItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_TRANSFORMREF1X))
2035 {
2036 aRef1.setX(pPoolItem->GetValue() );
2037 }
2038 if (const SdrTransformRef1YItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_TRANSFORMREF1Y))
2039 {
2040 aRef1.setY(pPoolItem->GetValue() );
2041 }
2042
2043 tools::Rectangle aNewSnap(rSnap);
2044 if (const SdrMoveXItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_MOVEX))
2045 {
2046 tools::Long n = pPoolItem->GetValue();
2047 aNewSnap.Move(n,0);
2048 }
2049 if (const SdrMoveYItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_MOVEY))
2050 {
2051 tools::Long n = pPoolItem->GetValue();
2052 aNewSnap.Move(0,n);
2053 }
2054 if (const SdrOnePositionXItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_ONEPOSITIONX))
2055 {
2056 tools::Long n = pPoolItem->GetValue();
2057 aNewSnap.Move(n-aNewSnap.Left(),0);
2058 }
2059 if (const SdrOnePositionYItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_ONEPOSITIONY))
2060 {
2061 tools::Long n = pPoolItem->GetValue();
2062 aNewSnap.Move(0,n-aNewSnap.Top());
2063 }
2064 if (const SdrOneSizeWidthItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_ONESIZEWIDTH))
2065 {
2066 tools::Long n = pPoolItem->GetValue();
2067 aNewSnap.SetRight(aNewSnap.Left()+n );
2068 }
2069 if (const SdrOneSizeHeightItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_ONESIZEHEIGHT))
2070 {
2071 tools::Long n = pPoolItem->GetValue();
2072 aNewSnap.SetBottom(aNewSnap.Top()+n );
2073 }
2074 if (aNewSnap!=rSnap) {
2075 if (aNewSnap.GetSize()==rSnap.GetSize()) {
2076 NbcMove(Size(aNewSnap.Left()-rSnap.Left(),aNewSnap.Top()-rSnap.Top()));
2077 } else {
2078 NbcSetSnapRect(aNewSnap);
2079 }
2080 }
2081
2082 if (const SdrShearAngleItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_SHEARANGLE))
2083 {
2084 Degree100 n = pPoolItem->GetValue();
2085 n-=GetShearAngle();
2086 if (n) {
2087 double nTan = tan(toRadians(n));
2088 NbcShear(aRef1,n,nTan,false);
2089 }
2090 }
2091 if (const SdrAngleItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_ROTATEANGLE))
2092 {
2093 Degree100 n = pPoolItem->GetValue();
2094 n-=GetRotateAngle();
2095 if (n) {
2096 NbcRotate(aRef1,n);
2097 }
2098 }
2099 if (const SdrRotateOneItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_ROTATEONE))
2100 {
2101 Degree100 n = pPoolItem->GetValue();
2102 NbcRotate(aRef1,n);
2103 }
2104 if (const SdrHorzShearOneItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_HORZSHEARONE))
2105 {
2106 Degree100 n = pPoolItem->GetValue();
2107 double nTan = tan(toRadians(n));
2108 NbcShear(aRef1,n,nTan,false);
2109 }
2110 if (const SdrVertShearOneItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_VERTSHEARONE))
2111 {
2112 Degree100 n = pPoolItem->GetValue();
2113 double nTan = tan(toRadians(n));
2114 NbcShear(aRef1,n,nTan,true);
2115 }
2116
2117 if (const SdrYesNoItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_OBJMOVEPROTECT))
2118 {
2119 bool b = pPoolItem->GetValue();
2120 SetMoveProtect(b);
2121 }
2122 if (const SdrYesNoItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_OBJSIZEPROTECT))
2123 {
2124 bool b = pPoolItem->GetValue();
2126 }
2127
2128 /* move protect always sets size protect */
2129 if( IsMoveProtect() )
2130 SetResizeProtect( true );
2131
2132 if (const SdrObjPrintableItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_OBJPRINTABLE))
2133 {
2134 bool b = pPoolItem->GetValue();
2135 SetPrintable(b);
2136 }
2137
2138 if (const SdrObjVisibleItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_OBJVISIBLE))
2139 {
2140 bool b = pPoolItem->GetValue();
2141 SetVisible(b);
2142 }
2143
2145 if (const SdrLayerIdItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_LAYERID))
2146 {
2147 nLayer = pPoolItem->GetValue();
2148 }
2149 if (const SdrLayerNameItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_LAYERNAME))
2150 {
2151 OUString aLayerName = pPoolItem->GetValue();
2152 const SdrLayerAdmin& rLayAd(nullptr != getSdrPageFromSdrObject()
2153 ? getSdrPageFromSdrObject()->GetLayerAdmin()
2154 : getSdrModelFromSdrObject().GetLayerAdmin());
2155 const SdrLayer* pLayer = rLayAd.GetLayer(aLayerName);
2156
2157 if(nullptr != pLayer)
2158 {
2159 nLayer=pLayer->GetID();
2160 }
2161 }
2162 if (nLayer!=SDRLAYER_NOTFOUND) {
2163 NbcSetLayer(nLayer);
2164 }
2165
2166 if (const SfxStringItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_OBJECTNAME))
2167 {
2168 OUString aName = pPoolItem->GetValue();
2169 SetName(aName);
2170 }
2171 tools::Rectangle aNewLogic(rLogic);
2172 if (const SdrLogicSizeWidthItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_LOGICSIZEWIDTH))
2173 {
2174 tools::Long n = pPoolItem->GetValue();
2175 aNewLogic.SetRight(aNewLogic.Left()+n );
2176 }
2177 if (const SdrLogicSizeHeightItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_LOGICSIZEHEIGHT))
2178 {
2179 tools::Long n = pPoolItem->GetValue();
2180 aNewLogic.SetBottom(aNewLogic.Top()+n );
2181 }
2182 if (aNewLogic!=rLogic) {
2183 NbcSetLogicRect(aNewLogic);
2184 }
2185 Fraction aResizeX(1,1);
2186 Fraction aResizeY(1,1);
2187 if (const SdrResizeXOneItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_RESIZEXONE))
2188 {
2189 aResizeX *= pPoolItem->GetValue();
2190 }
2191 if (const SdrResizeYOneItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_RESIZEYONE))
2192 {
2193 aResizeY *= pPoolItem->GetValue();
2194 }
2195 if (aResizeX!=Fraction(1,1) || aResizeY!=Fraction(1,1)) {
2196 NbcResize(aRef1,aResizeX,aResizeY);
2197 }
2198}
2199
2201{
2202 const tools::Rectangle& rSnap=GetSnapRect();
2203 const tools::Rectangle& rLogic=GetLogicRect();
2210 rAttr.Put(SdrOneSizeWidthItem(rSnap.GetWidth()-1));
2211 rAttr.Put(SdrOneSizeHeightItem(rSnap.GetHeight()-1));
2212 rAttr.Put(SdrOnePositionXItem(rSnap.Left()));
2213 rAttr.Put(SdrOnePositionYItem(rSnap.Top()));
2214 if (rLogic.GetWidth()!=rSnap.GetWidth()) {
2215 rAttr.Put(SdrLogicSizeWidthItem(rLogic.GetWidth()-1));
2216 }
2217 if (rLogic.GetHeight()!=rSnap.GetHeight()) {
2218 rAttr.Put(SdrLogicSizeHeightItem(rLogic.GetHeight()-1));
2219 }
2220 OUString aName(GetName());
2221
2222 if (!aName.isEmpty())
2223 {
2225 }
2226
2227 rAttr.Put(SdrLayerIdItem(GetLayer()));
2228 const SdrLayerAdmin& rLayAd(nullptr != getSdrPageFromSdrObject()
2229 ? getSdrPageFromSdrObject()->GetLayerAdmin()
2230 : getSdrModelFromSdrObject().GetLayerAdmin());
2231 const SdrLayer* pLayer = rLayAd.GetLayerPerID(GetLayer());
2232 if(nullptr != pLayer)
2233 {
2234 rAttr.Put(SdrLayerNameItem(pLayer->GetName()));
2235 }
2236 Point aRef1(rSnap.Center());
2237 Point aRef2(aRef1); aRef2.AdjustY( 1 );
2238 rAttr.Put(SdrTransformRef1XItem(aRef1.X()));
2239 rAttr.Put(SdrTransformRef1YItem(aRef1.Y()));
2240 rAttr.Put(SdrTransformRef2XItem(aRef2.X()));
2241 rAttr.Put(SdrTransformRef2YItem(aRef2.Y()));
2242}
2243
2245{
2246 return GetProperties().GetStyleSheet();
2247}
2248
2249void SdrObject::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
2250{
2251 tools::Rectangle aBoundRect0;
2252
2253 if(m_pUserCall)
2254 aBoundRect0 = GetLastBoundRect();
2255
2256 InternalSetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr, true);
2257 SetChanged();
2260}
2261
2262void SdrObject::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
2263{
2264 InternalSetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr, false);
2265}
2266
2267void SdrObject::InternalSetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast)
2268{
2269 GetProperties().SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr, bBroadcast);
2270}
2271
2272// Broadcasting while setting attributes is managed by the AttrObj.
2273
2274
2276{
2277 // #i41936# Use SnapRect for default GluePoints
2278 const tools::Rectangle aR(GetSnapRect());
2279 Point aPt;
2280
2281 switch(nPosNum)
2282 {
2283 case 0 : aPt = aR.TopCenter(); break;
2284 case 1 : aPt = aR.RightCenter(); break;
2285 case 2 : aPt = aR.BottomCenter(); break;
2286 case 3 : aPt = aR.LeftCenter(); break;
2287 }
2288
2289 aPt -= aR.Center();
2290 SdrGluePoint aGP(aPt);
2291 aGP.SetPercent(false);
2292
2293 return aGP;
2294}
2295
2297{
2299 Point aPt;
2300 switch (nPosNum) {
2301 case 0 : aPt=aR.TopLeft(); break;
2302 case 1 : aPt=aR.TopRight(); break;
2303 case 2 : aPt=aR.BottomRight(); break;
2304 case 3 : aPt=aR.BottomLeft(); break;
2305 }
2306 aPt-=GetSnapRect().Center();
2307 SdrGluePoint aGP(aPt);
2308 aGP.SetPercent(false);
2309 return aGP;
2310}
2311
2313{
2314 if (m_pPlusData!=nullptr) return m_pPlusData->pGluePoints.get();
2315 return nullptr;
2316}
2317
2318
2320{
2322 if (m_pPlusData->pGluePoints==nullptr) {
2323 m_pPlusData->pGluePoints.reset(new SdrGluePointList);
2324 }
2325 return m_pPlusData->pGluePoints.get();
2326}
2327
2329{
2330 // First a const call to see whether there are any gluepoints.
2331 // Force const call!
2332 if (GetGluePointList()!=nullptr) {
2334 pGPL->SetReallyAbsolute(bOn,*this);
2335 }
2336}
2337
2338void SdrObject::NbcRotateGluePoints(const Point& rRef, Degree100 nAngle, double sn, double cs)
2339{
2340 // First a const call to see whether there are any gluepoints.
2341 // Force const call!
2342 if (GetGluePointList()!=nullptr) {
2344 pGPL->Rotate(rRef,nAngle,sn,cs,this);
2345 }
2346}
2347
2348void SdrObject::NbcMirrorGluePoints(const Point& rRef1, const Point& rRef2)
2349{
2350 // First a const call to see whether there are any gluepoints.
2351 // Force const call!
2352 if (GetGluePointList()!=nullptr) {
2354 pGPL->Mirror(rRef1,rRef2,this);
2355 }
2356}
2357
2358void SdrObject::NbcShearGluePoints(const Point& rRef, double tn, bool bVShear)
2359{
2360 // First a const call to see whether there are any gluepoints.
2361 // Force const call!
2362 if (GetGluePointList()!=nullptr) {
2364 pGPL->Shear(rRef,tn,bVShear,this);
2365 }
2366}
2367
2368void SdrObject::ConnectToNode(bool /*bTail1*/, SdrObject* /*pObj*/)
2369{
2370}
2371
2373{
2374}
2375
2377{
2378 return nullptr;
2379}
2380
2381
2384 basegfx::B2DPolygonVector& rExtractedHairlines,
2385 basegfx::B2DPolyPolygonVector& rExtractedLineFills)
2386{
2387 rExtractedHairlines.clear();
2388 rExtractedLineFills.clear();
2389
2390 if(rxSequence.empty())
2391 return;
2392
2393 // use neutral ViewInformation
2394 const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
2395
2396 // create extractor, process and get result
2397 drawinglayer::processor2d::LineGeometryExtractor2D aExtractor(aViewInformation2D);
2398 aExtractor.process(rxSequence);
2399
2400 // copy line results
2401 rExtractedHairlines = aExtractor.getExtractedHairlines();
2402
2403 // copy fill rsults
2404 rExtractedLineFills = aExtractor.getExtractedLineFills();
2405}
2406
2407
2409{
2411
2413 {
2414 basegfx::B2DPolyPolygon aMergedLineFillPolyPolygon;
2415 basegfx::B2DPolyPolygon aMergedHairlinePolyPolygon;
2418
2419 if(!xSequence.empty())
2420 {
2421 basegfx::B2DPolygonVector aExtractedHairlines;
2422 basegfx::B2DPolyPolygonVector aExtractedLineFills;
2423
2424 extractLineContourFromPrimitive2DSequence(xSequence, aExtractedHairlines, aExtractedLineFills);
2425
2426 // for SdrObject creation, just copy all to a single Hairline-PolyPolygon
2427 for(const basegfx::B2DPolygon & rExtractedHairline : aExtractedHairlines)
2428 {
2429 aMergedHairlinePolyPolygon.append(rExtractedHairline);
2430 }
2431
2432 // check for fill rsults
2433 if (!aExtractedLineFills.empty() && !utl::ConfigManager::IsFuzzing())
2434 {
2435 // merge to a single tools::PolyPolygon (OR)
2436 aMergedLineFillPolyPolygon = basegfx::utils::mergeToSinglePolyPolygon(std::move(aExtractedLineFills));
2437 }
2438 }
2439
2440 if(aMergedLineFillPolyPolygon.count() || (bForceLineDash && aMergedHairlinePolyPolygon.count()))
2441 {
2443 drawing::FillStyle eOldFillStyle = aSet.Get(XATTR_FILLSTYLE).GetValue();
2444 rtl::Reference<SdrPathObj> aLinePolygonPart;
2445 rtl::Reference<SdrPathObj> aLineHairlinePart;
2446 bool bBuildGroup(false);
2447
2448 if(aMergedLineFillPolyPolygon.count())
2449 {
2450 // create SdrObject for filled line geometry
2451 aLinePolygonPart = new SdrPathObj(
2454 std::move(aMergedLineFillPolyPolygon));
2455
2456 // correct item properties
2457 aSet.Put(XLineWidthItem(0));
2458 aSet.Put(XLineStyleItem(drawing::LineStyle_NONE));
2459 Color aColorLine = aSet.Get(XATTR_LINECOLOR).GetColorValue();
2460 sal_uInt16 nTransLine = aSet.Get(XATTR_LINETRANSPARENCE).GetValue();
2461 aSet.Put(XFillColorItem(OUString(), aColorLine));
2462 aSet.Put(XFillStyleItem(drawing::FillStyle_SOLID));
2463 aSet.Put(XFillTransparenceItem(nTransLine));
2464
2465 aLinePolygonPart->SetMergedItemSet(aSet);
2466 }
2467
2468 if(aMergedHairlinePolyPolygon.count())
2469 {
2470 // create SdrObject for hairline geometry
2471 // OBJ_PATHLINE is necessary here, not OBJ_PATHFILL. This is intended
2472 // to get a non-filled object. If the poly is closed, the PathObj takes care for
2473 // the correct closed state.
2474 aLineHairlinePart = new SdrPathObj(
2477 std::move(aMergedHairlinePolyPolygon));
2478
2479 aSet.Put(XLineWidthItem(0));
2480 aSet.Put(XFillStyleItem(drawing::FillStyle_NONE));
2481 aSet.Put(XLineStyleItem(drawing::LineStyle_SOLID));
2482
2483 // it is also necessary to switch off line start and ends here
2484 aSet.Put(XLineStartWidthItem(0));
2485 aSet.Put(XLineEndWidthItem(0));
2486
2487 aLineHairlinePart->SetMergedItemSet(aSet);
2488
2489 if(aLinePolygonPart)
2490 {
2491 bBuildGroup = true;
2492 }
2493 }
2494
2495 // check if original geometry should be added (e.g. filled and closed)
2496 bool bAddOriginalGeometry(false);
2497 SdrPathObj* pPath = dynamic_cast<SdrPathObj*>(this);
2498
2499 if(pPath && pPath->IsClosed())
2500 {
2501 if(eOldFillStyle != drawing::FillStyle_NONE)
2502 {
2503 bAddOriginalGeometry = true;
2504 }
2505 }
2506
2507 // do we need a group?
2508 if(bBuildGroup || bAddOriginalGeometry)
2509 {
2511
2512 if(bAddOriginalGeometry)
2513 {
2514 // Add a clone of the original geometry.
2515 aSet.ClearItem();
2516 aSet.Put(GetMergedItemSet());
2517 aSet.Put(XLineStyleItem(drawing::LineStyle_NONE));
2518 aSet.Put(XLineWidthItem(0));
2519
2521 pClone->SetMergedItemSet(aSet);
2522
2523 pGroup->GetSubList()->NbcInsertObject(pClone.get());
2524 }
2525
2526 if(aLinePolygonPart)
2527 {
2528 pGroup->GetSubList()->NbcInsertObject(aLinePolygonPart.get());
2529 }
2530
2531 if(aLineHairlinePart)
2532 {
2533 pGroup->GetSubList()->NbcInsertObject(aLineHairlinePart.get());
2534 }
2535
2536 pRetval = pGroup;
2537 }
2538 else
2539 {
2540 if(aLinePolygonPart)
2541 {
2542 pRetval = aLinePolygonPart;
2543 }
2544 else if(aLineHairlinePart)
2545 {
2546 pRetval = aLineHairlinePart;
2547 }
2548 }
2549 }
2550 }
2551
2552 if(!pRetval)
2553 {
2554 // due to current method usage, create and return a clone when nothing has changed
2556 }
2557
2558 return pRetval;
2559}
2560
2561
2563{
2564 m_bMarkProt = bProt;
2565}
2566
2567
2569{
2570 m_bEmptyPresObj = bEpt;
2571}
2572
2573
2575{
2577}
2578
2579
2580// convert this path object to contour object, even when it is a group
2582{
2583 rtl::Reference<SdrObject> pRet = pRet1;
2584 if(dynamic_cast<const SdrObjGroup*>( pRet.get()) != nullptr)
2585 {
2586 SdrObjList* pObjList2 = pRet->GetSubList();
2588
2589 for(size_t a=0; a<pObjList2->GetObjCount(); ++a)
2590 {
2591 SdrObject* pIterObj = pObjList2->GetObj(a);
2592 pGroup->GetSubList()->NbcInsertObject(ConvertToContourObj(pIterObj, bForceLineDash).get());
2593 }
2594
2595 pRet = pGroup;
2596 }
2597 else
2598 {
2599 if (SdrPathObj *pPathObj = dynamic_cast<SdrPathObj*>(pRet.get()))
2600 {
2601 // bezier geometry got created, even for straight edges since the given
2602 // object is a result of DoConvertToPolyObj. For conversion to contour
2603 // this is not really needed and can be reduced again AFAP
2604 pPathObj->SetPathPoly(basegfx::utils::simplifyCurveSegments(pPathObj->GetPathPoly()));
2605 }
2606
2607 pRet = pRet->ImpConvertToContourObj(bForceLineDash);
2608 }
2609
2610 // #i73441# preserve LayerID
2611 if(pRet && pRet->GetLayer() != GetLayer())
2612 {
2613 pRet->SetLayer(GetLayer());
2614 }
2615
2616 return pRet;
2617}
2618
2619
2620rtl::Reference<SdrObject> SdrObject::ConvertToPolyObj(bool bBezier, bool bLineToArea) const
2621{
2622 rtl::Reference<SdrObject> pRet = DoConvertToPolyObj(bBezier, true);
2623
2624 if(pRet && bLineToArea)
2625 {
2626 pRet = ConvertToContourObj(pRet.get());
2627 }
2628
2629 // #i73441# preserve LayerID
2630 if(pRet && pRet->GetLayer() != GetLayer())
2631 {
2632 pRet->SetLayer(GetLayer());
2633 }
2634
2635 return pRet;
2636}
2637
2638
2639rtl::Reference<SdrObject> SdrObject::DoConvertToPolyObj(bool /*bBezier*/, bool /*bAddText*/) const
2640{
2641 return nullptr;
2642}
2643
2644
2646{
2647 const bool bIsInserted(nullptr != getParentSdrObjListFromSdrObject());
2648 const tools::Rectangle aBoundRect0(GetLastBoundRect());
2649
2650 if(bIsInserted)
2651 {
2653 }
2654 else
2655 {
2657 }
2658
2659 if(nullptr != m_pPlusData && nullptr != m_pPlusData->pBroadcast)
2660 {
2662 m_pPlusData->pBroadcast->Broadcast(aHint);
2663 }
2664}
2665
2667{
2668 if(IsMoveProtect() != bProt)
2669 {
2670 // #i77187# secured and simplified
2671 m_bMovProt = bProt;
2672 SetChanged();
2674 }
2675}
2676
2678{
2679 if(IsResizeProtect() != bProt)
2680 {
2681 // #i77187# secured and simplified
2682 m_bSizProt = bProt;
2683 SetChanged();
2685 }
2686}
2687
2689{
2690 if( bPrn == m_bNoPrint )
2691 {
2692 m_bNoPrint=!bPrn;
2693 SetChanged();
2694 if (IsInserted())
2695 {
2696 SdrHint aHint(SdrHintKind::ObjectChange, *this);
2698 }
2699 }
2700}
2701
2702void SdrObject::SetVisible(bool bVisible)
2703{
2704 if( bVisible != mbVisible )
2705 {
2707 SetChanged();
2708 if (IsInserted())
2709 {
2710 SdrHint aHint(SdrHintKind::ObjectChange, *this);
2712 }
2713 }
2714}
2715
2716
2718{
2719 if (m_pPlusData==nullptr || m_pPlusData->pUserDataList==nullptr) return 0;
2720 return m_pPlusData->pUserDataList->GetUserDataCount();
2721}
2722
2724{
2725 if (m_pPlusData==nullptr || m_pPlusData->pUserDataList==nullptr) return nullptr;
2726 return &m_pPlusData->pUserDataList->GetUserData(nNum);
2727}
2728
2729void SdrObject::AppendUserData(std::unique_ptr<SdrObjUserData> pData)
2730{
2731 if (!pData)
2732 {
2733 OSL_FAIL("SdrObject::AppendUserData(): pData is NULL pointer.");
2734 return;
2735 }
2736
2738 if (!m_pPlusData->pUserDataList)
2739 m_pPlusData->pUserDataList.reset( new SdrObjUserDataList );
2740
2741 m_pPlusData->pUserDataList->AppendUserData(std::move(pData));
2742}
2743
2744void SdrObject::DeleteUserData(sal_uInt16 nNum)
2745{
2746 sal_uInt16 nCount=GetUserDataCount();
2747 if (nNum<nCount) {
2748 m_pPlusData->pUserDataList->DeleteUserData(nNum);
2749 if (nCount==1) {
2750 m_pPlusData->pUserDataList.reset();
2751 }
2752 } else {
2753 OSL_FAIL("SdrObject::DeleteUserData(): Invalid Index.");
2754 }
2755}
2756
2758{
2759 m_pUserCall = pUser;
2760}
2761
2762
2763void SdrObject::SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle& rBoundRect) const
2764{
2766
2767 if ( m_pUserCall )
2768 {
2769 m_pUserCall->Changed( *this, eUserCall, rBoundRect );
2770 }
2771
2772 if(nullptr != pGroup && pGroup->GetUserCall())
2773 {
2774 // broadcast to group
2776
2777 switch( eUserCall )
2778 {
2780 eChildUserType = SdrUserCallType::ChildMoveOnly;
2781 break;
2782
2784 eChildUserType = SdrUserCallType::ChildResize;
2785 break;
2786
2788 eChildUserType = SdrUserCallType::ChildChangeAttr;
2789 break;
2790
2792 eChildUserType = SdrUserCallType::ChildDelete;
2793 break;
2794
2796 eChildUserType = SdrUserCallType::ChildInserted;
2797 break;
2798
2800 eChildUserType = SdrUserCallType::ChildRemoved;
2801 break;
2802
2803 default: break;
2804 }
2805
2806 pGroup->GetUserCall()->Changed( *this, eChildUserType, rBoundRect );
2807 }
2808
2809 // notify our UNO shape listeners
2810 switch ( eUserCall )
2811 {
2814 [[fallthrough]]; // RESIZE might also imply a change of the position
2817 break;
2818 default:
2819 // not interested in
2820 break;
2821 }
2822}
2823
2824void SdrObject::setUnoShape( const uno::Reference< drawing::XShape >& _rxUnoShape )
2825{
2826 const uno::Reference< uno::XInterface>& xOldUnoShape( maWeakUnoShape );
2827 // the UNO shape would be gutted by the following code; return early
2828 if ( _rxUnoShape == xOldUnoShape )
2829 {
2830 if ( !xOldUnoShape.is() )
2831 {
2832 // make sure there is no stale impl. pointer if the UNO
2833 // shape was destroyed meanwhile (remember we only hold weak
2834 // reference to it!)
2835 mpSvxShape = nullptr;
2836 }
2837 return;
2838 }
2839
2840 if ( xOldUnoShape.is() )
2841 {
2842 // Remove yourself from the current UNO shape. Its destructor
2843 // will reset our UNO shape otherwise.
2845 }
2846
2847 maWeakUnoShape = _rxUnoShape;
2848 mpSvxShape = comphelper::getFromUnoTunnel<SvxShape>( _rxUnoShape );
2849}
2850
2853{
2855 // retrieving the impl pointer and subsequently using it is not thread-safe, of course, so it needs to be
2856 // guarded by the SolarMutex
2857
2858 uno::Reference< uno::XInterface > xShape( maWeakUnoShape );
2859 //#113608#, make sure mpSvxShape is always synchronized with maWeakUnoShape
2860 if ( mpSvxShape && !xShape )
2861 mpSvxShape = nullptr;
2862
2863 return mpSvxShape;
2864}
2865
2866css::uno::Reference< css::drawing::XShape > SdrObject::getUnoShape()
2867{
2868 // try weak reference first
2869 uno::Reference< css::drawing::XShape > xShape = maWeakUnoShape;
2870 if (xShape)
2871 return xShape;
2872
2873 // try to access SdrPage from this SdrObject. This will only exist if the SdrObject is
2874 // inserted in a SdrObjList (page/group/3dScene)
2875 SdrPage* pPageCandidate(getSdrPageFromSdrObject());
2876
2877 // tdf#12152, tdf#120728
2878 //
2879 // With the paradigm change to only get a SdrPage for a SdrObject when the SdrObject
2880 // is *inserted*, the functionality for creating 1:1 associated UNO API implementation
2881 // SvxShapes was partially broken: The used ::CreateShape relies on the SvxPage being
2882 // derived and the CreateShape method overloaded, implementing additional SdrInventor
2883 // types as needed.
2884 //
2885 // The fallback to use SvxDrawPage::CreateShapeByTypeAndInventor is a trap: It's only
2886 // a static fallback that handles the SdrInventor types SdrInventor::E3d and
2887 // SdrInventor::Default. Due to that, e.g. the ReportDesigner broke in various conditions.
2888 //
2889 // That again has to do with the ReportDesigner being implemented using the UNO API
2890 // aspects of SdrObjects early during their construction, not just after these are
2891 // inserted to a SdrPage - but that is not illegal or wrong, the SdrObject exists already.
2892 //
2893 // As a current solution, use the (now always available) SdrModel and any of the
2894 // existing SdrPages. The only important thing is to get a SdrPage where ::CreateShape is
2895 // overloaded and implemented as needed.
2896 //
2897 // Note for the future:
2898 // In a more ideal world there would be only one factory method for creating SdrObjects (not
2899 // ::CreateShape and ::CreateShapeByTypeAndInventor). This also would not be placed at
2900 // SdrPage/SvxPage at all, but at the Model where it belongs - where else would you expect
2901 // objects for the current Model to be constructed? To have this at the Page only would make
2902 // sense if different shapes would need to be constructed for different Pages in the same Model
2903 // - this is never the case.
2904 // At that Model extended functionality for that factory (or overloads and implementations)
2905 // should be placed. But to be realistic, migrating the factories to Model now is too much
2906 // work - maybe over time when melting SdrObject/SvxObject one day...
2907 //
2908 // More Note (added by noel grandin)
2909 // Except that sd/ is being naughty and doing all kinds of magic during CreateShape that
2910 // requires knowing which page the object is being created for. Fixing that would require
2911 // moving a bunch of nasty logic from object creation time, to the point in time when
2912 // it is actually added to a page.
2913 if(nullptr == pPageCandidate)
2914 {
2915 // If not inserted, alternatively access a SdrPage using the SdrModel. There is
2916 // no reason not to create and return a UNO API XShape when the SdrObject is not
2917 // inserted - it may be in construction. Main paradigm is that it exists.
2918 if(0 != getSdrModelFromSdrObject().GetPageCount())
2919 {
2920 // Take 1st SdrPage. That may be e.g. a special page (in SD), but the
2921 // to-be-used method ::CreateShape will be correctly overloaded in
2922 // all cases
2923 pPageCandidate = getSdrModelFromSdrObject().GetPage(0);
2924 }
2925 }
2926
2927 if(nullptr != pPageCandidate)
2928 {
2929 uno::Reference< uno::XInterface > xPage(pPageCandidate->getUnoPage());
2930 if( xPage.is() )
2931 {
2932 SvxDrawPage* pDrawPage = comphelper::getFromUnoTunnel<SvxDrawPage>(xPage);
2933 if( pDrawPage )
2934 {
2935 // create one
2936 xShape = pDrawPage->CreateShape( this );
2937 assert(xShape);
2938 setUnoShape( xShape );
2939 }
2940 }
2941 }
2942 else
2943 {
2944 // Fallback to static base functionality. CAUTION: This will only support
2945 // the most basic stuff like SdrInventor::E3d and SdrInventor::Default. All
2946 // the other SdrInventor enum entries are from overloads and are *not accessible*
2947 // using this fallback (!) - what a bad trap
2949 mpSvxShape = xNewShape.get();
2950 maWeakUnoShape = xShape = mpSvxShape;
2951 }
2952
2953 return xShape;
2954}
2955
2957{
2959
2960 SvxShape* pSvxShape = const_cast< SdrObject* >( this )->getSvxShape();
2961 if ( pSvxShape )
2962 return pSvxShape->notifyPropertyChange( _eProperty );
2963}
2964
2965void SdrObject::registerProvider( const svx::ShapePropertyProviderId _eProperty, std::unique_ptr<svx::PropertyValueProvider> provider )
2966{
2968
2969 SvxShape* pSvxShape = getSvxShape();
2970 return pSvxShape->registerProvider( _eProperty, std::move(provider) );
2971}
2972
2973// transformation interface for StarOfficeAPI. This implements support for
2974// homogeneous 3x3 matrices containing the transformation of the SdrObject. At the
2975// moment it contains a shearX, rotation and translation, but for setting all linear
2976// transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
2977
2978
2979// gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
2980// with the base geometry and returns TRUE. Otherwise it returns FALSE.
2982{
2983 // any kind of SdrObject, just use SnapRect
2984 tools::Rectangle aRectangle(GetSnapRect());
2985
2986 // convert to transformation values
2987 basegfx::B2DTuple aScale(aRectangle.GetWidth(), aRectangle.GetHeight());
2988 basegfx::B2DTuple aTranslate(aRectangle.Left(), aRectangle.Top());
2989
2990 // position maybe relative to anchorpos, convert
2991 if(getSdrModelFromSdrObject().IsWriter())
2992 {
2993 if(GetAnchorPos().X() || GetAnchorPos().Y())
2994 {
2995 aTranslate -= basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
2996 }
2997 }
2998
2999 // build matrix
3000 rMatrix = basegfx::utils::createScaleTranslateB2DHomMatrix(aScale, aTranslate);
3001
3002 return false;
3003}
3004
3005// sets the base geometry of the object using infos contained in the homogeneous 3x3 matrix.
3006// If it's an SdrPathObj it will use the provided geometry information. The Polygon has
3007// to use (0,0) as upper left and will be scaled to the given size in the matrix.
3009{
3010 // break up matrix
3011 basegfx::B2DTuple aScale;
3012 basegfx::B2DTuple aTranslate;
3013 double fRotate, fShearX;
3014 rMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
3015
3016 // #i75086# Old DrawingLayer (GeoStat and geometry) does not support holding negative scalings
3017 // in X and Y which equal a 180 degree rotation. Recognize it and react accordingly
3018 if(basegfx::fTools::less(aScale.getX(), 0.0) && basegfx::fTools::less(aScale.getY(), 0.0))
3019 {
3020 aScale.setX(fabs(aScale.getX()));
3021 aScale.setY(fabs(aScale.getY()));
3022 }
3023
3024 // if anchor is used, make position relative to it
3025 if(getSdrModelFromSdrObject().IsWriter())
3026 {
3027 if(GetAnchorPos().X() || GetAnchorPos().Y())
3028 {
3029 aTranslate += basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
3030 }
3031 }
3032
3033 // build BaseRect
3034 Point aPoint(FRound(aTranslate.getX()), FRound(aTranslate.getY()));
3035 tools::Rectangle aBaseRect(aPoint, Size(FRound(aScale.getX()), FRound(aScale.getY())));
3036
3037 // set BaseRect
3038 SetSnapRect(aBaseRect);
3039}
3040
3041// Give info if object is in destruction
3043{
3045}
3046
3047// return if fill is != drawing::FillStyle_NONE
3049{
3050 return GetObjectItem(XATTR_FILLSTYLE).GetValue() != drawing::FillStyle_NONE;
3051}
3052
3054{
3055 return GetObjectItem(XATTR_LINESTYLE).GetValue() != drawing::LineStyle_NONE;
3056}
3057
3058
3059// #i52224#
3060// on import of OLE object from MS documents the BLIP size might be retrieved,
3061// the following four methods are used to control it;
3062// usually this data makes no sense after the import is finished, since the object
3063// might be resized
3064
3065
3067{
3068 maBLIPSizeRectangle = aRect;
3069}
3070
3071void SdrObject::SetContextWritingMode( const sal_Int16 /*_nContextWritingMode*/ )
3072{
3073 // this base class does not support different writing modes, so ignore the call
3074}
3075
3077{
3079}
3080
3081
3082// #i121917#
3084{
3085 return false;
3086}
3087
3089{
3090 return false;
3091}
3092
3094{
3095 if (GetName().isEmpty())
3096 {
3097 OUString aName;
3098 if (const E3dScene* pE3dObj = DynCastE3dScene(this))
3099 {
3100 SdrObjList* pObjList = pE3dObj->GetSubList();
3101 if (pObjList)
3102 {
3103 SdrObject* pObj0 = pObjList->GetObj(0);
3104 if (pObj0)
3105 aName = pObj0->TakeObjNameSingul();
3106 }
3107 }
3108 else
3110 SetName(aName + " 1");
3111 }
3112
3113 std::unordered_set<OUString> aNameSet;
3114 MakeNameUnique(aNameSet);
3115}
3116
3117void SdrObject::MakeNameUnique(std::unordered_set<OUString>& rNameSet)
3118{
3119 if (GetName().isEmpty())
3120 return;
3121
3122 if (rNameSet.empty())
3123 {
3124 SdrPage* pPage;
3125 SdrObject* pObj;
3126 for (sal_uInt16 nPage(0); nPage < mrSdrModelFromSdrObject.GetPageCount(); ++nPage)
3127 {
3128 pPage = mrSdrModelFromSdrObject.GetPage(nPage);
3130 while (aIter.IsMore())
3131 {
3132 pObj = aIter.Next();
3133 if (pObj != this)
3134 rNameSet.insert(pObj->GetName());
3135 }
3136 }
3137 }
3138
3139 OUString sName(GetName().trim());
3140 OUString sRootName(sName);
3141
3142 if (!sName.isEmpty() && rtl::isAsciiDigit(sName[sName.getLength() - 1]))
3143 {
3144 sal_Int32 nPos(sName.getLength() - 1);
3145 while (nPos > 0 && rtl::isAsciiDigit(sName[--nPos]));
3146 sRootName = o3tl::trim(sName.subView(0, nPos + 1));
3147 }
3148
3149 for (sal_uInt32 n = 1; rNameSet.find(sName) != rNameSet.end(); n++)
3150 sName = sRootName + " " + OUString::number(n);
3151 rNameSet.insert(sName);
3152
3153 SetName(sName);
3154}
3155
3157{
3158 MapUnit eMapUnit(getSdrModelFromSdrObject().GetItemPool().GetMetric(0));
3159 if(eMapUnit == MapUnit::Map100thMM)
3160 return;
3161
3162 if (const auto eTo = MapToO3tlLength(eMapUnit); eTo != o3tl::Length::invalid)
3163 {
3164 const double fConvert(o3tl::convert(1.0, o3tl::Length::mm100, eTo));
3165 rPolyPolygon.transform(basegfx::utils::createScaleB2DHomMatrix(fConvert, fConvert));
3166 }
3167 else
3168 {
3169 OSL_FAIL("Missing unit translation to PoolMetric!");
3170 }
3171}
3172
3174{
3175 return m_aOutRect;
3176}
3177
3179{
3180 m_aOutRect = rRectangle;
3181}
3182
3184{
3185 m_aOutRect = rRectangle;
3186}
3187
3189{
3191}
3192
3193void SdrObject::moveOutRectangle(sal_Int32 nXDelta, sal_Int32 nYDelta)
3194{
3195 m_aOutRect.Move(nXDelta, nYDelta);
3196}
3197
3199{
3200 if( pObj && pObj->GetObjInventor() == SdrInventor::E3d && pObj->GetObjIdentifier() == SdrObjKind::E3D_Scene )
3201 return static_cast<E3dScene*>(pObj);
3202 return nullptr;
3203}
3204
3206{
3207 if( pObj && pObj->GetObjInventor() == SdrInventor::E3d )
3208 return static_cast<E3dObject*>(pObj);
3209 return nullptr;
3210}
3211
3213{
3214 // SdrTextObj has a lot of subclasses, with lots of SdrObjKind identifiers, so use a virtual method
3215 // to be safer.
3216 if( pObj && pObj->IsSdrTextObj() )
3217 return static_cast<SdrTextObj*>(pObj);
3218 return nullptr;
3219}
3220
3222{
3223 SdrObjCreatorParams aParams { nInventor, nObjIdentifier, rSdrModel };
3224 for (const auto & i : ImpGetUserMakeObjHdl()) {
3225 rtl::Reference<SdrObject> pObj = i.Call(aParams);
3226 if (pObj) {
3227 return pObj;
3228 }
3229 }
3230 return nullptr;
3231}
3232
3233namespace
3234{
3235
3236// SdrObject subclass, which represents an empty object of a
3237// certain type (kind).
3238template <SdrObjKind OBJECT_KIND, SdrInventor OBJECT_INVENTOR>
3239class EmptyObject final : public SdrObject
3240{
3241private:
3242 virtual ~EmptyObject() override
3243 {}
3244
3245public:
3246 EmptyObject(SdrModel& rSdrModel)
3247 : SdrObject(rSdrModel)
3248 {
3249 }
3250
3251 EmptyObject(SdrModel& rSdrModel, EmptyObject const& rSource)
3252 : SdrObject(rSdrModel, rSource)
3253 {
3254 }
3255
3256 rtl::Reference<SdrObject> CloneSdrObject(SdrModel& rTargetModel) const override
3257 {
3258 return new EmptyObject(rTargetModel, *this);
3259 }
3260
3261 SdrInventor GetObjInventor() const override
3262 {
3263 return OBJECT_INVENTOR;
3264 }
3265
3266 SdrObjKind GetObjIdentifier() const override
3267 {
3268 return OBJECT_KIND;
3269 }
3270
3271 void NbcRotate(const Point& /*rRef*/, Degree100 /*nAngle*/, double /*sinAngle*/, double /*cosAngle*/) override
3272 {
3273 assert(false); // should not be called for this kind of objects
3274 }
3275};
3276
3277} // end anonymous namespace
3278
3280 SdrModel& rSdrModel,
3281 SdrInventor nInventor,
3282 SdrObjKind nIdentifier,
3283 const tools::Rectangle* pSnapRect)
3284{
3286 bool bSetSnapRect(nullptr != pSnapRect);
3287
3288 if (nInventor == SdrInventor::Default)
3289 {
3290 switch (nIdentifier)
3291 {
3293 {
3294 if(nullptr != pSnapRect)
3295 {
3296 pObj = new SdrMeasureObj(
3297 rSdrModel,
3298 pSnapRect->TopLeft(),
3299 pSnapRect->BottomRight());
3300 }
3301 else
3302 {
3303 pObj = new SdrMeasureObj(rSdrModel);
3304 }
3305 }
3306 break;
3307 case SdrObjKind::Line:
3308 {
3309 if(nullptr != pSnapRect)
3310 {
3311 basegfx::B2DPolygon aPoly;
3312
3313 aPoly.append(
3315 pSnapRect->Left(),
3316 pSnapRect->Top()));
3317 aPoly.append(
3319 pSnapRect->Right(),
3320 pSnapRect->Bottom()));
3321 pObj = new SdrPathObj(
3322 rSdrModel,
3325 }
3326 else
3327 {
3328 pObj = new SdrPathObj(
3329 rSdrModel,
3331 }
3332 }
3333 break;
3334 case SdrObjKind::Text:
3337 {
3338 if(nullptr != pSnapRect)
3339 {
3340 pObj = new SdrRectObj(
3341 rSdrModel,
3342 nIdentifier,
3343 *pSnapRect);
3344 bSetSnapRect = false;
3345 }
3346 else
3347 {
3348 pObj = new SdrRectObj(
3349 rSdrModel,
3350 nIdentifier);
3351 }
3352 }
3353 break;
3358 {
3359 SdrCircKind eCircKind = ToSdrCircKind(nIdentifier);
3360 if(nullptr != pSnapRect)
3361 {
3362 pObj = new SdrCircObj(rSdrModel, eCircKind, *pSnapRect);
3363 bSetSnapRect = false;
3364 }
3365 else
3366 {
3367 pObj = new SdrCircObj(rSdrModel, eCircKind);
3368 }
3369 }
3370 break;
3371 case SdrObjKind::NONE: pObj = nullptr; break;
3372 case SdrObjKind::Group : pObj=new SdrObjGroup(rSdrModel); break;
3373 case SdrObjKind::Polygon : pObj=new SdrPathObj(rSdrModel, SdrObjKind::Polygon ); break;
3374 case SdrObjKind::PolyLine : pObj=new SdrPathObj(rSdrModel, SdrObjKind::PolyLine ); break;
3375 case SdrObjKind::PathLine : pObj=new SdrPathObj(rSdrModel, SdrObjKind::PathLine ); break;
3376 case SdrObjKind::PathFill : pObj=new SdrPathObj(rSdrModel, SdrObjKind::PathFill ); break;
3377 case SdrObjKind::FreehandLine : pObj=new SdrPathObj(rSdrModel, SdrObjKind::FreehandLine ); break;
3378 case SdrObjKind::FreehandFill : pObj=new SdrPathObj(rSdrModel, SdrObjKind::FreehandFill ); break;
3379 case SdrObjKind::PathPoly : pObj=new SdrPathObj(rSdrModel, SdrObjKind::Polygon ); break;
3380 case SdrObjKind::PathPolyLine : pObj=new SdrPathObj(rSdrModel, SdrObjKind::PolyLine ); break;
3381 case SdrObjKind::Edge : pObj=new SdrEdgeObj(rSdrModel); break;
3382 case SdrObjKind::Rectangle : pObj=new SdrRectObj(rSdrModel); break;
3383 case SdrObjKind::Graphic : pObj=new SdrGrafObj(rSdrModel); break;
3384 case SdrObjKind::OLE2 : pObj=new SdrOle2Obj(rSdrModel); break;
3385 case SdrObjKind::OLEPluginFrame : pObj=new SdrOle2Obj(rSdrModel, true); break;
3386 case SdrObjKind::Caption : pObj=new SdrCaptionObj(rSdrModel); break;
3387 case SdrObjKind::Page : pObj=new SdrPageObj(rSdrModel); break;
3388 case SdrObjKind::UNO : pObj=new SdrUnoObj(rSdrModel, OUString()); break;
3389 case SdrObjKind::CustomShape: pObj=new SdrObjCustomShape(rSdrModel); break;
3390#if HAVE_FEATURE_AVMEDIA
3391 case SdrObjKind::Media : pObj=new SdrMediaObj(rSdrModel); break;
3392#endif
3393 case SdrObjKind::Table : pObj=new sdr::table::SdrTableObj(rSdrModel); break;
3394 case SdrObjKind::NewFrame: // used for frame creation in writer
3395 pObj = new EmptyObject<SdrObjKind::NewFrame, SdrInventor::Default>(rSdrModel);
3396 break;
3397 default:
3398 break;
3399 }
3400 }
3401
3402 if (!pObj)
3403 {
3404 pObj = CreateObjectFromFactory(rSdrModel, nInventor, nIdentifier);
3405 }
3406
3407 if (!pObj)
3408 {
3409 // Well, if no one wants it...
3410 return nullptr;
3411 }
3412
3413 if(bSetSnapRect && nullptr != pSnapRect)
3414 {
3415 pObj->NbcSetSnapRect(*pSnapRect);
3416 }
3417
3418 return pObj;
3419}
3420
3422{
3423 std::vector<Link<SdrObjCreatorParams, rtl::Reference<SdrObject>>>& rLL=ImpGetUserMakeObjHdl();
3424 auto it = std::find(rLL.begin(), rLL.end(), rLink);
3425 if (it != rLL.end()) {
3426 OSL_FAIL("SdrObjFactory::InsertMakeObjectHdl(): Link already in place.");
3427 } else {
3428 rLL.push_back(rLink);
3429 }
3430}
3431
3433{
3434 std::vector<Link<SdrObjCreatorParams, rtl::Reference<SdrObject>>>& rLL=ImpGetUserMakeObjHdl();
3435 auto it = std::find(rLL.begin(), rLL.end(), rLink);
3436 if (it != rLL.end())
3437 rLL.erase(it);
3438}
3439
3440namespace svx
3441{
3443 {
3444 }
3445}
3446
3447/* 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)
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
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:495
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:382
virtual void SetChanged(bool bFlg=true)
Definition: svdmodel.cxx:1143
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdmodel.cxx:516
const SfxItemPool & GetItemPool() const
Definition: svdmodel.hxx:318
bool IsInDestruction() const
Definition: svdmodel.hxx:592
OUString GetMetricString(tools::Long nVal, bool bNoUnitChars=false, sal_Int32 nNumDigits=-1) const
Definition: svdmodel.cxx:966
const SdrPage * GetPage(sal_uInt16 nPgNum) const
Definition: svdmodel.cxx:1860
std::unordered_set< SdrObject * > maAllIncarnatedObjects
Definition: svdmodel.hxx:170
sal_uInt16 GetPageCount() const
Definition: svdmodel.cxx:1870
void EndUndo()
Definition: svdmodel.cxx:453
static SVX_DLLPRIVATE rtl::Reference< SdrObject > CreateObjectFromFactory(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nIdentifier)
Definition: svdobj.cxx:3221
static void InsertMakeObjectHdl(Link< SdrObjCreatorParams, rtl::Reference< SdrObject > > const &rLink)
Definition: svdobj.cxx:3421
static void RemoveMakeObjectHdl(Link< SdrObjCreatorParams, rtl::Reference< SdrObject > > const &rLink)
Definition: svdobj.cxx:3432
static rtl::Reference< SdrObject > MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
Definition: svdobj.cxx:3279
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:174
bool bClosedObj
Definition: svdobj.hxx:183
virtual ~SdrObjGeoData()
Definition: svdobj.cxx:170
Point aAnchor
Definition: svdobj.hxx:177
std::unique_ptr< SdrGluePointList > pGPL
Definition: svdobj.hxx:179
bool bMovProt
Definition: svdobj.hxx:180
SdrLayerID mnLayerID
Definition: svdobj.hxx:185
bool bSizProt
Definition: svdobj.hxx:181
tools::Rectangle aBoundRect
Definition: svdobj.hxx:176
bool bNoPrint
Definition: svdobj.hxx:182
bool mbVisible
Definition: svdobj.hxx:184
SdrObject * Next()
Definition: svditer.hxx:63
bool IsMore() const
Definition: svditer.hxx:62
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:785
size_t GetObjCount() const
Definition: svdpage.cxx:779
void SetSdrObjListRectsDirty()
Definition: svdpage.cxx:223
virtual SdrObject * getSdrObjectFromSdrObjList() const
Definition: svdpage.cxx:128
const SdrPageView * pPageView
Definition: svdobj.hxx:140
const SdrLayerIDSet * pVisiLayer
Definition: svdobj.hxx:139
Provides information about various ZObject properties.
Definition: svdobj.hxx:196
virtual void Changed(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle &rOldBoundRect)
Definition: svdobj.cxx:135
virtual void const * GetPDFAnchorStructureElementKey(SdrObject const &rObj)
Definition: svdobj.cxx:139
virtual ~SdrObjUserCall()
Definition: svdobj.cxx:131
User data of a drawing object, e.g.
Definition: svdobj.hxx:152
virtual ~SdrObjUserData()
Definition: svdobj.cxx:158
SdrObjUserData(SdrInventor nInv, sal_uInt16 nId)
Definition: svdobj.cxx:150
Abstract DrawObject.
Definition: svdobj.hxx:260
void SetBLIPSizeRectangle(const tools::Rectangle &aRect)
Definition: svdobj.cxx:3066
sal_uInt32 GetOrdNumDirect() const
Definition: svdobj.hxx:844
virtual bool BckCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1417
virtual void RecalcSnapRect()
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: svdobj.cxx:1658
virtual ~SdrObject() override
Definition: svdobj.cxx:457
void setOutRectangleConst(tools::Rectangle const &rRectangle) const
Definition: svdobj.cxx:3178
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties()
Definition: svdobj.cxx:215
virtual void NbcSetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1635
bool IsResizeProtect() const
Definition: svdobj.hxx:758
void SetDoNotInsertIntoPageAutomatically(bool bSet)
Definition: svdobj.cxx:3076
virtual Degree100 GetShearAngle(bool bVertical=false) const
Definition: svdobj.cxx:1710
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdobj.cxx:1771
void InsertedStateChange()
Definition: svdobj.cxx:2645
std::unique_ptr< Impl > mpImpl
Definition: svdobj.hxx:962
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const
Definition: svdobj.cxx:2639
virtual void NbcCrop(const basegfx::B2DPoint &rRef, double fxFact, double fyFact)
Definition: svdobj.cxx:1542
virtual bool DoMacro(const SdrObjMacroHitRec &rRec)
Definition: svdobj.cxx:1884
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
Definition: svdobj.cxx:2009
virtual void SetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1642
SdrObjUserCall * GetUserCall() const
Definition: svdobj.hxx:837
void ImpForcePlusData()
Definition: svdobj.cxx:1120
virtual Degree100 GetRotateAngle() const
Definition: svdobj.cxx:1705
SVX_DLLPRIVATE void setParentOfSdrObject(SdrObjList *pNew)
Definition: svdobj.cxx:294
virtual void SetGrabBagItem(const css::uno::Any &rVal)
Definition: svdobj.cxx:930
const Point & GetAnchorPos() const
Definition: svdobj.cxx:1653
void ActionChanged() const
Definition: svdobj.cxx:273
void SetRelativeHeight(double nValue)
Definition: svdobj.cxx:580
bool mbLineIsOutsideGeometry
Definition: svdobj.hxx:920
virtual void SAL_CALL acquire() noexcept override final
Definition: svdobj.cxx:487
virtual SdrGluePointList * ForceGluePointList()
Definition: svdobj.cxx:2319
virtual bool HasText() const
Definition: svdobj.cxx:3083
virtual void NbcSetPoint(const Point &rPnt, sal_uInt32 i)
Definition: svdobj.cxx:1749
virtual void NbcSetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
Definition: svdobj.cxx:1829
SdrModel & mrSdrModelFromSdrObject
Definition: svdobj.hxx:294
SvxShape * getSvxShape()
only for internal use!
Definition: svdobj.cxx:2852
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:664
void ImpSetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1630
const tools::Rectangle & getOutRectangle() const
Definition: svdobj.cxx:3173
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const
Definition: svdobj.cxx:1347
bool m_bIs3DObj
Definition: svdobj.hxx:917
void SetMarkProtect(bool bProt)
Definition: svdobj.cxx:2562
virtual rtl::Reference< SdrObject > getFullDragClone() const
Definition: svdobj.cxx:1341
void moveOutRectangle(sal_Int32 nXDelta, sal_Int32 nYDelta)
Definition: svdobj.cxx:3193
virtual void NbcSetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1677
void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
Definition: svdobj.cxx:1798
virtual sdr::properties::BaseProperties & GetProperties() const
Definition: svdobj.cxx:220
void MakeNameUnique()
Definition: svdobj.cxx:3093
tools::Rectangle maBLIPSizeRectangle
Definition: svdobj.hxx:975
virtual void Crop(const basegfx::B2DPoint &rRef, double fxFact, double fyFact)
Definition: svdobj.cxx:1567
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
Definition: svdobj.cxx:1445
void notifyShapePropertyChange(const svx::ShapePropertyProviderId _eProperty) const
Definition: svdobj.cxx:2956
virtual bool IsTextBox() const
Is this a textbox of a drawinglayer shape?
Definition: svdobj.cxx:3088
void SetRelativeHeightRelation(sal_Int16 eValue)
Definition: svdobj.cxx:585
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1596
const SfxBroadcaster * GetBroadcaster() const
Definition: svdobj.cxx:697
virtual OUString TakeObjNamePlural() const
Definition: svdobj.cxx:1097
virtual void InternalSetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast)
Definition: svdobj.cxx:2267
void AppendUserData(std::unique_ptr< SdrObjUserData > pData)
Definition: svdobj.cxx:2729
virtual Point GetPoint(sal_uInt32 i) const
Definition: svdobj.cxx:1735
virtual bool BegCreate(SdrDragStat &rStat)
Every object must be able to create itself interactively.
Definition: svdobj.cxx:1383
const double * GetRelativeHeight() const
Definition: svdobj.cxx:603
std::unique_ptr< SdrObjPlusData > m_pPlusData
Definition: svdobj.hxx:899
virtual void setUnoShape(const css::uno::Reference< css::drawing::XShape > &_rxUnoShape)
Sets a new UNO representation of the shape.
Definition: svdobj.cxx:2824
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:1131
bool m_bMovProt
Definition: svdobj.hxx:904
virtual OUString GetTitle() const
Definition: svdobj.cxx:817
bool LineGeometryUsageIsNecessary() const
Definition: svdobj.cxx:1075
void BroadcastObjectChange() const
Definition: svdobj.cxx:1018
virtual void SetTitle(const OUString &rStr)
Definition: svdobj.cxx:783
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:1994
virtual void RestoreGeoData(const SdrObjGeoData &rGeo)
Definition: svdobj.cxx:1923
bool IsMoveProtect() const
Definition: svdobj.hxx:756
virtual std::unique_ptr< SdrObjGeoData > GetGeoData() const
Definition: svdobj.cxx:1950
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:1607
void SetUserCall(SdrObjUserCall *pUser)
Definition: svdobj.cxx:2757
virtual const std::shared_ptr< svx::diagram::IDiagramHelper > & getDiagramHelper() const
Definition: svdobj.cxx:207
void SetEmptyPresObj(bool bEpt)
Definition: svdobj.cxx:2568
void NbcApplyNotPersistAttr(const SfxItemSet &rAttr)
Definition: svdobj.cxx:2028
bool mbSupportTextIndentingOnLineWidthChange
Definition: svdobj.hxx:922
sal_uInt16 GetUserDataCount() const
Definition: svdobj.cxx:2717
virtual void SetDescription(const OUString &rStr)
Definition: svdobj.cxx:827
void SingleObjectPainter(OutputDevice &rOut) const
Definition: svdobj.cxx:1064
void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
Definition: svdobj.cxx:2249
rtl::Reference< SdrObject > ImpConvertToContourObj(bool bForceLineDash)
Definition: svdobj.cxx:2408
virtual SdrInventor GetObjInventor() const
Definition: svdobj.cxx:621
Point m_aAnchor
Definition: svdobj.hxx:896
void RemoveListener(SfxListener &rListener)
Definition: svdobj.cxx:687
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const
Polygon dragged by the user when creating the object.
Definition: svdobj.cxx:1422
virtual OutlinerParaObject * GetOutlinerParaObject() const
Definition: svdobj.cxx:1833
virtual sal_uInt32 GetSnapPointCount() const
snap to special points of an Object (polygon points, center of circle)
Definition: svdobj.cxx:1715
void SetObjectItem(const SfxPoolItem &rItem)
Definition: svdobj.cxx:1979
virtual css::uno::Reference< css::drawing::XShape > getUnoShape()
Definition: svdobj.cxx:2866
void SetVisible(bool bVisible)
Definition: svdobj.cxx:2702
SdrObjList * mpParentOfSdrObject
Definition: svdobj.hxx:964
void SetRelativeWidth(double nValue)
Definition: svdobj.cxx:570
const SfxPoolItem & GetObjectItem(const sal_uInt16 nWhich) const
Definition: svdobj.cxx:2004
virtual bool supportsFullDrag() const
Definition: svdobj.cxx:1336
virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat &rDrag) const
Definition: svdobj.cxx:1375
virtual void Mirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1587
bool m_bMarkProt
Definition: svdobj.hxx:972
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:905
bool m_bSnapRectDirty
Definition: svdobj.hxx:902
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:717
virtual bool IsPolyObj() const
Definition: svdobj.cxx:1725
void NbcMirrorGluePoints(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:2348
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage)
Definition: svdobj.cxx:523
void SetNavigationPosition(const sal_uInt32 nPosition)
Definition: svdobj.cxx:952
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:1999
virtual void SaveGeoData(SdrObjGeoData &rGeo) const
Definition: svdobj.cxx:1900
virtual bool MovCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1393
rtl::Reference< SdrObject > ConvertToPolyObj(bool bBezier, bool bLineToArea) const
Definition: svdobj.cxx:2620
void NbcSetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
Definition: svdobj.cxx:2262
virtual void Move(const Size &rSiz)
Definition: svdobj.cxx:1531
virtual bool HasLimitedRotation() const
Definition: svdobj.cxx:1081
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:962
void SetResizeProtect(bool bProt)
Definition: svdobj.cxx:2677
void ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon &rPolyPolygon) const noexcept
Definition: svdobj.cxx:3156
virtual OUString GetDescription() const
Definition: svdobj.cxx:861
const double * GetRelativeWidth() const
Definition: svdobj.cxx:590
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1667
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1511
SdrObjList * getParentSdrObjListFromSdrObject() const
Definition: svdobj.cxx:318
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:289
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1662
SdrObjUserCall * m_pUserCall
Definition: svdobj.hxx:897
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1524
void NbcShearGluePoints(const Point &rRef, double tn, bool bVShear)
Definition: svdobj.cxx:2358
virtual void SetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1696
virtual void SetGeoData(const SdrObjGeoData &rGeo)
Definition: svdobj.cxx:1957
SfxStyleSheet * GetStyleSheet() const
Definition: svdobj.cxx:2244
virtual const OUString & GetName() const
Definition: svdobj.cxx:771
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:2666
bool Equals(const SdrObject &) const
Definition: svdobj.cxx:1758
bool isVisibleOnAnyOfTheseLayers(const SdrLayerIDSet &rSet) const
Definition: svdobj.cxx:650
std::unique_ptr< SfxGrabBagItem > m_pGrabBagItem
Definition: svdobj.hxx:966
void SetNotVisibleAsMaster(bool bFlg)
Definition: svdobj.cxx:2574
virtual bool IsSdrTextObj() const
Definition: svdobj.hxx:765
SdrObjUserData * GetUserData(sal_uInt16 nNum) const
Definition: svdobj.cxx:2723
void SetRelativeWidthRelation(sal_Int16 eValue)
Definition: svdobj.cxx:575
bool m_bIsUnoObj
Definition: svdobj.hxx:918
virtual bool HasTextEdit() const
Definition: svdobj.cxx:1753
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon)
Definition: svdobj.cxx:3008
bool IsGroupObject() const
Definition: svdobj.cxx:712
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:261
sal_uInt32 m_nOrdNum
Definition: svdobj.hxx:965
virtual PointerStyle GetCreatePointer() const
get the cursor/pointer that signals creating this object
Definition: svdobj.cxx:1433
void SetOrdNum(sal_uInt32 nNum)
Definition: svdobj.cxx:917
void BurnInStyleSheetAttributes()
Definition: svdobj.cxx:1842
virtual void AdjustToMaxRect(const tools::Rectangle &rMaxRect, bool bShrinkOnly=false)
Definition: svdobj.cxx:1682
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:1576
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
Definition: svdobj.cxx:2763
virtual void PaintMacro(OutputDevice &rOut, const tools::Rectangle &rDirtyRect, const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1867
bool HasLineStyle() const
Definition: svdobj.cxx:3053
void SetPoint(const Point &rPnt, sal_uInt32 i)
Definition: svdobj.cxx:1740
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:2014
sal_Int16 GetRelativeHeightRelation() const
Definition: svdobj.cxx:611
virtual void ConnectToNode(bool bTail1, SdrObject *pObj)
Definition: svdobj.cxx:2368
virtual void SetChanged()
Definition: svdobj.cxx:1042
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const
Definition: svdobj.cxx:1370
void AddObjectUser(sdr::ObjectUser &rNewUser)
Definition: svdobj.cxx:238
tools::Rectangle m_aOutRect
Definition: svdobj.hxx:895
virtual SdrObjKind GetObjIdentifier() const
Definition: svdobj.cxx:626
virtual const tools::Rectangle & GetLastBoundRect() const
Definition: svdobj.cxx:977
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const =0
virtual void SetContextWritingMode(const sal_Int16 _nContextWritingMode)
Definition: svdobj.cxx:3071
bool m_bIsEdge
Definition: svdobj.hxx:916
virtual sal_uInt32 GetHdlCount() const
Via GetHdlCount the number of Handles can be retrieved.
Definition: svdobj.cxx:1226
void AddListener(SfxListener &rListener)
Definition: svdobj.cxx:676
sal_uInt32 GetNavigationPosition() const
Definition: svdobj.cxx:941
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:279
virtual const SdrGluePointList * GetGluePointList() const
Definition: svdobj.cxx:2312
virtual basegfx::B2DPolyPolygon TakeContour() const
contour for TextToContour
Definition: svdobj.cxx:1140
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1687
bool IsVisible() const
Definition: svdobj.hxx:762
std::unique_ptr< sdr::contact::ViewContact > mpViewContact
Definition: svdobj.hxx:979
rtl::Reference< SdrObject > ConvertToContourObj(SdrObject *pRet, bool bForceLineDash=false) const
Definition: svdobj.cxx:2581
virtual void DisconnectFromNode(bool bTail1)
Definition: svdobj.cxx:2372
const SfxItemSet & GetMergedItemSet() const
Definition: svdobj.cxx:1974
virtual void NbcReformatText()
Definition: svdobj.cxx:1838
bool IsMacroHit(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1889
SdrObject * getParentSdrObjectFromSdrObject() const
Definition: svdobj.cxx:722
virtual SdrObject * CheckMacroHit(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1852
virtual OUString TakeObjNameSingul() const
Definition: svdobj.cxx:1087
OUString ImpGetDescriptionStr(TranslateId pStrCacheID) const
Definition: svdobj.cxx:1102
bool mbVisible
Definition: svdobj.hxx:971
bool IsInserted() const
Definition: svdobj.hxx:750
void ClearMergedItem(const sal_uInt16 nWhich=0)
Definition: svdobj.cxx:1989
bool IsPrintable() const
Definition: svdobj.hxx:760
bool IsInDestruction() const
Definition: svdobj.cxx:3042
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:645
void SetMergedItem(const SfxPoolItem &rItem)
Definition: svdobj.cxx:1984
void RemoveObjectUser(sdr::ObjectUser &rOldUser)
Definition: svdobj.cxx:243
bool HasFillStyle() const
Definition: svdobj.cxx:3048
virtual PointerStyle GetMacroPointer(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1862
void AddReference(SdrVirtObj &rVrtObj)
Definition: svdobj.cxx:702
virtual SdrObject * GetConnectedNode(bool bTail1) const
Definition: svdobj.cxx:2376
virtual void AddToHdlList(SdrHdlList &rHdlList) const
Definition: svdobj.cxx:1231
virtual bool applySpecialDrag(SdrDragStat &rDrag)
Definition: svdobj.cxx:1358
void DelReference(SdrVirtObj &rVrtObj)
Definition: svdobj.cxx:707
bool m_bNoPrint
Definition: svdobj.hxx:970
OUString GetMetrStr(tools::Long nVal) const
Definition: svdobj.cxx:1126
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd)
Definition: svdobj.cxx:1403
virtual void RecalcBoundRect()
Definition: svdobj.cxx:982
virtual void SetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:669
virtual void BrkCreate(SdrDragStat &rStat)
Definition: svdobj.cxx:1413
virtual void SetDecorative(bool isDecorative)
Definition: svdobj.cxx:871
void DeleteUserData(sal_uInt16 nNum)
Definition: svdobj.cxx:2744
bool m_bClosedObj
Definition: svdobj.hxx:915
void NbcRotateGluePoints(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:2338
SvxShape * mpSvxShape
Definition: svdobj.hxx:983
virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const
Definition: svdobj.cxx:2296
sal_Int16 GetRelativeWidthRelation() const
Definition: svdobj.cxx:598
bool m_bVirtObj
Definition: svdobj.hxx:901
bool mbDoNotInsertIntoPageAutomatically
Definition: svdobj.hxx:989
SdrLayerID mnLayerID
Definition: svdobj.hxx:969
void registerProvider(const svx::ShapePropertyProviderId _eProperty, std::unique_ptr< svx::PropertyValueProvider > propProvider)
Definition: svdobj.cxx:2965
tools::Rectangle ImpDragCalcRect(const SdrDragStat &rDrag) const
Definition: svdobj.cxx:1261
virtual bool hasSpecialDrag() const
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdobj.cxx:1331
virtual void addCropHandles(SdrHdlList &rTarget) const
Definition: svdobj.cxx:1255
void GetGrabBagItem(css::uno::Any &rVal) const
Definition: svdobj.cxx:922
void setOutRectangle(tools::Rectangle const &rRectangle)
Definition: svdobj.cxx:3183
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:1895
virtual Point GetSnapPoint(sal_uInt32 i) const
Definition: svdobj.cxx:1720
void TakeNotPersistAttr(SfxItemSet &rAttr) const
Definition: svdobj.cxx:2200
css::uno::WeakReference< css::drawing::XShape > maWeakUnoShape
Definition: svdobj.hxx:985
void resetOutRectangle()
Definition: svdobj.cxx:3188
virtual void SetName(const OUString &rStr, const bool bSetChanged=true)
Definition: svdobj.cxx:734
virtual bool HasMacro() const
Definition: svdobj.cxx:1847
sal_uInt32 mnNavigationPosition
Definition: svdobj.hxx:968
virtual bool IsDecorative() const
Definition: svdobj.cxx:900
bool m_bSizProt
Definition: svdobj.hxx:905
void ApplyNotPersistAttr(const SfxItemSet &rAttr)
Definition: svdobj.cxx:2019
virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const
Definition: svdobj.cxx:2275
virtual void SetRelativePos(const Point &rPnt)
Definition: svdobj.cxx:1614
std::unique_ptr< sdr::properties::BaseProperties > mpProperties
Definition: svdobj.hxx:977
void SetGlueReallyAbsolute(bool bOn)
Definition: svdobj.cxx:2328
virtual void AddToPlusHdlList(SdrHdlList &rHdlList, SdrHdl &rHdl) const
Definition: svdobj.cxx:1251
virtual void SetBoundRectDirty()
Definition: svdobj.cxx:329
bool m_bNotVisibleAsMaster
Definition: svdobj.hxx:913
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const
Definition: svdobj.cxx:2981
bool m_bEmptyPresObj
Definition: svdobj.hxx:911
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdobj.cxx:1439
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:509
virtual Point GetRelativePos() const
Definition: svdobj.cxx:1625
const SfxItemSet & GetObjectItemSet() const
Definition: svdobj.cxx:1969
virtual sal_uInt32 GetPointCount() const
Definition: svdobj.cxx:1730
void SetPrintable(bool bPrn)
Definition: svdobj.cxx:2688
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
Definition: svdobj.cxx:631
virtual const tools::Rectangle & GetLogicRect() const
Definition: svdobj.cxx:1672
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
Definition: svdobj.cxx:1548
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs)=0
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:379
virtual SdrPage * getSdrPageFromSdrObjList() const override
Definition: svdpage.cxx:1626
css::uno::Reference< css::uno::XInterface > const & getUnoPage()
Definition: svdpage.cxx:1769
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:1734
static std::unique_ptr< SdrUndoAction > CreateUndoObjectDecorative(SdrObject &rObject, bool const WasDecorative)
Definition: svdundo.cxx:1742
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
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
void InvalidateSdrObject()
Definition: unoshape.cxx:241
void notifyPropertyChange(svx::ShapePropertyProviderId eProp)
Definition: unoshape.cxx:292
void registerProvider(svx::ShapePropertyProviderId eProp, std::unique_ptr< svx::PropertyValueProvider > provider)
Definition: unoshape.cxx:298
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:3442
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 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)
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:80
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
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
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, const basegfx::B2DVector &rHitTolerance, 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:346
SdrHdlKind
Definition: svdhdl.hxx:53
void impAddIncarnatedSdrObjectToSdrModel(SdrObject &rSdrObject, SdrModel &rSdrModel)
Definition: svdobj.cxx:336
E3dObject * DynCastE3dObject(SdrObject *pObj)
Definition: svdobj.cxx:3205
SdrTextObj * DynCastSdrTextObj(SdrObject *pObj)
Definition: svdobj.cxx:3212
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:2382
E3dScene * DynCastE3dScene(SdrObject *pObj)
Definition: svdobj.cxx:3198
void impRemoveIncarnatedSdrObjectToSdrModel(SdrObject &rSdrObject, SdrModel &rSdrModel)
Definition: svdobj.cxx:340
SdrInventor
Definition: svdobj.hxx:98
SdrUserCallType
Definition: svdobj.hxx:112
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