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