LibreOffice Module svx (master) 1
unoshape.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
21#include <com/sun/star/awt/XBitmap.hpp>
22#include <com/sun/star/awt/Rectangle.hpp>
23#include <com/sun/star/drawing/CircleKind.hpp>
24#include <com/sun/star/lang/NoSupportException.hpp>
25#include <vcl/svapp.hxx>
26#include <svl/itemprop.hxx>
27#include <o3tl/any.hxx>
28#include <osl/mutex.hxx>
29#include <editeng/unotext.hxx>
30#include <svx/svdobj.hxx>
31#include <svx/svdoole2.hxx>
37#include <vcl/gfxlink.hxx>
38#include <vcl/virdev.hxx>
39#include <svx/sdangitm.hxx>
40#include <svx/svdlayer.hxx>
41#include <svx/svdopage.hxx>
42#include <svx/xflbstit.hxx>
43#include <svx/xflbmtit.hxx>
44#include <svx/xlnstit.hxx>
45#include <svx/xlnedit.hxx>
46#include <svx/xlnclit.hxx>
47#include <svx/svdmodel.hxx>
48#include <svx/svdobjkind.hxx>
49#include <svx/unopage.hxx>
50#include <svx/unoshape.hxx>
51#include <svx/unoshtxt.hxx>
52#include <svx/svdpage.hxx>
53#include <svx/unoshprp.hxx>
54#include <svx/svdograf.hxx>
55#include <svx/unoapi.hxx>
56#include <svx/svdomeas.hxx>
57#include <svx/svdpool.hxx>
59#include <tools/stream.hxx>
60#include <tools/gen.hxx>
62#include <svx/svdoedge.hxx>
63#include <svx/svdocapt.hxx>
64#include <svx/obj3d.hxx>
65#include <svx/xflftrit.hxx>
66#include <svx/xtable.hxx>
67#include <svx/xbtmpit.hxx>
68#include <svx/xfillit0.hxx>
69#include <svx/xflgrit.hxx>
70#include <svx/xflhtit.hxx>
71#include <svx/xlineit0.hxx>
72#include <svx/xlndsit.hxx>
73#include <svx/unomaster.hxx>
77#include "gluepts.hxx"
78#include "shapeimpl.hxx"
79#include <sal/log.hxx>
80
81#include <svx/lathe3d.hxx>
82#include <extrud3d.hxx>
87
88#include <vcl/gdimtf.hxx>
89#include <vcl/wmf.hxx>
90#include <svx/sdtfsitm.hxx>
91#include <svx/svdopath.hxx>
93#include <svx/xflclit.hxx>
95
96#include <memory>
97#include <optional>
98#include <vector>
99#include <iostream>
100
101#include <bitmaps.hlst>
102
103using namespace ::osl;
104using namespace ::cppu;
105using namespace ::com::sun::star;
106using namespace ::com::sun::star::uno;
107using namespace ::com::sun::star::lang;
108using namespace ::com::sun::star::container;
110
111class GDIMetaFile;
112
114{
115 std::optional<SfxItemSet> mxItemSet;
119
126
127 // for xComponent
130
131 SvxShapeImpl( SvxShape& _rAntiImpl, ::osl::Mutex& _rMutex )
133 ,mpMaster( nullptr )
134 ,mbDisposing( false )
135 ,maDisposeListeners( _rMutex )
136 ,maPropertyNotifier( _rAntiImpl, _rMutex )
137 {
138 }
139};
140
141namespace {
142
143class ShapePositionProvider : public PropertyValueProvider
144{
145public:
146 static constexpr OUStringLiteral sPosition = u"Position";
147 explicit ShapePositionProvider( SvxShape& _shape )
148 :PropertyValueProvider( _shape, sPosition )
149 {
150 }
151
152protected:
153 virtual void getCurrentValue( Any& _out_rCurrentValue ) const override
154 {
155 _out_rCurrentValue <<= static_cast< SvxShape& >( getContext() ).getPosition();
156 }
157};
158
159
160class ShapeSizeProvider : public PropertyValueProvider
161{
162public:
163 static constexpr OUStringLiteral sSize = u"Size";
164 explicit ShapeSizeProvider( SvxShape& _shape )
165 :PropertyValueProvider( _shape, sSize )
166 {
167 }
168
169protected:
170 virtual void getCurrentValue( Any& _out_rCurrentValue ) const override
171 {
172 _out_rCurrentValue <<= static_cast< SvxShape& >( getContext() ).getSize();
173 }
174};
175
177sal_Int16 GetTextFitToSizeScale(SdrObject* pObject)
178{
179 SdrTextObj* pTextObj = DynCastSdrTextObj(pObject);
180 if (!pTextObj)
181 {
182 return 0;
183 }
184
185 const SfxItemSet& rTextObjSet = pTextObj->GetMergedItemSet();
187 != drawing::TextFitToSizeType_AUTOFIT)
188 {
189 return 0;
190 }
191
192 return pTextObj->GetFontScaleY();
193}
194}
195
197: maSize(100,100)
198, mpImpl( new SvxShapeImpl( *this, m_aMutex ) )
199, mbIsMultiPropertyCall(false)
200, mpPropSet(getSvxMapProvider().GetPropertySet(SVXMAP_SHAPE, SdrObject::GetGlobalDrawObjectItemPool()))
201, maPropMapEntries(getSvxMapProvider().GetMap(SVXMAP_SHAPE))
202, mxSdrObject(pObject)
203, mnLockCount(0)
204{
206}
207
208
210: maSize(100,100)
211, mpImpl( new SvxShapeImpl( *this, m_aMutex ) )
212, mbIsMultiPropertyCall(false)
213, mpPropSet(pPropertySet)
214, maPropMapEntries(pEntries)
215, mxSdrObject(pObject)
216, mnLockCount(0)
217{
219}
220
221
223{
224 ::SolarMutexGuard aGuard;
225
226 DBG_ASSERT( mnLockCount == 0, "Locked shape was disposed!" );
227
228 if ( mpImpl->mpMaster )
229 mpImpl->mpMaster->dispose();
230
231 if ( mxSdrObject )
232 {
233 EndListening(mxSdrObject->getSdrModelFromSdrObject());
234 mxSdrObject->setUnoShape(nullptr);
235 mxSdrObject.clear();
236 }
237
238 EndListeningAll(); // call explicitly within SolarMutexGuard
239}
240
241
243{
244 if(mxSdrObject)
245 {
246 EndListening(mxSdrObject->getSdrModelFromSdrObject());
247 mxSdrObject.clear();
248 }
249};
250
252{
253 mpImpl->mnObjId = nKind;
254}
258{
259 return mpImpl->mnObjId;
260}
261
262
264{
265 mpImpl->mpMaster = pMaster;
266}
267
268
270{
271 if( mpImpl->mpMaster )
272 {
273 uno::Any aAny;
274 if( mpImpl->mpMaster->queryAggregation( rType, aAny ) )
275 return aAny;
276 }
277
279}
280
281const css::uno::Sequence< sal_Int8 > & SvxShape::getUnoTunnelId() noexcept
282{
283 static const comphelper::UnoIdInit theSvxShapeUnoTunnelId;
284 return theSvxShapeUnoTunnelId.getSeq();
285}
286
287sal_Int64 SAL_CALL SvxShape::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
288{
289 return comphelper::getSomethingImpl(rId, this);
290}
291
292
294{
295 return mpImpl->maPropertyNotifier;
296}
297
298
300{
301 mpImpl->maPropertyNotifier.registerProvider( svx::ShapePropertyProviderId::Position,
302 std::make_unique<ShapePositionProvider>( *this ) );
303 mpImpl->maPropertyNotifier.registerProvider( svx::ShapePropertyProviderId::Size,
304 std::make_unique<ShapeSizeProvider>( *this ) );
305
306 if ( HasSdrObject() )
307 {
308 StartListening(GetSdrObject()->getSdrModelFromSdrObject());
310 }
311}
312
313
315{
317 OSL_PRECOND( HasSdrObject(), "SvxShape::impl_initFromSdrObject: not to be called without SdrObject!" );
318 if ( !HasSdrObject() )
319 return;
320
321 osl_atomic_increment( &m_refCount );
322 {
323 GetSdrObject()->setUnoShape(this);
324 }
325 osl_atomic_decrement( &m_refCount );
326
327 // #i40944#
328 // Do not simply return when no model but do the type corrections
329 // following below.
330 const SdrInventor nInventor = GetSdrObject()->GetObjInventor();
331
332 // is it one of ours (svx) ?
333 if( !(nInventor == SdrInventor::Default || nInventor == SdrInventor::E3d || nInventor == SdrInventor::FmForm) )
334 return;
335
336 if(nInventor == SdrInventor::FmForm)
337 {
338 mpImpl->mnObjId = SdrObjKind::UNO;
339 }
340 else
341 {
342 mpImpl->mnObjId = GetSdrObject()->GetObjIdentifier();
343 }
344
345 switch(mpImpl->mnObjId)
346 {
347 case SdrObjKind::CircleCut: // segment of circle
348 case SdrObjKind::CircleArc: // arc of circle
349 case SdrObjKind::CircleSection: // sector
351 break;
352 default: ;
353 }
354}
355
356
357void SvxShape::Create( SdrObject* pNewObj, SvxDrawPage* /*pNewPage*/ )
358{
360
361 assert( pNewObj && "SvxShape::Create: invalid new object!" );
362 if ( !pNewObj )
363 return;
364
365 rtl::Reference<SdrObject> pCreatedObj = mpImpl->mxCreatedObj.get();
366 assert( ( !pCreatedObj || ( pCreatedObj == pNewObj ) ) &&
367 "SvxShape::Create: the same shape used for two different objects?! Strange ..." );
368
369 // Correct condition (#i52126#)
370 if ( pCreatedObj == pNewObj )
371 return;
372
373 // Correct condition (#i52126#)
374 mpImpl->mxCreatedObj = pNewObj;
375
376 if( HasSdrObject() )
377 {
378 EndListening( GetSdrObject()->getSdrModelFromSdrObject() );
379 }
380
381 mxSdrObject = pNewObj;
382
383 if( HasSdrObject() )
384 {
385 StartListening( GetSdrObject()->getSdrModelFromSdrObject() );
386 }
387
388 OSL_ENSURE( !mbIsMultiPropertyCall, "SvxShape::Create: hmm?" );
389 // this was previously set in impl_initFromSdrObject, but I think it was superfluous
390 // (it definitely was in the other context where it was called, but I strongly suppose
391 // it was also superfluous when called from here)
393
395
396 // save user call
398 GetSdrObject()->SetUserCall(nullptr);
399
401 setSize( maSize );
402
403 // restore user call after we set the initial size
404 GetSdrObject()->SetUserCall( pUser );
405
406 // if this shape was already named, use this name
407 if( !maShapeName.isEmpty() )
408 {
410 maShapeName.clear();
411 }
412}
413
414void SvxShape::ForceMetricToItemPoolMetric(Pair& rPoint) const noexcept
415{
417 if(!HasSdrObject())
418 return;
419
420 MapUnit eMapUnit(GetSdrObject()->getSdrModelFromSdrObject().GetItemPool().GetMetric(0));
421 if(eMapUnit == MapUnit::Map100thMM)
422 return;
423
424 if (const auto eTo = MapToO3tlLength(eMapUnit); eTo != o3tl::Length::invalid)
425 {
426 rPoint.A() = o3tl::convert(rPoint.A(), o3tl::Length::mm100, eTo);
427 rPoint.B() = o3tl::convert(rPoint.B(), o3tl::Length::mm100, eTo);
428 }
429 else
430 {
431 OSL_FAIL("AW: Missing unit translation to PoolMetric!");
432 }
433}
434
436{
438 if(!HasSdrObject())
439 return;
440
441 GetSdrObject()->ForceMetricToItemPoolMetric(rPolyPolygon);
442}
443
445{
447 if(!HasSdrObject())
448 return;
449
450 MapUnit eMapUnit(GetSdrObject()->getSdrModelFromSdrObject().GetItemPool().GetMetric(0));
451 if(eMapUnit == MapUnit::Map100thMM)
452 return;
453
454 if (const auto eTo = MapToO3tlLength(eMapUnit); eTo != o3tl::Length::invalid)
455 {
456 const double fConvert(o3tl::convert(1.0, o3tl::Length::mm100, eTo));
457 const basegfx::utils::B2DHomMatrixBufferedDecompose aDecomposedTransform(rB2DHomMatrix);
459 aDecomposedTransform.getScale() * fConvert,
460 aDecomposedTransform.getShearX(),
461 aDecomposedTransform.getRotate(),
462 aDecomposedTransform.getTranslate() * fConvert);
463 }
464 else
465 {
466 OSL_FAIL("Missing unit translation to PoolMetric!");
467 }
468}
469
470void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const noexcept
471{
473 if(!HasSdrObject())
474 return;
475
476 MapUnit eMapUnit = GetSdrObject()->getSdrModelFromSdrObject().GetItemPool().GetMetric(0);
477 if(eMapUnit == MapUnit::Map100thMM)
478 return;
479
480 if (const auto eFrom = MapToO3tlLength(eMapUnit); eFrom != o3tl::Length::invalid)
481 {
482 rPoint.A() = o3tl::convert(rPoint.A(), eFrom, o3tl::Length::mm100);
483 rPoint.B() = o3tl::convert(rPoint.B(), eFrom, o3tl::Length::mm100);
484 }
485 else
486 {
487 OSL_FAIL("AW: Missing unit translation to 100th mm!");
488 }
489}
490
492{
494 if(!HasSdrObject())
495 return;
496
497 MapUnit eMapUnit = GetSdrObject()->getSdrModelFromSdrObject().GetItemPool().GetMetric(0);
498 if(eMapUnit == MapUnit::Map100thMM)
499 return;
500
501 if (const auto eFrom = MapToO3tlLength(eMapUnit); eFrom != o3tl::Length::invalid)
502 {
503 const double fConvert(o3tl::convert(1.0, eFrom, o3tl::Length::mm100));
504 rPolyPolygon.transform(basegfx::utils::createScaleB2DHomMatrix(fConvert, fConvert));
505 }
506 else
507 {
508 OSL_FAIL("Missing unit translation to 100th mm!");
509 }
510}
511
513{
515 if(!HasSdrObject())
516 return;
517
518 MapUnit eMapUnit = GetSdrObject()->getSdrModelFromSdrObject().GetItemPool().GetMetric(0);
519 if(eMapUnit == MapUnit::Map100thMM)
520 return;
521
522 if (const auto eFrom = MapToO3tlLength(eMapUnit); eFrom != o3tl::Length::invalid)
523 {
524 const double fConvert(o3tl::convert(1.0, eFrom, o3tl::Length::mm100));
525 const basegfx::utils::B2DHomMatrixBufferedDecompose aDecomposedTransform(rB2DHomMatrix);
527 aDecomposedTransform.getScale() * fConvert,
528 aDecomposedTransform.getShearX(),
529 aDecomposedTransform.getRotate(),
530 aDecomposedTransform.getTranslate() * fConvert);
531 }
532 else
533 {
534 OSL_FAIL("Missing unit translation to 100th mm!");
535 }
536}
537
539 SfxItemSet& rSet, const uno::Reference< beans::XPropertySet >& xSet, const SfxItemPropertyMap* pMap )
540{
541 if(!rAnys.AreThereOwnUsrAnys())
542 return;
543
544 const SfxItemPropertyMap& rSrc = rPropSet.getPropertyMap();
545
546 for(const SfxItemPropertyMapEntry* pSrcProp : rSrc.getPropertyEntries())
547 {
548 const sal_uInt16 nWID = pSrcProp->nWID;
549 if(SfxItemPool::IsWhich(nWID)
550 && (nWID < OWN_ATTR_VALUE_START || nWID > OWN_ATTR_VALUE_END)
551 && rAnys.GetUsrAnyForID(*pSrcProp))
553 }
554
555 for(const SfxItemPropertyMapEntry* pSrcProp : rSrc.getPropertyEntries())
556 {
557 if(pSrcProp->nWID)
558 {
559 uno::Any* pUsrAny = rAnys.GetUsrAnyForID(*pSrcProp);
560 if(pUsrAny)
561 {
562 // search for equivalent entry in pDst
563 const SfxItemPropertyMapEntry* pEntry = pMap->getByName( pSrcProp->aName );
564 if(pEntry)
565 {
566 // entry found
567 if(pEntry->nWID >= OWN_ATTR_VALUE_START && pEntry->nWID <= OWN_ATTR_VALUE_END)
568 {
569 // special ID in PropertySet, can only be set
570 // directly at the object
571 xSet->setPropertyValue( pSrcProp->aName, *pUsrAny);
572 }
573 else
574 {
575 SvxItemPropertySet_setPropertyValue(pEntry, *pUsrAny, rSet);
576 }
577 }
578 }
579 }
580 }
581 rAnys.ClearAllUsrAny();
582}
583
584
586{
589 {
590 SfxItemSetFixed<SDRATTR_START, SDRATTR_END> aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool() );
591 Reference< beans::XPropertySet > xShape(this);
593
595
597 }
598}
599
600uno::Any SvxShape::GetBitmap( bool bMetaFile /* = false */ ) const
601{
603 uno::Any aAny;
604
605 if(!HasSdrObject() || nullptr == GetSdrObject()->getSdrPageFromSdrObject())
606 {
607 return aAny;
608 }
609
610 // tdf#118662 Emulate old behaviour of XclObjComment (see there)
611 const SdrCaptionObj* pSdrCaptionObj(dynamic_cast<SdrCaptionObj*>(GetSdrObject()));
612 if(nullptr != pSdrCaptionObj && pSdrCaptionObj->isSuppressGetBitmap())
613 {
614 return aAny;
615 }
616
617 // tdf#119180 If we do not ask for Metafile and we access a SdrGrafObj,
618 // and content exists and is a Bitmap, take the shortcut.
619 // Do *not* do this for Metafile - as can be seen, requested in that case
620 // is a byte-sequence of a saved WMF format file (see below)
621 if(!bMetaFile)
622 {
623 const SdrGrafObj* pSdrGrafObj(dynamic_cast<SdrGrafObj*>(GetSdrObject()));
624
625 if(nullptr != pSdrGrafObj)
626 {
627 const Graphic& rGraphic(pSdrGrafObj->GetGraphic());
628
629 if(GraphicType::Bitmap == rGraphic.GetType())
630 {
631 Reference< awt::XBitmap > xBmp( rGraphic.GetXGraphic(), UNO_QUERY );
632 aAny <<= xBmp;
633
634 return aAny;
635 }
636 }
637 }
638
639 // tdf#118662 instead of creating an E3dView instance every time to paint
640 // a single SdrObject, use the existing SdrObject::SingleObjectPainter to
641 // use less resources and runtime
642 if(bMetaFile)
643 {
645 const tools::Rectangle aBoundRect(GetSdrObject()->GetCurrentBoundRect());
646 GDIMetaFile aMtf;
647
648 pVDev->SetMapMode(MapMode(MapUnit::Map100thMM));
649 pVDev->EnableOutput(false);
650 aMtf.Record(pVDev);
652 aMtf.Stop();
653 aMtf.WindStart();
654 aMtf.Move(-aBoundRect.Left(), -aBoundRect.Top());
655 aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM));
656 aMtf.SetPrefSize(aBoundRect.GetSize());
657
658 SvMemoryStream aDestStrm(65535, 65535);
659
661 aMtf,
662 aDestStrm,
663 nullptr,
664 false);
665
666 const uno::Sequence<sal_Int8> aSeq(
667 static_cast< const sal_Int8* >(aDestStrm.GetData()),
668 aDestStrm.GetEndOfData());
669
670 aAny <<= aSeq;
671 }
672 else
673 {
676
677 if(!xPrimitives.empty())
678 {
679 const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
680 basegfx::B2DRange aRange(
681 xPrimitives.getB2DRange(aViewInformation2D));
682
683 if(!aRange.isEmpty())
684 {
685 const MapUnit aSourceMapUnit(GetSdrObject()->getSdrModelFromSdrObject().GetScaleUnit());
686
687 if(MapUnit::Map100thMM != aSourceMapUnit)
688 {
689 // tdf#119180 This is UNO API and thus works in 100th_mm,
690 // so if the MapMode from the used SdrModel is *not* equal
691 // to Map100thMM we need to embed the primitives to an adapting
692 // homogen transformation for correct values
693 const basegfx::B2DHomMatrix aMapTransform(
695 MapMode(aSourceMapUnit),
696 MapMode(MapUnit::Map100thMM)));
697
698 // Embed primitives to get them in 100th mm
701 aMapTransform,
702 std::move(xPrimitives)));
703
704 xPrimitives = drawinglayer::primitive2d::Primitive2DContainer { xEmbedRef };
705
706 // Update basegfx::B2DRange aRange, too. Here we have the
707 // choice of transforming the existing value or get newly by
708 // again using 'xPrimitives.getB2DRange(aViewInformation2D)'
709 aRange.transform(aMapTransform);
710 }
711
712 const BitmapEx aBmp(
714 std::move(xPrimitives),
715 aRange));
716
717 Graphic aGraph(aBmp);
718
719 aGraph.SetPrefSize(aBmp.GetPrefSize());
720 aGraph.SetPrefMapMode(aBmp.GetPrefMapMode());
721
722 Reference< awt::XBitmap > xBmp( aGraph.GetXGraphic(), UNO_QUERY );
723 aAny <<= xBmp;
724 }
725 }
726 }
727
728 return aAny;
729}
730
731uno::Sequence< uno::Type > SAL_CALL SvxShape::getTypes()
732{
733 if( mpImpl->mpMaster )
734 {
735 return mpImpl->mpMaster->getTypes();
736 }
737 else
738 {
739 return _getTypes();
740 }
741}
742
743
744uno::Sequence< uno::Type > const & SvxShape::_getTypes()
745{
746 switch( mpImpl->mnObjId )
747 {
748 // shapes without text
749 case SdrObjKind::Page:
760 {
761 static uno::Sequence<uno::Type> aTypeSequence{
774 };
775
776 return aTypeSequence;
777 }
778 // group shape
780 {
781 static uno::Sequence<uno::Type> aTypeSequence{
796 };
797
798 return aTypeSequence;
799 }
800 // connector shape
801 case SdrObjKind::Edge:
802 {
803 static uno::Sequence<uno::Type> aTypeSequence{
817 // from SvxUnoTextBase::getTypes()
822 };
823
824 return aTypeSequence;
825 }
826 // control shape
827 case SdrObjKind::UNO:
828 {
829 static uno::Sequence<uno::Type> aTypeSequence{
843 };
844
845 return aTypeSequence;
846 }
847 // 3d scene shape
849 {
850 static uno::Sequence<uno::Type> aTypeSequence{
864 };
865
866 return aTypeSequence;
867 }
869 {
870 static uno::Sequence<uno::Type> aTypeSequence{
883 // from SvxUnoTextBase::getTypes()
888 };
889
890 return aTypeSequence;
891 }
892 // shapes with text
896 case SdrObjKind::Line:
906 case SdrObjKind::Text:
908 case SdrObjKind::OLE2: // #i118485# Moved to shapes with text
909 default:
910 {
911 static uno::Sequence<uno::Type> aTypeSequence{
924 // from SvxUnoTextBase::getTypes()
929 };
930
931 return aTypeSequence;
932 }
933 }
934}
935
936
937uno::Sequence< sal_Int8 > SAL_CALL SvxShape::getImplementationId()
938{
939 return css::uno::Sequence<sal_Int8>();
940}
941
942void SvxShape::Notify( SfxBroadcaster&, const SfxHint& rHint ) noexcept
943{
945
946 // do cheap checks first, this method is hot
947 if (rHint.GetId() != SfxHintId::ThisIsAnSdrHint)
948 return;
949 rtl::Reference<SdrObject> pSdrObject(mxSdrObject);
950 if( !pSdrObject )
951 return;
952 const SdrHint* pSdrHint = static_cast<const SdrHint*>(&rHint);
953 // #i55919# SdrHintKind::ObjectChange is only interesting if it's for this object
954 if ((pSdrHint->GetKind() != SdrHintKind::ModelCleared) &&
955 (pSdrHint->GetKind() != SdrHintKind::ObjectChange || pSdrHint->GetObject() != pSdrObject.get() ))
956 return;
957
958 uno::Reference< uno::XInterface > xSelf( pSdrObject->getWeakUnoShape() );
959 if( !xSelf.is() )
960 {
961 EndListening(pSdrObject->getSdrModelFromSdrObject());
962 mxSdrObject.clear();
963 return;
964 }
965
966 if (pSdrHint->GetKind() == SdrHintKind::ObjectChange)
967 {
968 updateShapeKind();
969 }
970 else // (pSdrHint->GetKind() == SdrHintKind::ModelCleared)
971 {
972 EndListening(pSdrObject->getSdrModelFromSdrObject());
973 pSdrObject->setUnoShape(nullptr);
974 pSdrObject.clear();
975 mxSdrObject.clear();
976
977 if(!mpImpl->mbDisposing)
978 dispose();
979 }
980}
981
982// XShape
983
984
985// The "*LogicRectHack" functions also existed in sch, and those
986// duplicate symbols cause Bad Things To Happen (TM) #i9462#.
987// Prefixing with 'svx' and marking static to make sure name collisions
988// do not occur.
989
990static bool svx_needLogicRectHack( SdrObject const * pObj )
991{
993 {
994 switch(pObj->GetObjIdentifier())
995 {
997 case SdrObjKind::Line:
1004 case SdrObjKind::Edge:
1008 return true;
1009 default:
1010 break;
1011 }
1012 }
1013 return false;
1014}
1015
1016
1018{
1019 if(svx_needLogicRectHack(pObj))
1020 {
1021 return pObj->GetSnapRect();
1022 }
1023 else
1024 {
1025 return pObj->GetLogicRect();
1026 }
1027}
1028
1029
1030static void svx_setLogicRectHack( SdrObject* pObj, const tools::Rectangle& rRect )
1031{
1032 if(svx_needLogicRectHack(pObj))
1033 {
1034 pObj->SetSnapRect( rRect );
1035 }
1036 else
1037 {
1038 pObj->SetLogicRect( rRect );
1039 }
1040}
1041
1042
1043awt::Point SAL_CALL SvxShape::getPosition()
1044{
1045 ::SolarMutexGuard aGuard;
1046
1047 if(HasSdrObject())
1048 {
1050 Point aPt( aRect.Left(), aRect.Top() );
1051
1052 // Position is relative to anchor, so recalc to absolute position
1053 if( GetSdrObject()->getSdrModelFromSdrObject().IsWriter() )
1054 aPt -= GetSdrObject()->GetAnchorPos();
1055
1057 return css::awt::Point( aPt.X(), aPt.Y() );
1058 }
1059 else
1060 {
1061 return maPosition;
1062 }
1063}
1064
1065
1066void SAL_CALL SvxShape::setPosition( const awt::Point& Position )
1067{
1068 ::SolarMutexGuard aGuard;
1069
1070 if(HasSdrObject())
1071 {
1072 // do NOT move 3D objects, this would change the homogen
1073 // transformation matrix
1074 if(dynamic_cast<const E3dCompoundObject* >(GetSdrObject()) == nullptr)
1075 {
1077 Point aLocalPos( Position.X, Position.Y );
1078 ForceMetricToItemPoolMetric(aLocalPos);
1079
1080 // Position is absolute, so recalc to position relative to anchor
1081 if( GetSdrObject()->getSdrModelFromSdrObject().IsWriter() )
1082 aLocalPos += GetSdrObject()->GetAnchorPos();
1083
1084 tools::Long nDX = aLocalPos.X() - aRect.Left();
1085 tools::Long nDY = aLocalPos.Y() - aRect.Top();
1086
1087 GetSdrObject()->Move( Size( nDX, nDY ) );
1089 }
1090 }
1091
1093}
1094
1095
1096awt::Size SAL_CALL SvxShape::getSize()
1097{
1098 ::SolarMutexGuard aGuard;
1099
1100 if(HasSdrObject())
1101 {
1103 Size aObjSize( aRect.getOpenWidth(), aRect.getOpenHeight() );
1104 ForceMetricTo100th_mm(aObjSize);
1105 return css::awt::Size( aObjSize.getWidth(), aObjSize.getHeight() );
1106 }
1107 else
1108 return maSize;
1109}
1110
1111
1112void SAL_CALL SvxShape::setSize( const awt::Size& rSize )
1113{
1114 ::SolarMutexGuard aGuard;
1115
1116 if(HasSdrObject())
1117 {
1119 Size aLocalSize( rSize.Width, rSize.Height );
1120 ForceMetricToItemPoolMetric(aLocalSize);
1121
1122 if(GetSdrObject()->GetObjInventor() == SdrInventor::Default && GetSdrObject()->GetObjIdentifier() == SdrObjKind::Measure )
1123 {
1124 Fraction aWdt(aLocalSize.Width(),aRect.Right()-aRect.Left());
1125 Fraction aHgt(aLocalSize.Height(),aRect.Bottom()-aRect.Top());
1127 GetSdrObject()->Resize(aPt,aWdt,aHgt);
1128 }
1129 else
1130 {
1131 //aRect.SetSize(aLocalSize); // this call subtract 1 // https://bz.apache.org/ooo/show_bug.cgi?id=83193
1132 if ( !aLocalSize.Width() )
1133 {
1134 aRect.SetWidthEmpty();
1135 }
1136 else
1137 aRect.setWidth(aLocalSize.Width());
1138 if ( !aLocalSize.Height() )
1139 {
1140 aRect.SetHeightEmpty();
1141 }
1142 else
1143 aRect.setHeight(aLocalSize.Height());
1144
1146 }
1147
1149 }
1150 maSize = rSize;
1151}
1152
1153
1154// XNamed
1155OUString SAL_CALL SvxShape::getName( )
1156{
1157 ::SolarMutexGuard aGuard;
1158 if( HasSdrObject() )
1159 {
1160 return GetSdrObject()->GetName();
1161 }
1162 else
1163 {
1164 return maShapeName;
1165 }
1166}
1167
1168
1169void SAL_CALL SvxShape::setName( const OUString& aName )
1170{
1171 ::SolarMutexGuard aGuard;
1172 if( HasSdrObject() )
1173 {
1175 }
1176 else
1177 {
1179 }
1180}
1181
1182// XShapeDescriptor
1183
1184
1185OUString SAL_CALL SvxShape::getShapeType()
1186{
1187 if( !maShapeType.getLength() )
1188 return UHashMap::getNameFromId( mpImpl->mnObjId );
1189 else
1190 return maShapeType;
1191}
1192
1193// XComponent
1194
1195
1196void SAL_CALL SvxShape::dispose()
1197{
1198 ::SolarMutexGuard aGuard;
1199
1200 if( mpImpl->mbDisposing )
1201 return; // caught a recursion
1202
1203 mpImpl->mbDisposing = true;
1204
1205 lang::EventObject aEvt;
1206 aEvt.Source = *static_cast<OWeakAggObject*>(this);
1207 mpImpl->maDisposeListeners.disposeAndClear(aEvt);
1208 mpImpl->maPropertyNotifier.disposing();
1209
1211 if (!pObject)
1212 return;
1213
1214 EndListening( pObject->getSdrModelFromSdrObject() );
1215
1216 if ( pObject->IsInserted() && pObject->getSdrPageFromSdrObject() )
1217 {
1218 SdrPage* pPage = pObject->getSdrPageFromSdrObject();
1219 // delete the SdrObject from the page
1220 const size_t nCount = pPage->GetObjCount();
1221 for ( size_t nNum = 0; nNum < nCount; ++nNum )
1222 {
1223 if ( pPage->GetObj( nNum ) == pObject.get() )
1224 {
1225 OSL_VERIFY( pPage->RemoveObject( nNum ) == pObject );
1226 break;
1227 }
1228 }
1229 }
1230
1231 mxSdrObject.clear();
1232 pObject->setUnoShape(nullptr);
1233}
1234
1235
1236void SAL_CALL SvxShape::addEventListener( const Reference< lang::XEventListener >& xListener )
1237{
1238 mpImpl->maDisposeListeners.addInterface(xListener);
1239}
1240
1241
1242void SAL_CALL SvxShape::removeEventListener( const Reference< lang::XEventListener >& aListener )
1243{
1244 mpImpl->maDisposeListeners.removeInterface(aListener);
1245}
1246
1247// XPropertySet
1248
1249
1250Reference< beans::XPropertySetInfo > SAL_CALL
1252{
1253 if( mpImpl->mpMaster )
1254 {
1255 return mpImpl->mpMaster->getPropertySetInfo();
1256 }
1257 else
1258 {
1259 return _getPropertySetInfo();
1260 }
1261}
1262
1263Reference< beans::XPropertySetInfo > const &
1265{
1266 return mpPropSet->getPropertySetInfo();
1267}
1268
1269
1270void SAL_CALL SvxShape::addPropertyChangeListener( const OUString& _propertyName, const Reference< beans::XPropertyChangeListener >& _listener )
1271{
1272 ::osl::MutexGuard aGuard( m_aMutex );
1273 mpImpl->maPropertyNotifier.addPropertyChangeListener( _propertyName, _listener );
1274}
1275
1276
1277void SAL_CALL SvxShape::removePropertyChangeListener( const OUString& _propertyName, const Reference< beans::XPropertyChangeListener >& _listener )
1278{
1279 ::osl::MutexGuard aGuard( m_aMutex );
1280 mpImpl->maPropertyNotifier.removePropertyChangeListener( _propertyName, _listener );
1281}
1282
1283
1284void SAL_CALL SvxShape::addVetoableChangeListener( const OUString& , const Reference< beans::XVetoableChangeListener >& )
1285{
1286 OSL_FAIL( "SvxShape::addVetoableChangeListener: don't have any vetoable properties, so why ...?" );
1287}
1288
1289
1290void SAL_CALL SvxShape::removeVetoableChangeListener( const OUString& , const Reference< beans::XVetoableChangeListener >& )
1291{
1292 OSL_FAIL( "SvxShape::removeVetoableChangeListener: don't have any vetoable properties, so why ...?" );
1293}
1294
1295
1296bool SvxShape::SetFillAttribute( sal_uInt16 nWID, const OUString& rName )
1297{
1298 if(HasSdrObject())
1299 {
1300 SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), nWID, nWID );
1301
1302 if( SetFillAttribute( nWID, rName, aSet, &GetSdrObject()->getSdrModelFromSdrObject() ) )
1303 {
1304 //GetSdrObject()->SetItemSetAndBroadcast(aSet);
1306
1307 return true;
1308 }
1309 }
1310
1311 return false;
1312}
1313
1314
1315bool SvxShape::SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet, SdrModel const * pModel )
1316{
1317 // check if an item with the given name and which id is inside the models
1318 // pool or the stylesheet pool, if found it's put in the itemset
1319 if( !SetFillAttribute( nWID, rName, rSet ) )
1320 {
1321 // we did not find such item in one of the pools, so we check
1322 // the property lists that are loaded for the model for items
1323 // that support such.
1324 OUString aStrName = SvxUnogetInternalNameForItem(nWID, rName);
1325
1326 switch( nWID )
1327 {
1328 case XATTR_FILLBITMAP:
1329 {
1330 XBitmapListRef pBitmapList = pModel->GetBitmapList();
1331
1332 if( !pBitmapList.is() )
1333 return false;
1334
1335 tools::Long nPos = pBitmapList->GetIndex(aStrName);
1336 if( nPos == -1 )
1337 return false;
1338
1339 const XBitmapEntry* pEntry = pBitmapList->GetBitmap(nPos);
1340 XFillBitmapItem aBmpItem(rName, pEntry->GetGraphicObject());
1341 rSet.Put(aBmpItem);
1342 break;
1343 }
1344 case XATTR_FILLGRADIENT:
1345 {
1346 XGradientListRef pGradientList = pModel->GetGradientList();
1347
1348 if( !pGradientList.is() )
1349 return false;
1350
1351 tools::Long nPos = pGradientList->GetIndex(aStrName);
1352 if( nPos == -1 )
1353 return false;
1354
1355 const XGradientEntry* pEntry = pGradientList->GetGradient(nPos);
1356 XFillGradientItem aGrdItem(rName, pEntry->GetGradient());
1357 rSet.Put( aGrdItem );
1358 break;
1359 }
1360 case XATTR_FILLHATCH:
1361 {
1362 XHatchListRef pHatchList = pModel->GetHatchList();
1363
1364 if( !pHatchList.is() )
1365 return false;
1366
1367 tools::Long nPos = pHatchList->GetIndex(aStrName);
1368 if( nPos == -1 )
1369 return false;
1370
1371 const XHatchEntry* pEntry = pHatchList->GetHatch( nPos );
1372 XFillHatchItem aHatchItem(rName, pEntry->GetHatch());
1373 rSet.Put( aHatchItem );
1374 break;
1375 }
1376 case XATTR_LINEEND:
1377 case XATTR_LINESTART:
1378 {
1379 XLineEndListRef pLineEndList = pModel->GetLineEndList();
1380
1381 if( !pLineEndList.is() )
1382 return false;
1383
1384 tools::Long nPos = pLineEndList->GetIndex(aStrName);
1385 if( nPos == -1 )
1386 return false;
1387
1388 const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nPos);
1389 if( sal_uInt16(XATTR_LINEEND) == nWID )
1390 {
1391 XLineEndItem aLEItem(rName, pEntry->GetLineEnd());
1392 rSet.Put( aLEItem );
1393 }
1394 else
1395 {
1396 XLineStartItem aLSItem(rName, pEntry->GetLineEnd());
1397 rSet.Put( aLSItem );
1398 }
1399
1400 break;
1401 }
1402 case XATTR_LINEDASH:
1403 {
1404 XDashListRef pDashList = pModel->GetDashList();
1405
1406 if( !pDashList.is() )
1407 return false;
1408
1409 tools::Long nPos = pDashList->GetIndex(aStrName);
1410 if( nPos == -1 )
1411 return false;
1412
1413 const XDashEntry* pEntry = pDashList->GetDash(nPos);
1414 XLineDashItem aDashItem(rName, pEntry->GetDash());
1415 rSet.Put( aDashItem );
1416 break;
1417 }
1418 default:
1419 return false;
1420 }
1421 }
1422
1423 return true;
1424}
1425
1426
1427bool SvxShape::SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet )
1428{
1429 OUString aName = SvxUnogetInternalNameForItem(nWID, rName);
1430
1431 if (aName.isEmpty())
1432 {
1433 switch( nWID )
1434 {
1435 case XATTR_LINEEND:
1436 case XATTR_LINESTART:
1437 {
1438 const basegfx::B2DPolyPolygon aEmptyPoly;
1439 if( nWID == sal_uInt16(XATTR_LINEEND) )
1440 rSet.Put( XLineEndItem( "", aEmptyPoly ) );
1441 else
1442 rSet.Put( XLineStartItem( "", aEmptyPoly ) );
1443
1444 return true;
1445 }
1447 {
1448 // #85953# Set a disabled XFillFloatTransparenceItem
1450
1451 return true;
1452 }
1453 }
1454
1455 return false;
1456 }
1457
1458 for (const SfxPoolItem* p : rSet.GetPool()->GetItemSurrogates(nWID))
1459 {
1460 const NameOrIndex* pItem = static_cast<const NameOrIndex*>(p);
1461 if( pItem->GetName() == aName )
1462 {
1463 rSet.Put( *pItem );
1464 return true;
1465 }
1466 }
1467
1468 return false;
1469}
1470
1471
1472void SAL_CALL SvxShape::setPropertyValue( const OUString& rPropertyName, const uno::Any& rVal )
1473{
1474 if( mpImpl->mpMaster )
1475 {
1476 mpImpl->mpMaster->setPropertyValue( rPropertyName, rVal );
1477 }
1478 else
1479 {
1480 _setPropertyValue( rPropertyName, rVal );
1481 }
1482}
1483
1484void SvxShape::_setPropertyValue( const OUString& rPropertyName, const uno::Any& rVal )
1485{
1486 ::SolarMutexGuard aGuard;
1487
1488 const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry(rPropertyName);
1489
1490 if (!HasSdrObject())
1491 {
1492 // Since we have no actual sdr object right now, remember all
1493 // properties in a list. These properties will be set when the sdr
1494 // object is created.
1495
1496 if (pMap && pMap->nWID)
1497 {
1498 // FIXME: We should throw a UnknownPropertyException here.
1499 // But since this class is aggregated from classes that
1500 // support additional properties that we don't know here we
1501 // silently store *all* properties, even if they may be not
1502 // supported after creation.
1504 }
1505
1506 return;
1507 }
1508
1509 if (rPropertyName == "HandlePathObjScale")
1510 {
1511 auto pPathObj = dynamic_cast<SdrPathObj*>(GetSdrObject());
1512 if (pPathObj)
1513 {
1514 bool bHandleScale{};
1515 if (rVal >>= bHandleScale)
1516 {
1517 pPathObj->SetHandleScale(bHandleScale);
1518 }
1519 }
1520 return;
1521 }
1522
1523 if (!pMap)
1524 {
1525 // reduce log noise by ignoring two properties that higher level code queries for on all objects
1526 SAL_WARN_IF(rPropertyName != "FromWordArt" && rPropertyName != "GraphicColorMode",
1527 "svx.uno", "Unknown Property: " << rPropertyName);
1528 throw beans::UnknownPropertyException( rPropertyName, static_cast<cppu::OWeakObject*>(this));
1529 }
1530
1531 if ((pMap->nFlags & beans::PropertyAttribute::READONLY) != 0)
1532 throw beans::PropertyVetoException(
1533 "Readonly property can't be set: " + rPropertyName,
1534 uno::Reference<drawing::XShape>(this));
1535
1537
1538 if (setPropertyValueImpl(rPropertyName, pMap, rVal))
1539 return;
1540
1541 DBG_ASSERT( pMap->nWID == SDRATTR_TEXTDIRECTION || pMap->nWID < SDRATTR_NOTPERSIST_FIRST || pMap->nWID > SDRATTR_NOTPERSIST_LAST, "Not persist item not handled!" );
1542 DBG_ASSERT( pMap->nWID < OWN_ATTR_VALUE_START || pMap->nWID > OWN_ATTR_VALUE_END, "Not item property not handled!" );
1543
1544 bool bIsNotPersist = pMap->nWID >= SDRATTR_NOTPERSIST_FIRST && pMap->nWID <= SDRATTR_NOTPERSIST_LAST && pMap->nWID != SDRATTR_TEXTDIRECTION;
1545
1546 if( pMap->nWID == SDRATTR_CORNER_RADIUS )
1547 {
1548 sal_Int32 nCornerRadius = 0;
1549 if( !(rVal >>= nCornerRadius) || (nCornerRadius < 0) || (nCornerRadius > 5000000))
1550 throw IllegalArgumentException();
1551 }
1552
1553 std::optional<SfxItemSet> xLocalSet;
1554 SfxItemSet* pSet;
1555 if( mbIsMultiPropertyCall && !bIsNotPersist )
1556 {
1557 if( !mpImpl->mxItemSet )
1558 {
1559 mpImpl->mxItemSet.emplace( GetSdrObject()->GetProperties().CreateObjectSpecificItemSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool() ) );
1560 }
1561 pSet = &*mpImpl->mxItemSet;
1562 }
1563 else
1564 {
1565 xLocalSet.emplace( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID);
1566 pSet = &*xLocalSet;
1567 }
1568
1569 if( pSet->GetItemState( pMap->nWID ) != SfxItemState::SET )
1570 pSet->Put(GetSdrObject()->GetMergedItem(pMap->nWID));
1571
1572 if( !SvxUnoTextRangeBase::SetPropertyValueHelper( pMap, rVal, *pSet ))
1573 {
1574 if( pSet->GetItemState( pMap->nWID ) != SfxItemState::SET )
1575 {
1576 if(bIsNotPersist)
1577 {
1578 // not-persistent attribute, get those extra
1580 }
1581 }
1582
1583 if( pSet->GetItemState( pMap->nWID ) != SfxItemState::SET )
1584 {
1585 // get default from ItemPool
1586 if(SfxItemPool::IsWhich(pMap->nWID))
1587 pSet->Put(GetSdrObject()->getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
1588 }
1589
1590 if( pSet->GetItemState( pMap->nWID ) == SfxItemState::SET )
1591 {
1592 SvxItemPropertySet_setPropertyValue( pMap, rVal, *pSet );
1593 }
1594 }
1595
1596 if(bIsNotPersist)
1597 {
1598 // set not-persistent attribute extra
1600 }
1601 else
1602 {
1603 // if we have a XMultiProperty call then the item set
1604 // will be set in setPropertyValues later
1607 }
1608}
1609
1610
1611uno::Any SAL_CALL SvxShape::getPropertyValue( const OUString& PropertyName )
1612{
1613 if ( mpImpl->mpMaster )
1614 return mpImpl->mpMaster->getPropertyValue( PropertyName );
1615 else
1616 return _getPropertyValue( PropertyName );
1617}
1618
1619
1620uno::Any SvxShape::_getPropertyValue( const OUString& PropertyName )
1621{
1622 ::SolarMutexGuard aGuard;
1623
1624 const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName);
1625
1626 uno::Any aAny;
1627 if(HasSdrObject())
1628 {
1629 if(pMap == nullptr )
1630 throw beans::UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this));
1631
1632 if( !getPropertyValueImpl( PropertyName, pMap, aAny ) )
1633 {
1634 DBG_ASSERT( pMap->nWID == SDRATTR_TEXTDIRECTION || (pMap->nWID < SDRATTR_NOTPERSIST_FIRST || pMap->nWID > SDRATTR_NOTPERSIST_LAST), "Not persist item not handled!" );
1635 DBG_ASSERT( pMap->nWID < OWN_ATTR_VALUE_START || pMap->nWID > OWN_ATTR_VALUE_END, "Not item property not handled!" );
1636
1637 SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID );
1638 aSet.Put(GetSdrObject()->GetMergedItem(pMap->nWID));
1639
1640 if(SvxUnoTextRangeBase::GetPropertyValueHelper( aSet, pMap, aAny ))
1641 return aAny;
1642
1643 if(!aSet.Count())
1644 {
1646 {
1647 // not-persistent attribute, get those extra
1649 }
1650 }
1651
1652 if(!aSet.Count())
1653 {
1654 // get default from ItemPool
1655 if(SfxItemPool::IsWhich(pMap->nWID))
1656 aSet.Put(GetSdrObject()->getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
1657 }
1658
1659 if(aSet.Count())
1660 aAny = GetAnyForItem( aSet, pMap );
1661 }
1662 }
1663 else
1664 {
1665
1666// Fixme: we should return default values for OWN_ATTR !
1667
1668 if(pMap && pMap->nWID)
1669// FixMe: see setPropertyValue
1670 aAny = mpPropSet->getPropertyValue( pMap, maUrsAnys );
1671
1672 }
1673 return aAny;
1674}
1675
1676
1677// XMultiPropertySet
1678void SAL_CALL SvxShape::setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues )
1679{
1680 ::SolarMutexGuard aSolarGuard;
1681
1682 const sal_Int32 nCount = aPropertyNames.getLength();
1683 if (nCount != aValues.getLength())
1684 throw css::lang::IllegalArgumentException("lengths do not match",
1685 static_cast<cppu::OWeakObject*>(this), -1);
1686
1687 const OUString* pNames = aPropertyNames.getConstArray();
1688 const uno::Any* pValues = aValues.getConstArray();
1689
1690 // make sure mbIsMultiPropertyCall and mpImpl->mpItemSet are
1691 // reset even when an exception is thrown
1692 const ::comphelper::ScopeGuard aGuard( [this] () { return this->endSetPropertyValues(); } );
1693
1694 mbIsMultiPropertyCall = true;
1695
1696 if( mpImpl->mpMaster )
1697 {
1698 for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++, pNames++, pValues++ )
1699 {
1700 try
1701 {
1702 setPropertyValue( *pNames, *pValues );
1703 }
1704 catch (beans::UnknownPropertyException&)
1705 {
1707 }
1708 catch (uno::Exception&)
1709 {
1711 }
1712 }
1713 }
1714 else
1715 {
1716 uno::Reference< beans::XPropertySet > xSet;
1718
1719 for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++, pNames++, pValues++ )
1720 {
1721 try
1722 {
1723 xSet->setPropertyValue( *pNames, *pValues );
1724 }
1725 catch (beans::UnknownPropertyException&)
1726 {
1728 }
1729 catch (uno::Exception&)
1730 {
1732 }
1733 }
1734 }
1735
1736 if( mpImpl->mxItemSet && HasSdrObject() )
1738}
1739
1740
1742{
1743 mbIsMultiPropertyCall = false;
1744 mpImpl->mxItemSet.reset();
1745}
1746
1747
1748css::uno::Sequence< css::uno::Any > SAL_CALL SvxShape::getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames )
1749{
1750 const sal_Int32 nCount = aPropertyNames.getLength();
1751 const OUString* pNames = aPropertyNames.getConstArray();
1752
1753 uno::Sequence< uno::Any > aRet( nCount );
1754 uno::Any* pValue = aRet.getArray();
1755
1756 if( mpImpl->mpMaster )
1757 {
1758 for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++, pValue++, pNames++ )
1759 {
1760 try
1761 {
1762 *pValue = getPropertyValue( *pNames );
1763 }
1764 catch( uno::Exception& )
1765 {
1766 OSL_FAIL( "SvxShape::getPropertyValues, unknown property asked" );
1767 }
1768 }
1769 }
1770 else
1771 {
1772 uno::Reference< beans::XPropertySet > xSet;
1774
1775 for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++, pValue++, pNames++ )
1776 {
1777 try
1778 {
1779 *pValue = xSet->getPropertyValue( *pNames );
1780 }
1781 catch( uno::Exception& )
1782 {
1783 OSL_FAIL( "SvxShape::getPropertyValues, unknown property asked" );
1784 }
1785 }
1786 }
1787
1788 return aRet;
1789}
1790
1791void SAL_CALL SvxShape::addPropertiesChangeListener( const css::uno::Sequence< OUString >& , const css::uno::Reference< css::beans::XPropertiesChangeListener >& )
1792{
1793}
1794
1795void SAL_CALL SvxShape::removePropertiesChangeListener( const css::uno::Reference< css::beans::XPropertiesChangeListener >& )
1796{
1797}
1798
1799void SAL_CALL SvxShape::firePropertiesChangeEvent( const css::uno::Sequence< OUString >& , const css::uno::Reference< css::beans::XPropertiesChangeListener >& )
1800{
1801}
1802
1803
1805{
1807 uno::Any aAny;
1808
1809 switch(pMap->nWID)
1810 {
1812 {
1813 if(const SdrAngleItem* pPoolItem = aSet.GetItemIfSet(SDRATTR_CIRCSTARTANGLE,false))
1814 {
1815 Degree100 nAngle = pPoolItem->GetValue();
1816 aAny <<= nAngle.get();
1817 }
1818 break;
1819 }
1820
1822 {
1823 if (const SdrAngleItem* pPoolItem = aSet.GetItemIfSet(SDRATTR_CIRCENDANGLE,false))
1824 {
1825 Degree100 nAngle = pPoolItem->GetValue();
1826 aAny <<= nAngle.get();
1827 }
1828 break;
1829 }
1830
1831 case SDRATTR_CIRCKIND:
1832 {
1833 if( GetSdrObject()->GetObjInventor() == SdrInventor::Default)
1834 {
1835 drawing::CircleKind eKind;
1836 switch(GetSdrObject()->GetObjIdentifier())
1837 {
1838 case SdrObjKind::CircleOrEllipse: // circle, ellipse
1839 eKind = drawing::CircleKind_FULL;
1840 break;
1841 case SdrObjKind::CircleCut: // segment of circle
1842 eKind = drawing::CircleKind_CUT;
1843 break;
1844 case SdrObjKind::CircleArc: // arc of circle
1845 eKind = drawing::CircleKind_ARC;
1846 break;
1847 case SdrObjKind::CircleSection: // sector
1848 eKind = drawing::CircleKind_SECTION;
1849 break;
1850 default:
1851 break;
1852 }
1853 aAny <<= eKind;
1854 }
1855 break;
1856 }
1857 default:
1858 {
1859 // get value from ItemSet
1860 aAny = SvxItemPropertySet_getPropertyValue( pMap, aSet );
1861
1862 if( pMap->aType != aAny.getValueType() )
1863 {
1864 // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here
1865 if( ( pMap->aType == ::cppu::UnoType<sal_Int16>::get()) && aAny.getValueType() == ::cppu::UnoType<sal_Int32>::get() )
1866 {
1867 sal_Int32 nValue = 0;
1868 aAny >>= nValue;
1869 aAny <<= static_cast<sal_Int16>(nValue);
1870 }
1871 else
1872 {
1873 OSL_FAIL("SvxShape::GetAnyForItem() Returnvalue has wrong Type!" );
1874 }
1875 }
1876
1877 }
1878 }
1879
1880 return aAny;
1881}
1882
1883
1884// XPropertyState
1885beans::PropertyState SAL_CALL SvxShape::getPropertyState( const OUString& PropertyName )
1886{
1887 if( mpImpl->mpMaster )
1888 {
1889 return mpImpl->mpMaster->getPropertyState( PropertyName );
1890 }
1891 else
1892 {
1893 return _getPropertyState( PropertyName );
1894 }
1895}
1896
1897beans::PropertyState SvxShape::_getPropertyState( const OUString& PropertyName )
1898{
1899 ::SolarMutexGuard aGuard;
1900
1901 const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName);
1902
1903 if( !HasSdrObject() || pMap == nullptr )
1904 throw beans::UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this));
1905
1906 beans::PropertyState eState;
1907 if( !getPropertyStateImpl( pMap, eState ) )
1908 {
1910
1911 switch( rSet.GetItemState( pMap->nWID, false ) )
1912 {
1913 case SfxItemState::SET:
1914 eState = beans::PropertyState_DIRECT_VALUE;
1915 break;
1916 case SfxItemState::DEFAULT:
1917 eState = beans::PropertyState_DEFAULT_VALUE;
1918 break;
1919 default:
1920 eState = beans::PropertyState_AMBIGUOUS_VALUE;
1921 break;
1922 }
1923
1924 // if an item is set, this doesn't mean we want it :)
1925 if( beans::PropertyState_DIRECT_VALUE == eState )
1926 {
1927 switch( pMap->nWID )
1928 {
1929 // the following items are disabled by changing the
1930 // fill style or the line style. so there is no need
1931 // to export items without names which should be empty
1932 case XATTR_FILLBITMAP:
1933 case XATTR_FILLGRADIENT:
1934 case XATTR_FILLHATCH:
1935 case XATTR_LINEDASH:
1936 {
1937 const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>(pMap->nWID);
1938 if( ( pItem == nullptr ) || pItem->GetName().isEmpty() )
1939 eState = beans::PropertyState_DEFAULT_VALUE;
1940 }
1941 break;
1942
1943 // #i36115#
1944 // If e.g. the LineStart is on NONE and thus the string has length 0, it still
1945 // may be a hard attribute covering the set LineStart of the parent (Style).
1946 // #i37644#
1947 // same is for fill float transparency
1948 case XATTR_LINEEND:
1949 case XATTR_LINESTART:
1951 {
1952 const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>(pMap->nWID);
1953 if ( pItem == nullptr )
1954 eState = beans::PropertyState_DEFAULT_VALUE;
1955 }
1956 break;
1957 case XATTR_FILLCOLOR:
1958 if (pMap->nMemberId == MID_COLOR_THEME_INDEX)
1959 {
1960 const XFillColorItem* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
1962 {
1963 eState = beans::PropertyState_DEFAULT_VALUE;
1964 }
1965 }
1966 else if (pMap->nMemberId == MID_COLOR_LUM_MOD)
1967 {
1968 const XFillColorItem* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
1969 sal_Int16 nLumMod = 10000;
1970 for (auto const& rTransform : pColor->GetThemeColor().getTransformations())
1971 {
1972 if (rTransform.meType == model::TransformationType::LumMod)
1973 nLumMod = rTransform.mnValue;
1974 }
1975 if (nLumMod == 10000)
1976 {
1977 eState = beans::PropertyState_DEFAULT_VALUE;
1978 }
1979 }
1980 else if (pMap->nMemberId == MID_COLOR_LUM_OFF)
1981 {
1982 const XFillColorItem* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
1983 sal_Int16 nLumOff = 0;
1984 for (auto const& rTransform : pColor->GetThemeColor().getTransformations())
1985 {
1986 if (rTransform.meType == model::TransformationType::LumOff)
1987 nLumOff = rTransform.mnValue;
1988 }
1989 if (nLumOff == 0)
1990 {
1991 eState = beans::PropertyState_DEFAULT_VALUE;
1992 }
1993 }
1994 else if (pMap->nMemberId == MID_COLOR_THEME_REFERENCE)
1995 {
1996 const XFillColorItem* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
1998 {
1999 eState = beans::PropertyState_DEFAULT_VALUE;
2000 }
2001 }
2002 break;
2003 case XATTR_LINECOLOR:
2005 {
2006 auto const* pColor = rSet.GetItem<XLineColorItem>(pMap->nWID);
2007 if (pColor->GetThemeColor().getType() == model::ThemeColorType::Unknown)
2008 {
2009 eState = beans::PropertyState_DEFAULT_VALUE;
2010 }
2011 }
2012 break;
2013 }
2014 }
2015 }
2016 return eState;
2017}
2018
2019bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue )
2020{
2022 switch( pProperty->nWID )
2023 {
2025 {
2026 awt::Point aPnt;
2027 if( rValue >>= aPnt )
2028 {
2029 Point aVclPoint( aPnt.X, aPnt.Y );
2030
2031 // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
2032 // Need to adapt aVclPoint from 100thmm to app-specific
2033 ForceMetricToItemPoolMetric(aVclPoint);
2034
2035 // #90763# position is relative to top left, make it absolute
2036 basegfx::B2DPolyPolygon aNewPolyPolygon;
2037 basegfx::B2DHomMatrix aNewHomogenMatrix;
2038 pSdrObject->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
2039
2040 aVclPoint.AdjustX(basegfx::fround(aNewHomogenMatrix.get(0, 2)) );
2041 aVclPoint.AdjustY(basegfx::fround(aNewHomogenMatrix.get(1, 2)) );
2042
2043 // #88491# position relative to anchor
2044 if( pSdrObject->getSdrModelFromSdrObject().IsWriter() )
2045 {
2046 aVclPoint += pSdrObject->GetAnchorPos();
2047 }
2048
2049 static_cast<SdrCaptionObj*>(pSdrObject.get())->SetTailPos(aVclPoint);
2050
2051 return true;
2052 }
2053 break;
2054 }
2056 {
2057 drawing::HomogenMatrix3 aMatrix;
2058 if(rValue >>= aMatrix)
2059 {
2060 basegfx::B2DPolyPolygon aNewPolyPolygon;
2061 basegfx::B2DHomMatrix aNewHomogenMatrix;
2062
2063 // tdf#117145 SdrModel data is app-specific
2064 pSdrObject->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
2065
2066 aNewHomogenMatrix.set(0, 0, aMatrix.Line1.Column1);
2067 aNewHomogenMatrix.set(0, 1, aMatrix.Line1.Column2);
2068 aNewHomogenMatrix.set(0, 2, aMatrix.Line1.Column3);
2069 aNewHomogenMatrix.set(1, 0, aMatrix.Line2.Column1);
2070 aNewHomogenMatrix.set(1, 1, aMatrix.Line2.Column2);
2071 aNewHomogenMatrix.set(1, 2, aMatrix.Line2.Column3);
2072 aNewHomogenMatrix.set(2, 0, aMatrix.Line3.Column1);
2073 aNewHomogenMatrix.set(2, 1, aMatrix.Line3.Column2);
2074 aNewHomogenMatrix.set(2, 2, aMatrix.Line3.Column3);
2075
2076 // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
2077 // Need to adapt aNewHomogenMatrix from 100thmm to app-specific
2078 ForceMetricToItemPoolMetric(aNewHomogenMatrix);
2079
2080 pSdrObject->TRSetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
2081 return true;
2082 }
2083 break;
2084 }
2085
2086 case OWN_ATTR_ZORDER:
2087 {
2088 sal_Int32 nNewOrdNum = 0;
2089 if(rValue >>= nNewOrdNum)
2090 {
2091 SdrObjList* pObjList = pSdrObject->getParentSdrObjListFromSdrObject();
2092 if( pObjList )
2093 pObjList->SetExistingObjectOrdNum( pSdrObject.get(), static_cast<size_t>(nNewOrdNum) );
2094 return true;
2095 }
2096 break;
2097 }
2098 case OWN_ATTR_FRAMERECT:
2099 {
2100 awt::Rectangle aUnoRect;
2101 if(rValue >>= aUnoRect)
2102 {
2103 Point aTopLeft( aUnoRect.X, aUnoRect.Y );
2104 Size aObjSize( aUnoRect.Width, aUnoRect.Height );
2107 tools::Rectangle aRect;
2108 aRect.SetPos(aTopLeft);
2109 aRect.SetSize(aObjSize);
2110 pSdrObject->SetSnapRect(aRect);
2111 return true;
2112 }
2113 break;
2114 }
2115 case OWN_ATTR_MIRRORED:
2116 {
2117 bool bMirror;
2118 if(rValue >>= bMirror )
2119 {
2120 SdrGrafObj* pObj = dynamic_cast< SdrGrafObj* >( pSdrObject.get() );
2121 if( pObj )
2122 pObj->SetMirrored(bMirror);
2123 return true;
2124 }
2125 break;
2126 }
2134 {
2135 SdrEdgeObj* pEdgeObj = dynamic_cast< SdrEdgeObj* >(pSdrObject.get());
2136 if(pEdgeObj)
2137 {
2138 switch(pProperty->nWID)
2139 {
2142 {
2143 Reference< drawing::XShape > xShape;
2144 if( rValue >>= xShape )
2145 {
2147 if( pNode )
2148 {
2149 pEdgeObj->ConnectToNode( pProperty->nWID == OWN_ATTR_EDGE_START_OBJ, pNode );
2150 pEdgeObj->setGluePointIndex( pProperty->nWID == OWN_ATTR_EDGE_START_OBJ );
2151 return true;
2152 }
2153 }
2154 break;
2155 }
2156
2159 {
2160 awt::Point aUnoPoint;
2161 if( rValue >>= aUnoPoint )
2162 {
2163 Point aPoint( aUnoPoint.X, aUnoPoint.Y );
2164
2165 // Reintroduction of fix for issue i59051 (#i108851#)
2166 // perform metric change before applying anchor position,
2167 // because the anchor position is in pool metric.
2169 if( pSdrObject->getSdrModelFromSdrObject().IsWriter() )
2170 aPoint += pSdrObject->GetAnchorPos();
2171
2172 pEdgeObj->SetTailPoint( pProperty->nWID == OWN_ATTR_EDGE_START_POS, aPoint );
2173 return true;
2174 }
2175 break;
2176 }
2177
2180 {
2181 sal_Int32 nId = 0;
2182 if( rValue >>= nId )
2183 {
2184 pEdgeObj->setGluePointIndex( pProperty->nWID == OWN_ATTR_GLUEID_HEAD, nId );
2185 return true;
2186 }
2187 break;
2188 }
2190 {
2191 basegfx::B2DPolyPolygon aNewPolyPolygon;
2192
2193 // #123616# be a little bit more flexible regarding the data type used
2194 if( auto s = o3tl::tryAccess<drawing::PointSequenceSequence>(rValue) )
2195 {
2196 // get polygpon data from PointSequenceSequence
2198 *s);
2199 }
2200 else if( auto cs = o3tl::tryAccess<drawing::PolyPolygonBezierCoords>(rValue) )
2201 {
2202 // get polygpon data from PolyPolygonBezierCoords
2204 *cs);
2205 }
2206
2207 if(aNewPolyPolygon.count())
2208 {
2209 // Reintroduction of fix for issue i59051 (#i108851#)
2210 ForceMetricToItemPoolMetric( aNewPolyPolygon );
2211 if( pSdrObject->getSdrModelFromSdrObject().IsWriter() )
2212 {
2213 Point aPoint( pSdrObject->GetAnchorPos() );
2214 aNewPolyPolygon.transform(basegfx::utils::createTranslateB2DHomMatrix(aPoint.X(), aPoint.Y()));
2215 }
2216 pEdgeObj->SetEdgeTrackPath( aNewPolyPolygon );
2217 return true;
2218 }
2219 }
2220 }
2221 }
2222 break;
2223 }
2226 {
2227 SdrMeasureObj* pMeasureObj = dynamic_cast< SdrMeasureObj* >(pSdrObject.get());
2228 awt::Point aUnoPoint;
2229 if(pMeasureObj && ( rValue >>= aUnoPoint ) )
2230 {
2231 Point aPoint( aUnoPoint.X, aUnoPoint.Y );
2232
2233 // Reintroduction of fix for issue #i59051# (#i108851#)
2235 if( pSdrObject->getSdrModelFromSdrObject().IsWriter() )
2236 aPoint += pSdrObject->GetAnchorPos();
2237
2238 pMeasureObj->NbcSetPoint( aPoint, pProperty->nWID == OWN_ATTR_MEASURE_START_POS ? 0 : 1 );
2239 pMeasureObj->SetChanged();
2240 pMeasureObj->BroadcastObjectChange();
2241 return true;
2242 }
2243 break;
2244 }
2246 {
2247 drawing::BitmapMode eMode;
2248 if(!(rValue >>= eMode) )
2249 {
2250 sal_Int32 nMode = 0;
2251 if(!(rValue >>= nMode))
2252 break;
2253
2254 eMode = static_cast<drawing::BitmapMode>(nMode);
2255 }
2256 pSdrObject->SetMergedItem( XFillBmpStretchItem( eMode == drawing::BitmapMode_STRETCH ) );
2257 pSdrObject->SetMergedItem( XFillBmpTileItem( eMode == drawing::BitmapMode_REPEAT ) );
2258 return true;
2259 }
2260
2261 case SDRATTR_LAYERID:
2262 {
2263 sal_Int16 nLayerId = sal_Int16();
2264 if( rValue >>= nLayerId )
2265 {
2266 SdrLayer* pLayer = pSdrObject->getSdrModelFromSdrObject().GetLayerAdmin().GetLayerPerID(SdrLayerID(nLayerId));
2267 if( pLayer )
2268 {
2269 pSdrObject->SetLayer(SdrLayerID(nLayerId));
2270 return true;
2271 }
2272 }
2273 break;
2274 }
2275
2276 case SDRATTR_LAYERNAME:
2277 {
2278 OUString aLayerName;
2279 if( rValue >>= aLayerName )
2280 {
2281 const SdrLayer* pLayer = pSdrObject->getSdrModelFromSdrObject().GetLayerAdmin().GetLayer(aLayerName);
2282 if( pLayer != nullptr )
2283 {
2284 pSdrObject->SetLayer( pLayer->GetID() );
2285 return true;
2286 }
2287 }
2288 break;
2289 }
2291 {
2292 sal_Int32 nTmp = 0;
2293 if( rValue >>= nTmp )
2294 {
2295 Degree100 nAngle(nTmp);
2296 Point aRef1(pSdrObject->GetSnapRect().Center());
2297 nAngle -= pSdrObject->GetRotateAngle();
2298 if (nAngle)
2299 {
2300 double nSin = sin(toRadians(nAngle));
2301 double nCos = cos(toRadians(nAngle));
2302 pSdrObject->Rotate(aRef1,nAngle,nSin,nCos);
2303 }
2304 return true;
2305 }
2306
2307 break;
2308 }
2309
2310 case SDRATTR_SHEARANGLE:
2311 {
2312 sal_Int32 nTmp = 0;
2313 if( rValue >>= nTmp )
2314 {
2315 Degree100 nShear(nTmp);
2316 nShear -= pSdrObject->GetShearAngle();
2317 if(nShear)
2318 {
2319 Point aRef1(pSdrObject->GetSnapRect().Center());
2320 double nTan = tan(toRadians(nShear));
2321 pSdrObject->Shear(aRef1,nShear,nTan,false);
2322 return true;
2323 }
2324 }
2325
2326 break;
2327 }
2328
2330 {
2331 pSdrObject->SetGrabBagItem(rValue);
2332 return true;
2333 }
2334
2336 {
2337 bool bMoveProtect;
2338 if( rValue >>= bMoveProtect )
2339 {
2340 pSdrObject->SetMoveProtect(bMoveProtect);
2341 return true;
2342 }
2343 break;
2344 }
2345 case SDRATTR_OBJECTNAME:
2346 {
2347 OUString aName;
2348 if( rValue >>= aName )
2349 {
2350 pSdrObject->SetName( aName );
2351 return true;
2352 }
2353 break;
2354 }
2355
2357 {
2358 sal_Int16 nMaxScale = 0;
2359 if (rValue >>= nMaxScale)
2360 {
2361 SdrTextFitToSizeTypeItem aItem(pSdrObject->GetMergedItem(SDRATTR_TEXT_FITTOSIZE));
2362 aItem.SetMaxScale(nMaxScale);
2363 pSdrObject->SetMergedItem(aItem);
2364 return true;
2365 }
2366 break;
2367 }
2368
2369 // #i68101#
2371 {
2372 OUString aTitle;
2373 if( rValue >>= aTitle )
2374 {
2375 pSdrObject->SetTitle( aTitle );
2376 return true;
2377 }
2378 break;
2379 }
2381 {
2382 OUString aDescription;
2383 if( rValue >>= aDescription )
2384 {
2385 pSdrObject->SetDescription( aDescription );
2386 return true;
2387 }
2388 break;
2389 }
2390
2392 {
2393 bool bPrintable;
2394 if( rValue >>= bPrintable )
2395 {
2396 pSdrObject->SetPrintable(bPrintable);
2397 return true;
2398 }
2399 break;
2400 }
2401 case SDRATTR_OBJVISIBLE:
2402 {
2403 bool bVisible;
2404 if( rValue >>= bVisible )
2405 {
2406 pSdrObject->SetVisible(bVisible);
2407 return true;
2408 }
2409 break;
2410 }
2412 {
2413 bool bResizeProtect;
2414 if( rValue >>= bResizeProtect )
2415 {
2416 pSdrObject->SetResizeProtect(bResizeProtect);
2417 return true;
2418 }
2419 break;
2420 }
2422 {
2423 sal_Int32 nPageNum = 0;
2424 if( (rValue >>= nPageNum) && ( nPageNum >= 0 ) && ( nPageNum <= 0xffff ) )
2425 {
2426 SdrPageObj* pPageObj = dynamic_cast< SdrPageObj* >(pSdrObject.get());
2427 if( pPageObj )
2428 {
2429 SdrModel& rModel(pPageObj->getSdrModelFromSdrObject());
2430 SdrPage* pNewPage = nullptr;
2431 const sal_uInt16 nDestinationPageNum(static_cast<sal_uInt16>((nPageNum << 1) - 1));
2432
2433 if(nDestinationPageNum < rModel.GetPageCount())
2434 {
2435 pNewPage = rModel.GetPage(nDestinationPageNum);
2436 }
2437
2438 pPageObj->SetReferencedPage(pNewPage);
2439 }
2440
2441 return true;
2442 }
2443 break;
2444 }
2445 case XATTR_FILLBITMAP:
2446 case XATTR_FILLGRADIENT:
2447 case XATTR_FILLHATCH:
2449 case XATTR_LINEEND:
2450 case XATTR_LINESTART:
2451 case XATTR_LINEDASH:
2452 {
2453 if( pProperty->nMemberId == MID_NAME )
2454 {
2455 OUString aApiName;
2456 if( rValue >>= aApiName )
2457 {
2458 if( SetFillAttribute( pProperty->nWID, aApiName ) )
2459 return true;
2460 }
2461 break;
2462 }
2463 else
2464 {
2465 return false;
2466 }
2467 }
2468
2470 {
2471 if (auto pTextObj = DynCastSdrTextObj(pSdrObject.get()))
2472 {
2473 css::uno::Reference<css::text::XTextColumns> xTextColumns;
2474 if (rValue >>= xTextColumns)
2475 {
2476 pTextObj->SetTextColumnsNumber(xTextColumns->getColumnCount());
2477 if (css::uno::Reference<css::beans::XPropertySet> xPropSet{ xTextColumns,
2478 css::uno::UNO_QUERY })
2479 {
2480 auto aVal = xPropSet->getPropertyValue("AutomaticDistance");
2481 if (sal_Int32 nSpacing; aVal >>= nSpacing)
2482 pTextObj->SetTextColumnsSpacing(nSpacing);
2483 }
2484 }
2485 }
2486 return true;
2487 }
2488
2489 case OWN_ATTR_HYPERLINK:
2490 {
2491 OUString sHyperlink;
2492 if (rValue >>= sHyperlink)
2493 {
2494 pSdrObject->setHyperlink(sHyperlink);
2495 return true;
2496 }
2497 break;
2498 }
2499
2501 {
2502 SvxFrameDirectionItem aItem(SvxFrameDirection::Environment, SDRATTR_WRITINGMODE2);
2503 aItem.PutValue(rValue, 0);
2504 GetSdrObject()->SetMergedItem(aItem);
2505 return true;
2506 break;
2507 }
2508
2509 default:
2510 {
2511 return false;
2512 }
2513 }
2514
2515 OUString sExceptionMessage(
2516 "IllegalArgumentException in SvxShape::setPropertyValueImpl."
2517 " Property Type: "
2518 + pProperty->aType.getTypeName() + " Property Name: " + pProperty->aName
2519 + " Property nWID: " + OUString::number(pProperty->nWID)
2520 + " Value Type: " + (rValue.hasValue() ? rValue.getValueTypeName() : "void (no value)"));
2521
2522 throw lang::IllegalArgumentException(sExceptionMessage, nullptr, 1);
2523}
2524
2525
2526bool SvxShape::getPropertyValueImpl( const OUString&, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue )
2527{
2528 switch( pProperty->nWID )
2529 {
2531 {
2532 Point aVclPoint = static_cast<SdrCaptionObj*>(GetSdrObject())->GetTailPos();
2533
2534 // #88491# make pos relative to anchor
2536 {
2537 aVclPoint -= GetSdrObject()->GetAnchorPos();
2538 }
2539
2540 // #90763# pos is absolute, make it relative to top left
2541 basegfx::B2DPolyPolygon aNewPolyPolygon;
2542 basegfx::B2DHomMatrix aNewHomogenMatrix;
2543 GetSdrObject()->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
2544
2545 aVclPoint.AdjustX( -(basegfx::fround(aNewHomogenMatrix.get(0, 2))) );
2546 aVclPoint.AdjustY( -(basegfx::fround(aNewHomogenMatrix.get(1, 2))) );
2547
2548 // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
2549 // Need to adapt aVclPoint from app-specific to 100thmm
2550 ForceMetricTo100th_mm(aVclPoint);
2551
2552 awt::Point aPnt( aVclPoint.X(), aVclPoint.Y() );
2553 rValue <<= aPnt;
2554 break;
2555 }
2556
2558 {
2559 basegfx::B2DPolyPolygon aNewPolyPolygon;
2560 basegfx::B2DHomMatrix aNewHomogenMatrix;
2561 GetSdrObject()->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
2562 drawing::HomogenMatrix3 aMatrix;
2563
2564 // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
2565 // Need to adapt aNewHomogenMatrix from app-specific to 100thmm
2566 ForceMetricTo100th_mm(aNewHomogenMatrix);
2567
2568 aMatrix.Line1.Column1 = aNewHomogenMatrix.get(0, 0);
2569 aMatrix.Line1.Column2 = aNewHomogenMatrix.get(0, 1);
2570 aMatrix.Line1.Column3 = aNewHomogenMatrix.get(0, 2);
2571 aMatrix.Line2.Column1 = aNewHomogenMatrix.get(1, 0);
2572 aMatrix.Line2.Column2 = aNewHomogenMatrix.get(1, 1);
2573 aMatrix.Line2.Column3 = aNewHomogenMatrix.get(1, 2);
2574 aMatrix.Line3.Column1 = aNewHomogenMatrix.get(2, 0);
2575 aMatrix.Line3.Column2 = aNewHomogenMatrix.get(2, 1);
2576 aMatrix.Line3.Column3 = aNewHomogenMatrix.get(2, 2);
2577
2578 rValue <<= aMatrix;
2579
2580 break;
2581 }
2582
2583 case OWN_ATTR_ZORDER:
2584 {
2585 rValue <<= static_cast<sal_Int32>(GetSdrObject()->GetOrdNum());
2586 break;
2587 }
2588
2589 case OWN_ATTR_BITMAP:
2590 {
2591 rValue = GetBitmap();
2592 if(!rValue.hasValue())
2593 throw uno::RuntimeException();
2594
2595 break;
2596 }
2597
2599 {
2600 bool bIsFontwork = false;
2601 if (const SdrTextObj* pTextObj = DynCastSdrTextObj(GetSdrObject()))
2602 bIsFontwork = pTextObj->IsFontwork();
2603 rValue <<= bIsFontwork;
2604 break;
2605 }
2606
2607 case OWN_ATTR_FRAMERECT:
2608 {
2609 tools::Rectangle aRect( GetSdrObject()->GetSnapRect() );
2610 Point aTopLeft( aRect.TopLeft() );
2611 Size aObjSize( aRect.GetWidth(), aRect.GetHeight() );
2612 ForceMetricTo100th_mm(aTopLeft);
2613 ForceMetricTo100th_mm(aObjSize);
2614 css::awt::Rectangle aUnoRect(
2615 aTopLeft.X(), aTopLeft.Y(),
2616 aObjSize.getWidth(), aObjSize.getHeight() );
2617 rValue <<= aUnoRect;
2618 break;
2619 }
2620
2621 case OWN_ATTR_BOUNDRECT:
2622 {
2623 tools::Rectangle aRect( GetSdrObject()->GetCurrentBoundRect() );
2624 Point aTopLeft( aRect.TopLeft() );
2625 Size aObjSize( aRect.GetWidth(), aRect.GetHeight() );
2626 ForceMetricTo100th_mm(aTopLeft);
2627 ForceMetricTo100th_mm(aObjSize);
2628 css::awt::Rectangle aUnoRect(
2629 aTopLeft.X(), aTopLeft.Y(),
2630 aObjSize.getWidth(), aObjSize.getHeight() );
2631 rValue <<= aUnoRect;
2632 break;
2633 }
2634
2635 case OWN_ATTR_LDNAME:
2636 {
2637 OUString aName( GetSdrObject()->GetName() );
2638 rValue <<= aName;
2639 break;
2640 }
2641
2642 case OWN_ATTR_LDBITMAP:
2643 {
2644 OUString sId;
2645 if( GetSdrObject()->GetObjInventor() == SdrInventor::Default && GetSdrObject()->GetObjIdentifier() == SdrObjKind::OLE2 )
2646 {
2647 sId = RID_UNODRAW_OLE2;
2648 }
2649 else if( GetSdrObject()->GetObjInventor() == SdrInventor::Default && GetSdrObject()->GetObjIdentifier() == SdrObjKind::Graphic )
2650 {
2651 sId = RID_UNODRAW_GRAPHICS;
2652 }
2653 else
2654 {
2655 sId = RID_UNODRAW_OBJECTS;
2656 }
2657
2658 BitmapEx aBmp(sId);
2659 Reference<awt::XBitmap> xBmp(VCLUnoHelper::CreateBitmap(aBmp));
2660
2661 rValue <<= xBmp;
2662 break;
2663 }
2664
2665 case OWN_ATTR_MIRRORED:
2666 {
2667 bool bMirror = false;
2668 if( HasSdrObject() )
2669 if (auto pGrafObj = dynamic_cast<SdrGrafObj*>(GetSdrObject()) )
2670 bMirror = pGrafObj->IsMirrored();
2671
2672 rValue <<= bMirror;
2673 break;
2674 }
2675
2683 {
2684 SdrEdgeObj* pEdgeObj = dynamic_cast<SdrEdgeObj*>(GetSdrObject());
2685 if(pEdgeObj)
2686 {
2687 switch(pProperty->nWID)
2688 {
2691 {
2692 SdrObject* pNode = pEdgeObj->GetConnectedNode(pProperty->nWID == OWN_ATTR_EDGE_START_OBJ);
2693 if(pNode)
2694 {
2695 Reference< drawing::XShape > xShape( GetXShapeForSdrObject( pNode ) );
2696 if(xShape.is())
2697 rValue <<= xShape;
2698
2699 }
2700 break;
2701 }
2702
2705 {
2706 Point aPoint( pEdgeObj->GetTailPoint( pProperty->nWID == OWN_ATTR_EDGE_START_POS ) );
2707 if( GetSdrObject()->getSdrModelFromSdrObject().IsWriter() )
2708 aPoint -= GetSdrObject()->GetAnchorPos();
2709
2710 ForceMetricTo100th_mm( aPoint );
2711 awt::Point aUnoPoint( aPoint.X(), aPoint.Y() );
2712
2713 rValue <<= aUnoPoint;
2714 break;
2715 }
2718 {
2719 rValue <<= pEdgeObj->getGluePointIndex( pProperty->nWID == OWN_ATTR_GLUEID_HEAD );
2720 break;
2721 }
2723 {
2724 basegfx::B2DPolyPolygon aPolyPoly( pEdgeObj->GetEdgeTrackPath() );
2725 if( GetSdrObject()->getSdrModelFromSdrObject().IsWriter() )
2726 {
2727 Point aPoint( GetSdrObject()->GetAnchorPos() );
2728 aPolyPoly.transform(basegfx::utils::createTranslateB2DHomMatrix(-aPoint.X(), -aPoint.Y()));
2729 }
2730 // Reintroduction of fix for issue #i59051# (#i108851#)
2731 ForceMetricTo100th_mm( aPolyPoly );
2732 drawing::PolyPolygonBezierCoords aRetval;
2734 rValue <<= aRetval;
2735 break;
2736 }
2737 }
2738 }
2739 break;
2740 }
2741
2744 {
2745 SdrMeasureObj* pMeasureObj = dynamic_cast<SdrMeasureObj*>(GetSdrObject());
2746 if(pMeasureObj)
2747 {
2748 Point aPoint( pMeasureObj->GetPoint( pProperty->nWID == OWN_ATTR_MEASURE_START_POS ? 0 : 1 ) );
2749 if( GetSdrObject()->getSdrModelFromSdrObject().IsWriter() )
2750 aPoint -= GetSdrObject()->GetAnchorPos();
2751
2752 // Reintroduction of fix for issue #i59051# (#i108851#)
2753 ForceMetricTo100th_mm( aPoint );
2754 awt::Point aUnoPoint( aPoint.X(), aPoint.Y() );
2755
2756 rValue <<= aUnoPoint;
2757 break;
2758 }
2759 break;
2760 }
2761
2763 {
2764 const SfxItemSet& rObjItemSet = GetSdrObject()->GetMergedItemSet();
2765
2766 if (rObjItemSet.Get(XATTR_FILLBMP_TILE).GetValue())
2767 {
2768 rValue <<= drawing::BitmapMode_REPEAT;
2769 }
2770 else if (rObjItemSet.Get(XATTR_FILLBMP_STRETCH).GetValue())
2771 {
2772 rValue <<= drawing::BitmapMode_STRETCH;
2773 }
2774 else
2775 {
2776 rValue <<= drawing::BitmapMode_NO_REPEAT;
2777 }
2778 break;
2779 }
2780 case SDRATTR_LAYERID:
2781 rValue <<= GetSdrObject()->GetLayer().get();
2782 break;
2783
2784 case SDRATTR_LAYERNAME:
2785 {
2787 if( pLayer )
2788 {
2789 rValue <<= pLayer->GetName();
2790 }
2791 break;
2792 }
2793
2795 rValue <<= static_cast<sal_Int32>(GetSdrObject()->GetRotateAngle());
2796 break;
2797
2798 case SDRATTR_SHEARANGLE:
2799 rValue <<= static_cast<sal_Int32>(GetSdrObject()->GetShearAngle());
2800 break;
2801
2803 {
2804 GetSdrObject()->GetGrabBagItem(rValue);
2805 break;
2806 }
2807
2809 rValue <<= GetSdrObject()->IsMoveProtect();
2810 break;
2811
2812 case SDRATTR_OBJECTNAME:
2813 {
2814 OUString aName( GetSdrObject()->GetName() );
2815 rValue <<= aName;
2816 break;
2817 }
2818
2819 // #i68101#
2821 {
2822 OUString aTitle( GetSdrObject()->GetTitle() );
2823 rValue <<= aTitle;
2824 break;
2825 }
2826
2828 {
2829 OUString aDescription( GetSdrObject()->GetDescription() );
2830 rValue <<= aDescription;
2831 break;
2832 }
2833
2835 rValue <<= GetSdrObject()->IsPrintable();
2836 break;
2837
2838 case SDRATTR_OBJVISIBLE:
2839 rValue <<= GetSdrObject()->IsVisible();
2840 break;
2841
2843 rValue <<= GetSdrObject()->IsResizeProtect();
2844 break;
2845
2847 {
2848 SdrPageObj* pPageObj = dynamic_cast<SdrPageObj*>(GetSdrObject());
2849 if(pPageObj)
2850 {
2851 SdrPage* pPage = pPageObj->GetReferencedPage();
2852 sal_Int32 nPageNumber = pPage ? pPage->GetPageNum() : 0;
2853 nPageNumber++;
2854 nPageNumber >>= 1;
2855 rValue <<= nPageNumber;
2856 }
2857 break;
2858 }
2859
2861 {
2862 rValue <<= GetSdrObject()->TakeObjNameSingul();
2863 break;
2864 }
2865
2867 {
2868 rValue <<= GetTextFitToSizeScale(GetSdrObject());
2869 break;
2870 }
2871
2873 {
2874 rValue <<= GetSdrObject()->TakeObjNamePlural();
2875 break;
2876 }
2877 case OWN_ATTR_METAFILE:
2878 {
2879 SdrOle2Obj* pObj = dynamic_cast<SdrOle2Obj*>(GetSdrObject());
2880 if( pObj )
2881 {
2882 const Graphic* pGraphic = pObj->GetGraphic();
2883 if( pGraphic )
2884 {
2885 bool bIsWMF = false;
2886 if ( pGraphic->IsGfxLink() )
2887 {
2888 GfxLink aLnk = pGraphic->GetGfxLink();
2889 if ( aLnk.GetType() == GfxLinkType::NativeWmf )
2890 {
2891 bIsWMF = true;
2892 uno::Sequence<sal_Int8> aSeq(reinterpret_cast<sal_Int8 const *>(aLnk.GetData()), static_cast<sal_Int32>(aLnk.GetDataSize()));
2893 rValue <<= aSeq;
2894 }
2895 }
2896 if ( !bIsWMF )
2897 {
2898 // #119735# just use GetGDIMetaFile, it will create a buffered version of contained bitmap now automatically
2899 GDIMetaFile aMtf(pObj->GetGraphic()->GetGDIMetaFile());
2900 SvMemoryStream aDestStrm( 65535, 65535 );
2901 ConvertGDIMetaFileToWMF( aMtf, aDestStrm, nullptr, false );
2902 const uno::Sequence<sal_Int8> aSeq(
2903 static_cast< const sal_Int8* >(aDestStrm.GetData()),
2904 aDestStrm.GetEndOfData());
2905 rValue <<= aSeq;
2906 }
2907 }
2908 }
2909 else
2910 {
2911 rValue = GetBitmap( true );
2912 }
2913 break;
2914 }
2915
2917 {
2918 if (auto pTextObj = DynCastSdrTextObj(GetSdrObject()))
2919 {
2920 if (pTextObj->HasTextColumnsNumber() || pTextObj->HasTextColumnsSpacing())
2921 {
2922 auto xIf = SvxXTextColumns_createInstance();
2923 css::uno::Reference<css::text::XTextColumns> xCols(xIf, css::uno::UNO_QUERY_THROW);
2924 xCols->setColumnCount(pTextObj->GetTextColumnsNumber());
2925 css::uno::Reference<css::beans::XPropertySet> xProp(xIf, css::uno::UNO_QUERY_THROW);
2926 xProp->setPropertyValue("AutomaticDistance",
2927 css::uno::Any(pTextObj->GetTextColumnsSpacing()));
2928 rValue <<= xIf;
2929 }
2930 }
2931 break;
2932 }
2933
2934 case OWN_ATTR_HYPERLINK:
2935 {
2936 rValue <<= GetSdrObject()->getHyperlink();
2937 break;
2938 }
2939
2940 default:
2941 return false;
2942 }
2943 return true;
2944}
2945
2946
2947bool SvxShape::getPropertyStateImpl( const SfxItemPropertyMapEntry* pProperty, css::beans::PropertyState& rState )
2948{
2949 if( pProperty->nWID == OWN_ATTR_FILLBMP_MODE )
2950 {
2952
2953 if( rSet.GetItemState( XATTR_FILLBMP_STRETCH, false ) == SfxItemState::SET ||
2954 rSet.GetItemState( XATTR_FILLBMP_TILE, false ) == SfxItemState::SET )
2955 {
2956 rState = beans::PropertyState_DIRECT_VALUE;
2957 }
2958 else
2959 {
2960 rState = beans::PropertyState_AMBIGUOUS_VALUE;
2961 }
2962 }
2963 else if((( pProperty->nWID >= OWN_ATTR_VALUE_START && pProperty->nWID <= OWN_ATTR_VALUE_END ) ||
2964 ( pProperty->nWID >= SDRATTR_NOTPERSIST_FIRST && pProperty->nWID <= SDRATTR_NOTPERSIST_LAST )) && ( pProperty->nWID != SDRATTR_TEXTDIRECTION ) )
2965 {
2966 rState = beans::PropertyState_DIRECT_VALUE;
2967 }
2968 else
2969 {
2970 return false;
2971 }
2972
2973 return true;
2974}
2975
2976
2978{
2979 if( pProperty->nWID == OWN_ATTR_FILLBMP_MODE )
2980 {
2983 return true;
2984 }
2985 else if((pProperty->nWID >= OWN_ATTR_VALUE_START && pProperty->nWID <= OWN_ATTR_VALUE_END ) ||
2986 ( pProperty->nWID >= SDRATTR_NOTPERSIST_FIRST && pProperty->nWID <= SDRATTR_NOTPERSIST_LAST ))
2987 {
2988 return true;
2989 }
2990 else
2991 {
2992 return false;
2993 }
2994}
2995
2996
2997uno::Sequence< beans::PropertyState > SAL_CALL SvxShape::getPropertyStates( const uno::Sequence< OUString >& aPropertyName )
2998{
2999 const sal_Int32 nCount = aPropertyName.getLength();
3000 uno::Sequence< beans::PropertyState > aRet( nCount );
3001
3002 std::transform(aPropertyName.begin(), aPropertyName.end(), aRet.getArray(),
3003 [this](const OUString& rName) -> beans::PropertyState { return getPropertyState(rName); });
3004
3005 return aRet;
3006}
3007
3008
3009void SAL_CALL SvxShape::setPropertyToDefault( const OUString& PropertyName )
3010{
3011 if( mpImpl->mpMaster )
3012 {
3013 mpImpl->mpMaster->setPropertyToDefault( PropertyName );
3014 }
3015 else
3016 {
3017 _setPropertyToDefault( PropertyName );
3018 }
3019}
3020
3021void SvxShape::_setPropertyToDefault( const OUString& PropertyName )
3022{
3023 ::SolarMutexGuard aGuard;
3024
3025 const SfxItemPropertyMapEntry* pProperty = mpPropSet->getPropertyMapEntry(PropertyName);
3026
3027 if( !HasSdrObject() || pProperty == nullptr )
3028 throw beans::UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this));
3029
3030 if( !setPropertyToDefaultImpl( pProperty ) )
3031 {
3032 GetSdrObject()->ClearMergedItem( pProperty->nWID );
3033 }
3034
3036}
3037
3038
3039uno::Any SAL_CALL SvxShape::getPropertyDefault( const OUString& aPropertyName )
3040{
3041 if( mpImpl->mpMaster )
3042 {
3043 return mpImpl->mpMaster->getPropertyDefault( aPropertyName );
3044 }
3045 else
3046 {
3047 return _getPropertyDefault( aPropertyName );
3048 }
3049}
3050
3051uno::Any SvxShape::_getPropertyDefault( const OUString& aPropertyName )
3052{
3053 ::SolarMutexGuard aGuard;
3054
3055 const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry(aPropertyName);
3056
3057 if( !HasSdrObject() || pMap == nullptr )
3058 throw beans::UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(this));
3059
3060 if(( pMap->nWID >= OWN_ATTR_VALUE_START && pMap->nWID <= OWN_ATTR_VALUE_END ) ||
3062 {
3063 return getPropertyValue( aPropertyName );
3064 }
3065
3066 // get default from ItemPool
3067 if(!SfxItemPool::IsWhich(pMap->nWID))
3068 throw beans::UnknownPropertyException( "No WhichID " + OUString::number(pMap->nWID) + " for " + aPropertyName, static_cast<cppu::OWeakObject*>(this));
3069
3070 SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID );
3071 aSet.Put(GetSdrObject()->getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
3072
3073 return GetAnyForItem( aSet, pMap );
3074}
3075
3076// XMultiPropertyStates
3078{
3079 ::SolarMutexGuard aGuard;
3080
3081 SdrObject* pSdrObj = GetSdrObject();
3082 if( !pSdrObj )
3083 throw lang::DisposedException();
3084 pSdrObj->ClearMergedItem(); // nWhich == 0 => all
3085
3086 const SdrObjKind nObjId = pSdrObj->GetObjIdentifier();
3087 if(nObjId == SdrObjKind::Graphic) // SdrGrafObj
3088 {
3089 // defaults for graphic objects have changed:
3090 pSdrObj->SetMergedItem( XFillStyleItem( drawing::FillStyle_NONE ) );
3091 pSdrObj->SetMergedItem( XLineStyleItem( drawing::LineStyle_NONE ) );
3092 }
3093
3094 // #i68523# special handling for Svx3DCharacterModeItem, this is not saved
3095 // but needs to be sal_True in svx, pool default (false) in sch. Since sch
3096 // does not load lathe or extrude objects, it is possible to set the items
3097 // here.
3098 // For other solution possibilities, see task description.
3099 if( nObjId == SdrObjKind::E3D_Lathe /*E3dLatheObj*/ || nObjId == SdrObjKind::E3D_Extrusion /*E3dExtrudeObj*/ )
3100 {
3101 pSdrObj->SetMergedItem(Svx3DCharacterModeItem(true));
3102 }
3103
3105}
3106
3108 const uno::Sequence<OUString>& aPropertyNames )
3109{
3110 for ( const auto& rPropertyName : aPropertyNames )
3111 setPropertyToDefault( rPropertyName );
3112}
3113
3114uno::Sequence<uno::Any> SvxShape::getPropertyDefaults(
3115 const uno::Sequence<OUString>& aPropertyNames )
3116{
3117 ::std::vector<uno::Any> ret;
3118 ret.reserve(aPropertyNames.getLength());
3119 std::transform(aPropertyNames.begin(), aPropertyNames.end(), std::back_inserter(ret),
3120 [this](const OUString& rName) -> uno::Any { return getPropertyDefault(rName); });
3121 return uno::Sequence<uno::Any>( ret.data(), ret.size() );
3122}
3123
3124
3125// XServiceInfo
3126
3128{
3129 return "SvxShape";
3130}
3131
3132constexpr OUStringLiteral sUNO_service_style_ParagraphProperties = u"com.sun.star.style.ParagraphProperties";
3133constexpr OUStringLiteral sUNO_service_style_ParagraphPropertiesComplex = u"com.sun.star.style.ParagraphPropertiesComplex";
3134constexpr OUStringLiteral sUNO_service_style_ParagraphPropertiesAsian = u"com.sun.star.style.ParagraphPropertiesAsian";
3135constexpr OUStringLiteral sUNO_service_style_CharacterProperties = u"com.sun.star.style.CharacterProperties";
3136constexpr OUStringLiteral sUNO_service_style_CharacterPropertiesComplex = u"com.sun.star.style.CharacterPropertiesComplex";
3137constexpr OUStringLiteral sUNO_service_style_CharacterPropertiesAsian = u"com.sun.star.style.CharacterPropertiesAsian";
3138
3139constexpr OUStringLiteral sUNO_service_drawing_FillProperties = u"com.sun.star.drawing.FillProperties";
3140constexpr OUStringLiteral sUNO_service_drawing_TextProperties = u"com.sun.star.drawing.TextProperties";
3141constexpr OUStringLiteral sUNO_service_drawing_LineProperties = u"com.sun.star.drawing.LineProperties";
3142constexpr OUStringLiteral sUNO_service_drawing_ConnectorProperties = u"com.sun.star.drawing.ConnectorProperties";
3143constexpr OUStringLiteral sUNO_service_drawing_MeasureProperties = u"com.sun.star.drawing.MeasureProperties";
3144constexpr OUStringLiteral sUNO_service_drawing_ShadowProperties = u"com.sun.star.drawing.ShadowProperties";
3145
3146constexpr OUStringLiteral sUNO_service_drawing_RotationDescriptor = u"com.sun.star.drawing.RotationDescriptor";
3147
3148constexpr OUStringLiteral sUNO_service_drawing_Text = u"com.sun.star.drawing.Text";
3149constexpr OUStringLiteral sUNO_service_drawing_GroupShape = u"com.sun.star.drawing.GroupShape";
3150
3151constexpr OUStringLiteral sUNO_service_drawing_CustomShapeProperties = u"com.sun.star.drawing.CustomShapeProperties";
3152constexpr OUStringLiteral sUNO_service_drawing_CustomShape = u"com.sun.star.drawing.CustomShape";
3153
3154constexpr OUStringLiteral sUNO_service_drawing_PolyPolygonDescriptor = u"com.sun.star.drawing.PolyPolygonDescriptor";
3155constexpr OUStringLiteral sUNO_service_drawing_PolyPolygonBezierDescriptor= u"com.sun.star.drawing.PolyPolygonBezierDescriptor";
3156
3157constexpr OUStringLiteral sUNO_service_drawing_LineShape = u"com.sun.star.drawing.LineShape";
3158constexpr OUStringLiteral sUNO_service_drawing_Shape = u"com.sun.star.drawing.Shape";
3159constexpr OUStringLiteral sUNO_service_drawing_RectangleShape = u"com.sun.star.drawing.RectangleShape";
3160constexpr OUStringLiteral sUNO_service_drawing_EllipseShape = u"com.sun.star.drawing.EllipseShape";
3161constexpr OUStringLiteral sUNO_service_drawing_PolyPolygonShape = u"com.sun.star.drawing.PolyPolygonShape";
3162constexpr OUStringLiteral sUNO_service_drawing_PolyLineShape = u"com.sun.star.drawing.PolyLineShape";
3163constexpr OUStringLiteral sUNO_service_drawing_OpenBezierShape = u"com.sun.star.drawing.OpenBezierShape";
3164constexpr OUStringLiteral sUNO_service_drawing_ClosedBezierShape = u"com.sun.star.drawing.ClosedBezierShape";
3165constexpr OUStringLiteral sUNO_service_drawing_TextShape = u"com.sun.star.drawing.TextShape";
3166constexpr OUStringLiteral sUNO_service_drawing_GraphicObjectShape = u"com.sun.star.drawing.GraphicObjectShape";
3167constexpr OUStringLiteral sUNO_service_drawing_OLE2Shape = u"com.sun.star.drawing.OLE2Shape";
3168constexpr OUStringLiteral sUNO_service_drawing_PageShape = u"com.sun.star.drawing.PageShape";
3169constexpr OUStringLiteral sUNO_service_drawing_CaptionShape = u"com.sun.star.drawing.CaptionShape";
3170constexpr OUStringLiteral sUNO_service_drawing_MeasureShape = u"com.sun.star.drawing.MeasureShape";
3171constexpr OUStringLiteral sUNO_service_drawing_FrameShape = u"com.sun.star.drawing.FrameShape";
3172constexpr OUStringLiteral sUNO_service_drawing_ControlShape = u"com.sun.star.drawing.ControlShape";
3173constexpr OUStringLiteral sUNO_service_drawing_ConnectorShape = u"com.sun.star.drawing.ConnectorShape";
3174constexpr OUStringLiteral sUNO_service_drawing_MediaShape = u"com.sun.star.drawing.MediaShape";
3175
3176
3177uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
3178{
3179 if( mpImpl->mpMaster )
3180 {
3181 return mpImpl->mpMaster->getSupportedServiceNames();
3182 }
3183 else
3184 {
3186 }
3187}
3188
3189uno::Sequence< OUString > SvxShape::_getSupportedServiceNames()
3190{
3191 ::SolarMutexGuard aGuard;
3192
3193 if( HasSdrObject() && GetSdrObject()->GetObjInventor() == SdrInventor::Default)
3194 {
3195 const SdrObjKind nIdent = GetSdrObject()->GetObjIdentifier();
3196
3197 switch(nIdent)
3198 {
3199 case SdrObjKind::Group:
3200 {
3201 static const uno::Sequence<OUString> aSvxShape_GroupServices
3204 return aSvxShape_GroupServices;
3205 }
3207 {
3208 static const uno::Sequence<OUString> aSvxShape_CustomShapeServices
3224 return aSvxShape_CustomShapeServices;
3225 }
3226 case SdrObjKind::Line:
3227 {
3228 static const uno::Sequence<OUString> aSvxShape_LineServices
3230
3233
3242
3246 return aSvxShape_LineServices;
3247 }
3248
3250 {
3251 static const uno::Sequence<OUString> aSvxShape_RectServices
3253
3265
3268 return aSvxShape_RectServices;
3269 }
3270
3275 {
3276 static const uno::Sequence<OUString> aSvxShape_CircServices
3278
3282
3291
3294 return aSvxShape_CircServices;
3295 }
3296
3299 {
3300 static const uno::Sequence<OUString> aSvxShape_PathServices
3302
3305
3307
3316
3319 return aSvxShape_PathServices;
3320 }
3321
3324 {
3325 static const uno::Sequence<OUString> aSvxShape_PolyServices
3327
3331
3333
3342
3345 return aSvxShape_PolyServices;
3346 }
3347
3350 {
3351 static const uno::Sequence<OUString> aSvxShape_FreeLineServices
3353
3357
3359
3368
3371 return aSvxShape_FreeLineServices;
3372 }
3373
3376 {
3377 static const uno::Sequence<OUString> aSvxShape_FreeFillServices
3379
3383
3385
3394
3397 return aSvxShape_FreeFillServices;
3398 }
3399
3402 case SdrObjKind::Text:
3403 {
3404 static const uno::Sequence<OUString> aSvxShape_TextServices
3406
3410
3419
3422 return aSvxShape_TextServices;
3423 }
3424
3426 {
3427 static const uno::Sequence<OUString> aSvxShape_GrafServices
3429
3431
3440
3443 return aSvxShape_GrafServices;
3444 }
3445
3446 case SdrObjKind::OLE2:
3447 {
3448 static const uno::Sequence<OUString> aSvxShape_Ole2Services
3451
3452 // #i118485# Added Text, Shadow and Rotation
3461
3464 return aSvxShape_Ole2Services;
3465 }
3466
3468 {
3469 static const uno::Sequence<OUString> aSvxShape_CaptionServices
3471
3475
3484
3487 return aSvxShape_CaptionServices;
3488 }
3489
3490 case SdrObjKind::Page:
3491 {
3492 static const uno::Sequence<OUString> aSvxShape_PageServices
3495 return aSvxShape_PageServices;
3496 }
3497
3499 {
3500 static const uno::Sequence<OUString> aSvxShape_MeasureServices
3502
3504
3507
3516
3520 return aSvxShape_MeasureServices;
3521 }
3522
3524 {
3525 static const uno::Sequence<OUString> aSvxShape_FrameServices
3528 return aSvxShape_FrameServices;
3529 }
3530
3531 case SdrObjKind::UNO:
3532 {
3533 static const uno::Sequence<OUString> aSvxShape_UnoServices
3536 return aSvxShape_UnoServices;
3537 }
3538
3539 case SdrObjKind::Edge:
3540 {
3541 static const uno::Sequence<OUString> aSvxShape_EdgeServices
3544
3547
3556
3560 return aSvxShape_EdgeServices;
3561 }
3562 case SdrObjKind::Media:
3563 {
3564 static const uno::Sequence<OUString> aSvxShape_MediaServices
3567 return aSvxShape_MediaServices;
3568 }
3569 default: ;
3570 }
3571 }
3572 else if( HasSdrObject() && GetSdrObject()->GetObjInventor() == SdrInventor::FmForm)
3573 {
3574#if OSL_DEBUG_LEVEL > 0
3575 const SdrObjKind nIdent = GetSdrObject()->GetObjIdentifier();
3576 OSL_ENSURE( nIdent == SdrObjKind::UNO, "SvxShape::_getSupportedServiceNames: SdrInventor::FmForm, but no UNO object?" );
3577#endif
3578 static const uno::Sequence<OUString> aSvxShape_UnoServices
3581 return aSvxShape_UnoServices;
3582 }
3583 OSL_FAIL( "SvxShape::_getSupportedServiceNames: could not determine object type!" );
3584 uno::Sequence< OUString > aSeq;
3585 return aSeq;
3586}
3587
3588sal_Bool SAL_CALL SvxShape::supportsService( const OUString& ServiceName )
3589{
3590 return cppu::supportsService(this, ServiceName);
3591}
3592
3593// XGluePointsSupplier
3594uno::Reference< container::XIndexContainer > SAL_CALL SvxShape::getGluePoints()
3595{
3596 ::SolarMutexGuard aGuard;
3597 uno::Reference< container::XIndexContainer > xGluePoints( mxGluePoints );
3598
3599 if( HasSdrObject() && !xGluePoints.is() )
3600 {
3601 uno::Reference< container::XIndexContainer > xNew( SvxUnoGluePointAccess_createInstance( GetSdrObject() ), uno::UNO_QUERY );
3602 mxGluePoints = xGluePoints = xNew;
3603 }
3604
3605 return xGluePoints;
3606}
3607
3608// XChild
3609uno::Reference<uno::XInterface> SAL_CALL SvxShape::getParent()
3610{
3611 ::SolarMutexGuard aGuard;
3612 const SdrObject* pSdrObject(GetSdrObject());
3613
3614 if(nullptr != pSdrObject)
3615 {
3616 const SdrObjList* pParentSdrObjList(GetSdrObject()->getParentSdrObjListFromSdrObject());
3617
3618 if(nullptr != pParentSdrObjList)
3619 {
3620 // SdrObject is member of a SdrObjList. That may be a SdrObject
3621 // (SdrObjGroup or E3dScene) or a SdrPage.
3622 // Check for SdrObject first - using getSdrPageFromSdrObjList
3623 // *will* get the SdrPage even when the SdrObject is deep buried
3624 // in a construct of SdrObjGroup.
3625 // We want to ask for the direct parent here...
3626 SdrObject* pParentSdrObject(pParentSdrObjList->getSdrObjectFromSdrObjList());
3627
3628 if(nullptr != pParentSdrObject)
3629 {
3630 // SdrObject is member of a SdrObject-based Group (SdrObjGroup or E3dScene).
3631 return pParentSdrObject->getUnoShape();
3632 }
3633 else
3634 {
3635 SdrPage* pParentSdrPage(pParentSdrObjList->getSdrPageFromSdrObjList());
3636
3637 if(nullptr != pParentSdrPage)
3638 {
3639 // SdrObject is inserted to a SdrPage. Since
3640 // we checked for getSdrObjectFromSdrObjList first,
3641 // we can even say that it is directly member of that
3642 // SdrPage.
3643 return pParentSdrPage->getUnoPage();
3644 }
3645 }
3646
3647 // not member of any SdrObjList, no parent
3648 OSL_FAIL( "SvxShape::getParent( ): unexpected Parent SdrObjList" );
3649 }
3650 }
3651
3652 // no SdrObject, no parent
3653 return uno::Reference<uno::XInterface>();
3654}
3655
3656void SAL_CALL SvxShape::setParent( const css::uno::Reference< css::uno::XInterface >& )
3657{
3658 throw lang::NoSupportException();
3659}
3660
3661
3664{
3665}
3666
3667
3670{
3671}
3672
3673
3674// XActionLockable
3676{
3677 ::SolarMutexGuard aGuard;
3678
3679 return mnLockCount != 0;
3680}
3681
3682
3684{
3685 ::SolarMutexGuard aGuard;
3686
3687 DBG_ASSERT( mnLockCount < 0xffff, "lock overflow in SvxShape!" );
3688 mnLockCount++;
3689
3690 if( mnLockCount == 1 )
3691 lock();
3692}
3693
3694
3696{
3697 ::SolarMutexGuard aGuard;
3698
3699 DBG_ASSERT( mnLockCount > 0, "lock underflow in SvxShape!" );
3700 mnLockCount--;
3701
3702 if( mnLockCount == 0 )
3703 unlock();
3704}
3705
3706
3707void SAL_CALL SvxShape::setActionLocks( sal_Int16 nLock )
3708{
3709 ::SolarMutexGuard aGuard;
3710
3711 if( (mnLockCount == 0) && (nLock != 0) )
3712 unlock();
3713
3714 if( (mnLockCount != 0) && (nLock == 0) )
3715 lock();
3716
3717 mnLockCount = static_cast<sal_uInt16>(nLock);
3718}
3719
3720
3721sal_Int16 SAL_CALL SvxShape::resetActionLocks( )
3722{
3723 ::SolarMutexGuard aGuard;
3724
3725 if( mnLockCount != 0 )
3726 unlock();
3727
3728 sal_Int16 nOldLocks = static_cast<sal_Int16>(mnLockCount);
3729 mnLockCount = 0;
3730
3731 return nOldLocks;
3732}
3733
3734
3741{
3742 switch( mpImpl->mnObjId )
3743 {
3744 case SdrObjKind::Line:
3753 {
3755
3756 if( nId != mpImpl->mnObjId )
3757 {
3758 mpImpl->mnObjId = nId;
3759
3760 }
3761 break;
3762 }
3763 default: ;
3764 }
3765}
3766
3769{
3770 if( pObject )
3771 SetEditSource( new SvxTextEditSource( pObject, nullptr ) );
3772}
3773
3774
3777{
3778 if( pObject )
3779 SetEditSource( new SvxTextEditSource( pObject, nullptr ) );
3780}
3781
3782
3784{
3785 // check if only this instance is registered at the ranges
3786 DBG_ASSERT( (nullptr == GetEditSource()) || (GetEditSource()->getRanges().size()==1),
3787 "svx::SvxShapeText::~SvxShapeText(), text shape with living text ranges destroyed!");
3788}
3789
3790void SvxShapeText::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage )
3791{
3792 if( pNewObj && (nullptr == GetEditSource()))
3793 SetEditSource( new SvxTextEditSource( pNewObj, nullptr ) );
3794 SvxShape::Create( pNewObj, pNewPage );
3795}
3796
3797// XInterface
3798
3800{
3801 return SvxShape::queryInterface( rType );
3802}
3803
3804
3806{
3807 uno::Any aAny( SvxShape::queryAggregation( rType ) );
3808 if( aAny.hasValue() )
3809 return aAny;
3810
3811 return SvxUnoTextBase::queryAggregation( rType );
3812}
3813
3814
3815// XServiceInfo
3816
3818{
3819 return "SvxShapeText";
3820}
3821
3822
3823uno::Sequence< OUString > SAL_CALL SvxShapeText::getSupportedServiceNames()
3824{
3826}
3827
3828
3829sal_Bool SAL_CALL SvxShapeText::supportsService( const OUString& ServiceName )
3830{
3831 return cppu::supportsService(static_cast<SvxShape*>(this), ServiceName);
3832}
3833
3834 // XTypeProvider
3835
3836uno::Sequence< uno::Type > SAL_CALL SvxShapeText::getTypes()
3837{
3838 return SvxShape::getTypes();
3839}
3840
3841sal_Int64 SAL_CALL SvxShapeText::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
3842{
3843 const sal_Int64 nReturn = SvxShape::getSomething( rId );
3844 if( nReturn )
3845 return nReturn;
3846
3847 return SvxUnoTextBase::getSomething( rId );
3848}
3849
3850
3851uno::Sequence< sal_Int8 > SAL_CALL SvxShapeText::getImplementationId()
3852{
3853 return css::uno::Sequence<sal_Int8>();
3854}
3855
3856
3859{
3860 SvxTextEditSource* pEditSource = static_cast<SvxTextEditSource*>(GetEditSource());
3861 if( pEditSource )
3862 pEditSource->lock();
3863}
3864
3865
3868{
3869 SvxTextEditSource* pEditSource = static_cast<SvxTextEditSource*>(GetEditSource());
3870 if( pEditSource )
3871 pEditSource->unlock();
3872}
3873
3874// css::text::XTextRange
3875uno::Reference< text::XTextRange > SAL_CALL SvxShapeText::getStart()
3876{
3877 ::SolarMutexGuard aGuard;
3878 SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr;
3879 if( pForwarder )
3880 ::GetSelection( maSelection, pForwarder );
3881 return SvxUnoTextBase::getStart();
3882
3883}
3884
3885uno::Reference< text::XTextRange > SAL_CALL SvxShapeText::getEnd()
3886{
3887 ::SolarMutexGuard aGuard;
3888 SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr;
3889 if( pForwarder )
3890 ::GetSelection( maSelection, pForwarder );
3891 return SvxUnoTextBase::getEnd();
3892}
3893
3894OUString SAL_CALL SvxShapeText::getString()
3895{
3896 ::SolarMutexGuard aGuard;
3897 SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr;
3898 if( pForwarder )
3899 ::GetSelection( maSelection, pForwarder );
3901}
3902
3903
3904void SAL_CALL SvxShapeText::setString( const OUString& aString )
3905{
3906 ::SolarMutexGuard aGuard;
3907 SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr;
3908 if( pForwarder )
3909 ::GetSelection( maSelection, pForwarder );
3910 SvxUnoTextBase::setString( aString );
3911}
3912
3913// override these for special property handling in subcasses. Return true if property is handled
3914bool SvxShapeText::setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue )
3915{
3916 // HACK-fix #99090#
3917 // since SdrTextObj::SetVerticalWriting exchanges
3918 // SDRATTR_TEXT_AUTOGROWWIDTH and SDRATTR_TEXT_AUTOGROWHEIGHT,
3919 // we have to set the textdirection here
3920
3921 if( pProperty->nWID == SDRATTR_TEXTDIRECTION )
3922 {
3923 SdrTextObj* pTextObj = DynCastSdrTextObj( GetSdrObject() );
3924 if( pTextObj )
3925 {
3926 css::text::WritingMode eMode;
3927 if( rValue >>= eMode )
3928 {
3929 pTextObj->SetVerticalWriting( eMode == css::text::WritingMode_TB_RL );
3930 }
3931 }
3932 return true;
3933 }
3934 return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
3935}
3936
3937bool SvxShapeText::getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue )
3938{
3939 if( pProperty->nWID == SDRATTR_TEXTDIRECTION )
3940 {
3941 SdrTextObj* pTextObj = DynCastSdrTextObj( GetSdrObject() );
3942 if( pTextObj && pTextObj->IsVerticalWriting() )
3943 rValue <<= css::text::WritingMode_TB_RL;
3944 else
3945 rValue <<= css::text::WritingMode_LR_TB;
3946 return true;
3947 }
3948
3949 return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
3950}
3951
3952bool SvxShapeText::getPropertyStateImpl( const SfxItemPropertyMapEntry* pProperty, css::beans::PropertyState& rState )
3953{
3954 return SvxShape::getPropertyStateImpl( pProperty, rState );
3955}
3956
3958{
3959 return SvxShape::setPropertyToDefaultImpl( pProperty );
3960}
3961
3963: SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_SHAPE), getSvxMapProvider().GetPropertySet(SVXMAP_SHAPE, SdrObject::GetGlobalDrawObjectItemPool()))
3964{
3965}
3966
3968{
3969}
3970
3972{
3973 return SvxShapeText::queryInterface( rType );
3974}
3975
3977{
3978 return SvxShapeText::queryAggregation( rType );
3979}
3980
3981// XServiceInfo
3982
3984{
3986}
3987
3989uno::Reference< drawing::XShape > GetXShapeForSdrObject( SdrObject* pObj ) noexcept
3990{
3991 uno::Reference< drawing::XShape > xShape( pObj->getUnoShape(), uno::UNO_QUERY );
3992 return xShape;
3993}
3994
3995
3996SdrObject* SdrObject::getSdrObjectFromXShape( const css::uno::Reference< css::uno::XInterface >& xInt )
3997{
3998 SvxShape* pSvxShape = comphelper::getFromUnoTunnel<SvxShape>( xInt );
3999 return pSvxShape ? pSvxShape->GetSdrObject() : nullptr;
4000}
4001
4003{
4004 if(!pMap || !pMap->nWID)
4005 return uno::Any();
4006
4007 // Check is for items that store either metric values if they are positive or percentage if they are negative.
4008 bool bDontConvertNegativeValues = ( pMap->nWID == XATTR_FILLBMP_SIZEX || pMap->nWID == XATTR_FILLBMP_SIZEY );
4009 return SvxItemPropertySet::getPropertyValue( pMap, rSet, (pMap->nWID != SDRATTR_XMLATTRIBUTES), bDontConvertNegativeValues );
4010}
4011
4013{
4014 if(!pMap || !pMap->nWID)
4015 return;
4016
4017 bool bDontConvertNegativeValues = ( pMap->nWID == XATTR_FILLBMP_SIZEX || pMap->nWID == XATTR_FILLBMP_SIZEY );
4018 SvxItemPropertySet::setPropertyValue( pMap, rVal, rSet, bDontConvertNegativeValues );
4019}
4020
4021/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const PropertyValue * pValues
geometry::RealSize2D maSize
css::uno::Reference< css::uno::XInterface > SvxXTextColumns_createInstance() noexcept
constexpr o3tl::Length MapToO3tlLength(MapUnit eU, o3tl::Length ePixelValue=o3tl::Length::px)
const MapMode & GetPrefMapMode() const
const Size & GetPrefSize() const
void Move(tools::Long nX, tools::Long nY)
void WindStart()
void SetPrefMapMode(const MapMode &rMapMode)
void Record(OutputDevice *pOutDev)
void SetPrefSize(const Size &rSize)
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
void SetPrefMapMode(const MapMode &rPrefMapMode)
const GDIMetaFile & GetGDIMetaFile() const
GraphicType GetType() const
GfxLink GetGfxLink() const
bool IsGfxLink() const
void SetPrefSize(const Size &rPrefSize)
OUString const & GetName() const
Definition: xit.hxx:53
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
bool isSuppressGetBitmap() const
Definition: svdocapt.hxx:84
Utility class SdrEdgeObj.
Definition: svdoedge.hxx:130
void ConnectToNode(bool bTail1, SdrObject *pObj) override
Definition: svdoedge.cxx:470
sal_Int32 getGluePointIndex(bool bTail)
this method is used by the api to return a gluepoint id for a connection.
Definition: svdoedge.cxx:2595
void SetEdgeTrackPath(const basegfx::B2DPolyPolygon &rPoly)
Definition: svdoedge.cxx:1706
void SetTailPoint(bool bTail, const Point &rPt)
Definition: svdoedge.cxx:2552
void setGluePointIndex(bool bTail, sal_Int32 nId=-1)
this method is used by the api to set a gluepoint for a connection nId == -1 : The best default point...
Definition: svdoedge.cxx:2563
SdrObject * GetConnectedNode(bool bTail1) const override
Definition: svdoedge.cxx:494
basegfx::B2DPolyPolygon GetEdgeTrackPath() const
Definition: svdoedge.cxx:1726
Point GetTailPoint(bool bTail) const
Definition: svdoedge.cxx:2527
This class represents an embedded or linked bitmap graphic object.
Definition: svdograf.hxx:68
const Graphic & GetGraphic() const
Definition: svdograf.cxx:381
void SetMirrored(bool _bMirrored)
Definition: svdograf.cxx:1039
SdrHintKind GetKind() const
Definition: svdmodel.hxx:132
const SdrObject * GetObject() const
Definition: svdmodel.hxx:131
SdrLayer * GetLayerPerID(SdrLayerID nID)
Definition: svdlayer.hxx:145
SdrLayerID GetID() const
Definition: svdlayer.hxx:94
const OUString & GetName() const
Definition: svdlayer.hxx:77
virtual Point GetPoint(sal_uInt32 i) const override
Definition: svdomeas.cxx:1090
virtual void NbcSetPoint(const Point &rPnt, sal_uInt32 i) override
Definition: svdomeas.cxx:1095
XBitmapListRef GetBitmapList() const
Definition: svdmodel.hxx:535
virtual void SetChanged(bool bFlg=true)
Definition: svdmodel.cxx:1151
XDashListRef GetDashList() const
Definition: svdmodel.hxx:532
XGradientListRef GetGradientList() const
Definition: svdmodel.hxx:538
bool IsWriter() const
Definition: svdmodel.hxx:587
XLineEndListRef GetLineEndList() const
Definition: svdmodel.hxx:537
XHatchListRef GetHatchList() const
Definition: svdmodel.hxx:533
const SdrPage * GetPage(sal_uInt16 nPgNum) const
Definition: svdmodel.cxx:1832
const SdrLayerAdmin & GetLayerAdmin() const
Definition: svdmodel.hxx:315
sal_uInt16 GetPageCount() const
Definition: svdmodel.cxx:1842
virtual SdrPage * getSdrPageFromSdrObjList() const
Definition: svdpage.cxx:122
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:822
size_t GetObjCount() const
Definition: svdpage.cxx:816
void SetExistingObjectOrdNum(SdrObject *pExistingObj, size_t nNewObjNum)
Modify ZOrder of an SdrObject, object must already be in the list.
Definition: svdpage.cxx:562
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum)
Definition: svdpage.cxx:410
virtual SdrObject * getSdrObjectFromSdrObjList() const
Definition: svdpage.cxx:128
Abstract DrawObject.
Definition: svdobj.hxx:261
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
Definition: unoshape.cxx:3996
bool IsResizeProtect() const
Definition: svdobj.hxx:758
SdrObjUserCall * GetUserCall() const
Definition: svdobj.hxx:844
const Point & GetAnchorPos() const
Definition: svdobj.cxx:1656
const OUString & getHyperlink() const
Definition: svdobj.hxx:890
virtual OUString TakeObjNamePlural() const
Definition: svdobj.cxx:1062
virtual void setUnoShape(const css::uno::Reference< css::drawing::XShape > &_rxUnoShape)
Sets a new UNO representation of the shape.
Definition: svdobj.cxx:2827
void BroadcastObjectChange() const
Definition: svdobj.cxx:978
bool IsMoveProtect() const
Definition: svdobj.hxx:756
void SetUserCall(SdrObjUserCall *pUser)
Definition: svdobj.cxx:2760
void SingleObjectPainter(OutputDevice &rOut) const
Definition: svdobj.cxx:1024
virtual SdrInventor GetObjInventor() const
Definition: svdobj.cxx:621
virtual css::uno::Reference< css::drawing::XShape > getUnoShape()
Definition: svdobj.cxx:2869
virtual void Move(const Size &rSiz)
Definition: svdobj.cxx:1534
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:289
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1665
virtual void SetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1699
virtual const OUString & GetName() const
Definition: svdobj.cxx:769
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:261
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:2017
virtual void SetChanged()
Definition: svdobj.cxx:1002
virtual SdrObjKind GetObjIdentifier() const
Definition: svdobj.cxx:626
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1690
bool IsVisible() const
Definition: svdobj.hxx:762
const SfxItemSet & GetMergedItemSet() const
Definition: svdobj.cxx:1977
virtual OUString TakeObjNameSingul() const
Definition: svdobj.cxx:1052
void ClearMergedItem(const sal_uInt16 nWhich=0)
Definition: svdobj.cxx:1992
bool IsPrintable() const
Definition: svdobj.hxx:760
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:645
void SetMergedItem(const SfxPoolItem &rItem)
Definition: svdobj.cxx:1987
void GetGrabBagItem(css::uno::Any &rVal) const
Definition: svdobj.cxx:886
void TakeNotPersistAttr(SfxItemSet &rAttr) const
Definition: svdobj.cxx:2203
virtual void SetName(const OUString &rStr, const bool bSetChanged=true)
Definition: svdobj.cxx:732
void ApplyNotPersistAttr(const SfxItemSet &rAttr)
Definition: svdobj.cxx:2022
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const
Definition: svdobj.cxx:2986
virtual const tools::Rectangle & GetLogicRect() const
Definition: svdobj.cxx:1675
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
Definition: svdobj.cxx:1551
const Graphic * GetGraphic() const
Definition: svdoole2.cxx:1637
void SetReferencedPage(SdrPage *pNewPage)
Definition: svdopage.cxx:104
SdrPage * GetReferencedPage() const
Definition: svdopage.hxx:55
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:377
css::uno::Reference< css::uno::XInterface > const & getUnoPage()
Definition: svdpage.cxx:1777
sal_uInt16 GetPageNum() const
Definition: svdpage.cxx:1611
void SetHandleScale(bool bHandleScale)
Scaling is ignored from the transform matrix by default, to not break compatibility.
Definition: svdopath.cxx:2879
void SetMaxScale(sal_Int16 nMaxScale)
Definition: sdtfsitm.hxx:58
bool HasTextColumnsSpacing() const
Definition: svdotext.cxx:1796
sal_Int32 GetTextColumnsSpacing() const
Definition: svdotext.cxx:1801
void SetTextColumnsSpacing(sal_Int32 nSpacing)
Definition: svdotext.cxx:1806
virtual bool IsFontwork() const
Definition: svdotext.cxx:1733
virtual void SetVerticalWriting(bool bVertical)
Definition: svdotext.cxx:1500
void SetTextColumnsNumber(sal_Int16 nColumns)
Definition: svdotext.cxx:1791
sal_uInt16 GetFontScaleY() const
Definition: svdotext.cxx:1226
bool HasTextColumnsNumber() const
Definition: svdotext.cxx:1781
sal_Int16 GetTextColumnsNumber() const
Definition: svdotext.cxx:1786
virtual bool IsVerticalWriting() const
Definition: svdotext.cxx:1484
EnumT GetValue() const
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
static bool IsWhich(sal_uInt16 nId)
const SfxItemPropertyMapEntry * getByName(std::u16string_view rName) const
const o3tl::sorted_vector< const SfxItemPropertyMapEntry *, SfxItemPropertyMapCompare > & getPropertyEntries() const
SfxItemPool * GetPool() const
sal_uInt16 Count() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListeningAll()
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
constexpr tools::Long getHeight() const
constexpr tools::Long Height() const
constexpr tools::Long getWidth() const
constexpr tools::Long Width() const
const void * GetData()
std::size_t GetEndOfData() const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
css::uno::Any * GetUsrAnyForID(SfxItemPropertyMapEntry const &entry) const
bool AreThereOwnUsrAnys() const
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
const SfxItemPropertyMapEntry * getPropertyMapEntry(std::u16string_view rName) const
static void setPropertyValue(const SfxItemPropertyMapEntry *pMap, const css::uno::Any &rVal, SfxItemSet &rSet, bool bDontConvertNegativeValues)
const SfxItemPropertyMap & getPropertyMap() const
css::uno::Any getPropertyValue(const SfxItemPropertyMapEntry *pMap, SvxItemPropertySetUsrAnys &rAnys) const
this abstract class is the interface for an instance that likes to enhance the functionality of compo...
Definition: unomaster.hxx:34
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unoshape.cxx:3983
SVXCORE_DLLPUBLIC SvxShapeRect(SdrObject *pObj)
Definition: unoshape.cxx:3962
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshape.cxx:3971
virtual ~SvxShapeRect() noexcept override
Definition: unoshape.cxx:3967
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unoshape.cxx:3976
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
Definition: unoshape.cxx:3875
virtual OUString SAL_CALL getString() override
Definition: unoshape.cxx:3894
virtual bool setPropertyToDefaultImpl(const SfxItemPropertyMapEntry *pProperty) override
Definition: unoshape.cxx:3957
virtual void SAL_CALL setString(const OUString &aString) override
Definition: unoshape.cxx:3904
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, css::uno::Any &rValue) override
Definition: unoshape.cxx:3937
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unoshape.cxx:3805
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoshape.cxx:3851
virtual bool getPropertyStateImpl(const SfxItemPropertyMapEntry *pProperty, css::beans::PropertyState &rState) override
Definition: unoshape.cxx:3952
virtual ~SvxShapeText() noexcept override
Definition: unoshape.cxx:3783
virtual void unlock() override
called from the XActionLockable interface methods on final unlock
Definition: unoshape.cxx:3867
virtual void lock() override
called from the XActionLockable interface methods on initial locking
Definition: unoshape.cxx:3858
SvxShapeText(SdrObject *pObj)
Definition: unoshape.cxx:3767
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
Definition: unoshape.cxx:3841
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoshape.cxx:3836
virtual OUString SAL_CALL getImplementationName() override
Definition: unoshape.cxx:3817
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshape.cxx:3799
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unoshape.cxx:3823
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, const css::uno::Any &rValue) override
Definition: unoshape.cxx:3914
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
Definition: unoshape.cxx:3885
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unoshape.cxx:3829
virtual void Create(SdrObject *pNewOpj, SvxDrawPage *pNewPage) override
Definition: unoshape.cxx:3790
svx::PropertyChangeNotifier & getShapePropertyChangeNotifier()
Definition: unoshape.cxx:293
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyDefaults(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: unoshape.cxx:3114
OUString maShapeType
Definition: unoshape.hxx:317
void ForceMetricTo100th_mm(Pair &rPoint) const noexcept
Definition: unoshape.cxx:470
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
Definition: unoshape.cxx:3039
virtual css::uno::Reference< css::container::XIndexContainer > SAL_CALL getGluePoints() override
Definition: unoshape.cxx:3594
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unoshape.cxx:1043
SvxItemPropertySetUsrAnys maUrsAnys
Definition: unoshape.hxx:325
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, css::uno::Any &rValue)
Definition: unoshape.cxx:2526
virtual OUString SAL_CALL getName() override
Definition: unoshape.cxx:1155
virtual void SAL_CALL dispose() override
Definition: unoshape.cxx:1196
void InvalidateSdrObject()
Definition: unoshape.cxx:242
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) noexcept override
Definition: unoshape.cxx:942
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoshape.cxx:731
rtl::Reference< SdrObject > mxSdrObject
Definition: unoshape.hxx:327
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
Definition: unoshape.cxx:3656
virtual bool getPropertyStateImpl(const SfxItemPropertyMapEntry *pProperty, css::beans::PropertyState &rState)
Definition: unoshape.cxx:2947
void _setPropertyToDefault(const OUString &PropertyName)
Definition: unoshape.cxx:3021
SvxShape(SdrObject *pObj)
Definition: unoshape.cxx:196
virtual void lock()
called from the XActionLockable interface methods on initial locking
Definition: unoshape.cxx:3663
void setMaster(SvxShapeMaster *pMaster)
Definition: unoshape.cxx:263
virtual ~SvxShape() noexcept override
Definition: unoshape.cxx:222
virtual void SAL_CALL addActionLock() override
Definition: unoshape.cxx:3683
bool SetFillAttribute(sal_uInt16 nWID, const OUString &rName)
Definition: unoshape.cxx:1296
bool mbIsMultiPropertyCall
Definition: unoshape.hxx:321
css::uno::Sequence< OUString > _getSupportedServiceNames()
Definition: unoshape.cxx:3189
virtual void Create(SdrObject *pNewOpj, SvxDrawPage *pNewPage)
Definition: unoshape.cxx:357
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unoshape.cxx:1270
bool HasSdrObject() const
Definition: unoshape.hxx:174
virtual css::awt::Size SAL_CALL getSize() override
Definition: unoshape.cxx:1096
void updateShapeKind()
since polygon shapes can change their kind during editing, we have to recheck it here.
Definition: unoshape.cxx:3740
virtual void SAL_CALL setActionLocks(sal_Int16 nLock) override
Definition: unoshape.cxx:3707
virtual void SAL_CALL setSize(const css::awt::Size &aSize) override
Definition: unoshape.cxx:1112
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Sequence< css::uno::Any > &aValues) override
Definition: unoshape.cxx:1678
virtual void SAL_CALL setName(const OUString &aName) override
Definition: unoshape.cxx:1169
virtual void SAL_CALL removePropertiesChangeListener(const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
Definition: unoshape.cxx:1795
sal_uInt16 mnLockCount
used from the XActionLockable interface
Definition: unoshape.hxx:329
css::uno::Sequence< css::uno::Type > const & _getTypes()
Definition: unoshape.cxx:744
css::beans::PropertyState _getPropertyState(const OUString &PropertyName)
Definition: unoshape.cxx:1897
css::uno::Any _getPropertyDefault(const OUString &aPropertyName)
Definition: unoshape.cxx:3051
OUString maShapeName
Definition: unoshape.hxx:318
css::uno::WeakReference< css::container::XIndexContainer > mxGluePoints
Definition: unoshape.hxx:323
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unoshape.cxx:1611
virtual void SAL_CALL setPropertiesToDefault(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: unoshape.cxx:3107
virtual void unlock()
called from the XActionLockable interface methods on final unlock
Definition: unoshape.cxx:3669
std::unique_ptr< SvxShapeImpl > mpImpl
these members are used to optimize XMultiProperty calls
Definition: unoshape.hxx:320
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unoshape.cxx:1472
virtual OUString SAL_CALL getShapeType() override
Definition: unoshape.cxx:1185
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: unoshape.cxx:1748
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unoshape.cxx:1290
const SvxItemPropertySet * mpPropSet
Definition: unoshape.hxx:324
virtual void SAL_CALL addPropertiesChangeListener(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
Definition: unoshape.cxx:1791
css::uno::Reference< css::beans::XPropertySetInfo > const & _getPropertySetInfo()
same as SetFillAttribute but for property names instead of which ids, and the property found is retur...
Definition: unoshape.cxx:1264
SdrObjKind getShapeKind() const
Definition: unoshape.cxx:257
css::uno::Any _getPropertyValue(const OUString &PropertyName)
Definition: unoshape.cxx:1620
css::awt::Size maSize
Definition: unoshape.hxx:315
void _setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue)
Definition: unoshape.cxx:1484
virtual sal_Int16 SAL_CALL resetActionLocks() override
Definition: unoshape.cxx:3721
virtual bool setPropertyToDefaultImpl(const SfxItemPropertyMapEntry *pProperty)
Definition: unoshape.cxx:2977
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: unoshape.cxx:3009
virtual void SAL_CALL setAllPropertiesToDefault() override
Definition: unoshape.cxx:3077
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unoshape.cxx:1251
css::uno::Any GetAnyForItem(SfxItemSet const &aSet, const SfxItemPropertyMapEntry *pMap) const
Definition: unoshape.cxx:1804
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
Definition: unoshape.cxx:1066
void setShapeKind(SdrObjKind nKind)
Definition: unoshape.cxx:251
css::uno::Any GetBitmap(bool bMetaFile=false) const
Definition: unoshape.cxx:600
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
Definition: unoshape.cxx:3609
virtual sal_Bool SAL_CALL isActionLocked() override
Definition: unoshape.cxx:3675
void ObtainSettingsFromPropertySet(const SvxItemPropertySet &rPropSet)
Definition: unoshape.cxx:585
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &aPropertyName) override
Definition: unoshape.cxx:2997
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
Definition: unoshape.cxx:1885
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: unoshape.cxx:1242
virtual void SAL_CALL firePropertiesChangeEvent(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
Definition: unoshape.cxx:1799
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unoshape.cxx:1284
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unoshape.cxx:1277
void endSetPropertyValues()
Definition: unoshape.cxx:1741
virtual OUString SAL_CALL getImplementationName() override
Definition: unoshape.cxx:3127
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unoshape.cxx:3177
virtual void SAL_CALL removeActionLock() override
Definition: unoshape.cxx:3695
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unoshape.cxx:1236
SdrObject * GetSdrObject() const
Definition: unoshape.hxx:173
void ForceMetricToItemPoolMetric(Pair &rPoint) const noexcept
Definition: unoshape.cxx:414
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unoshape.cxx:3588
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, const css::uno::Any &rValue)
Definition: unoshape.cxx:2019
SVX_DLLPRIVATE void impl_initFromSdrObject()
initializes SdrObj-dependent members.
Definition: unoshape.cxx:314
SVX_DLLPRIVATE void impl_construct()
CTOR-Impl.
Definition: unoshape.cxx:299
css::awt::Point maPosition
Definition: unoshape.hxx:316
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &aType) override
Definition: unoshape.cxx:269
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoshape.cxx:937
virtual void SAL_CALL setString(const OUString &aString) override
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType)
virtual OUString SAL_CALL getString() override
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
static OUString getNameFromId(SdrObjKind nId)
Definition: unoprov.cxx:834
static css::uno::Reference< css::awt::XBitmap > CreateBitmap(const BitmapEx &rBitmap)
const GraphicObject & GetGraphicObject() const
Definition: xtable.hxx:125
model::ThemeColor & GetThemeColor()
Definition: xcolit.hxx:53
const XDash & GetDash() const
Definition: xtable.hxx:80
const XGradient & GetGradient() const
Definition: xtable.hxx:110
const XHatch & GetHatch() const
Definition: xtable.hxx:95
const basegfx::B2DPolyPolygon & GetLineEnd() const
Definition: xtable.hxx:65
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
double get(sal_uInt16 nRow, sal_uInt16 nColumn) const
void transform(const basegfx::B2DHomMatrix &rMatrix)
sal_uInt32 count() const
BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix &rMatrix)
bool isEmpty() const
const css::uno::Sequence< sal_Int8 > & getSeq() const
mutable::osl::Mutex m_aMutex
oslInterlockedCount m_refCount
css::uno::Type const & get()
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &aViewInformation) const
std::vector< Transformation > const & getTransformations() const
ThemeColorType getType() const
void getViewIndependentPrimitive2DContainer(drawinglayer::primitive2d::Primitive2DDecompositionVisitor &rVisitor) const
helper class for notifying XPropertyChangeListeners
Default provider for a property value.
::cppu::OWeakObject & getContext() const
virtual void getCurrentValue(css::uno::Any &_out_rValue) const
returns the current value of the property which the provider is responsible for
constexpr tools::Long GetWidth() const
constexpr tools::Long Top() const
void SetSize(const Size &)
constexpr Point TopLeft() const
tools::Long getOpenHeight() const
void SetPos(const Point &rPoint)
void setWidth(tools::Long n)
constexpr Size GetSize() const
constexpr tools::Long Right() const
constexpr tools::Long GetHeight() const
void setHeight(tools::Long n)
tools::Long getOpenWidth() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
int nCount
#define DBG_ASSERT(sCon, aError)
#define DBG_TESTSOLARMUTEX()
double toRadians(D x)
#define DBG_UNHANDLED_EXCEPTION(...)
virtual OUString GetName() const override
virtual void GetDescription(OUString &rName) override
float u
EmbeddedObjectRef * pObject
sal_Int16 nValue
Definition: fmsrccfg.cxx:81
uno::Reference< uno::XInterface > SvxUnoGluePointAccess_createInstance(SdrObject *pObject)
Create a SvxUnoGluePointAccess.
Definition: gluepts.cxx:517
std::mutex m_aMutex
OUString aName
Mode eMode
void * p
sal_uInt16 nPos
Sequence< sal_Int8 > aSeq
#define SAL_WARN_IF(condition, area, stream)
MapUnit
#define MID_COLOR_LUM_MOD
#define MID_NAME
#define MID_COLOR_THEME_REFERENCE
#define MID_COLOR_THEME_INDEX
#define MID_COLOR_LUM_OFF
NONE
B2DHomMatrix createScaleB2DHomMatrix(double fScaleX, double fScaleY)
B2DPolyPolygon UnoPointSequenceSequenceToB2DPolyPolygon(const css::drawing::PointSequenceSequence &rPointSequenceSequenceSource)
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
void B2DPolyPolygonToUnoPolyPolygonBezierCoords(const B2DPolyPolygon &rPolyPolygon, css::drawing::PolyPolygonBezierCoords &rPolyPolygonBezierCoordsRetval)
B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
B2DPolyPolygon UnoPolyPolygonBezierCoordsToB2DPolyPolygon(const css::drawing::PolyPolygonBezierCoords &rPolyPolygonBezierCoordsSource)
B2IRange fround(const B2DRange &rRange)
size
sal_Int64 getSomethingImpl(const css::uno::Sequence< sal_Int8 > &rId, T *pThis, FallbackToGetSomethingOf< Base >={})
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
BitmapEx convertPrimitive2DContainerToBitmapEx(primitive2d::Primitive2DContainer &&rSequence, const basegfx::B2DRange &rTargetRange, sal_uInt32 nMaximumQuadraticPixels, const o3tl::Length eTargetUnit, const std::optional< Size > &rTargetDPI)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
void dispose()
long Long
UNOTOOLS_DLLPUBLIC bool GetTitle(OUString const &url, OUString *title)
sal_Int16 nId
SvxUnoPropertyMapProvider & getSvxMapProvider()
Definition: unoprov.cxx:861
static SfxItemSet & rSet
css::uno::Type aType
svx::PropertyChangeNotifier maPropertyNotifier
Definition: unoshape.cxx:129
::unotools::WeakReference< SdrObject > mxCreatedObj
CL, OD 2005-07-19 #i52126# - this is initially 0 and set when a SvxShape::Create() call is executed.
Definition: unoshape.cxx:125
std::optional< SfxItemSet > mxItemSet
Definition: unoshape.cxx:115
SvxShapeMaster * mpMaster
Definition: unoshape.cxx:117
::comphelper::OInterfaceContainerHelper3< css::lang::XEventListener > maDisposeListeners
Definition: unoshape.cxx:128
SdrObjKind mnObjId
Definition: unoshape.cxx:116
bool mbDisposing
Definition: unoshape.cxx:118
SvxShapeImpl(SvxShape &_rAntiImpl, ::osl::Mutex &_rMutex)
Definition: unoshape.cxx:131
UNDERLYING_TYPE get() const
bool hasValue()
constexpr TypedWhichId< SdrAngleItem > SDRATTR_CIRCSTARTANGLE(SDRATTR_CIRC_FIRST+1)
constexpr TypedWhichId< SdrShearAngleItem > SDRATTR_SHEARANGLE(SDRATTR_NOTPERSIST_FIRST+17)
constexpr TypedWhichId< SdrCircKindItem > SDRATTR_CIRCKIND(SDRATTR_CIRC_FIRST+0)
constexpr TypedWhichId< SdrLayerNameItem > SDRATTR_LAYERNAME(SDRATTR_NOTPERSIST_FIRST+4)
constexpr TypedWhichId< SdrTextFitToSizeTypeItem > SDRATTR_TEXT_FITTOSIZE(SDRATTR_MISC_FIRST+3)
constexpr TypedWhichId< SvXMLAttrContainerItem > SDRATTR_XMLATTRIBUTES(SDRATTR_MISC_FIRST+22)
constexpr TypedWhichId< SdrLayerIdItem > SDRATTR_LAYERID(SDRATTR_NOTPERSIST_FIRST+3)
constexpr TypedWhichId< SdrObjPrintableItem > SDRATTR_OBJPRINTABLE(SDRATTR_NOTPERSIST_FIRST+2)
constexpr TypedWhichId< SdrAngleItem > SDRATTR_CIRCENDANGLE(SDRATTR_CIRC_FIRST+2)
constexpr TypedWhichId< SdrYesNoItem > SDRATTR_OBJSIZEPROTECT(SDRATTR_NOTPERSIST_FIRST+1)
constexpr TypedWhichId< SdrObjVisibleItem > SDRATTR_OBJVISIBLE(SDRATTR_NOTPERSIST_FIRST+35)
constexpr TypedWhichId< SdrYesNoItem > SDRATTR_OBJMOVEPROTECT(SDRATTR_NOTPERSIST_FIRST+0)
constexpr TypedWhichId< SfxStringItem > SDRATTR_OBJECTNAME(SDRATTR_NOTPERSIST_FIRST+5)
constexpr sal_uInt16 SDRATTR_NOTPERSIST_LAST(SDRATTR_OBJVISIBLE)
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_CORNER_RADIUS(SDRATTR_MISC_FIRST+0)
constexpr TypedWhichId< SvxFrameDirectionItem > SDRATTR_WRITINGMODE2(SDRATTR_WRITINGMODE2_FIRST+0)
constexpr sal_uInt16 SDRATTR_NOTPERSIST_FIRST(SDRATTR_CIRC_LAST+1)
constexpr TypedWhichId< SdrAngleItem > SDRATTR_ROTATEANGLE(SDRATTR_NOTPERSIST_FIRST+16)
SdrTextObj * DynCastSdrTextObj(SdrObject *pObj)
Definition: svdobj.cxx:3217
SdrInventor
Definition: svdobj.hxx:99
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
@ OLE2Applet
table
@ Line
object group
@ Polygon
circle cut
@ Table
media shape
@ FreehandLine
closed Bezier-curve
@ UNO
continuously activated OLE (PlugIn-Frame or similar)
@ PathLine
PolyLine.
@ CustomShape
Universal Network Object packed into SvDraw object.
@ CircleOrEllipse
rectangle (round corners optional)
@ PathPoly
caption object
@ Text
closed free-hand line
@ OLE2
foreign graphic (StarView Graphic)
@ OLEPluginFrame
measurement object
@ Graphic
OutlineText, special text object for StarDraw.
@ CircleCut
circle arc
@ Rectangle
line
@ PathPolyLine
Polygon/PolyPolygon represented by SdrPathObj.
@ CircleSection
circle, ellipse
@ OutlineText
TitleText, special text object for StarDraw.
@ CircleArc
circle section
@ PolyLine
polygon, PolyPolygon
@ Edge
OLE object.
@ TitleText
text object
@ FreehandFill
open free-hand line
o3tl::strong_int< sal_Int16, struct SdrLayerIDTag > SdrLayerID
Definition: svdtypes.hxx:56
bool bVisible
unsigned char sal_Bool
signed char sal_Int8
OUString sId
OUString SvxUnogetInternalNameForItem(const sal_uInt16 nWhich, const OUString &rApiName)
if the given name is a predefined api name it is replaced by the predefined name for the current lang...
Definition: unoprov.cxx:2017
#define SVXMAP_SHAPE
Sorter.
Definition: unoprov.hxx:52
#define SVXMAP_TEXT
Definition: unoprov.hxx:72
constexpr OUStringLiteral sUNO_service_drawing_OLE2Shape
Definition: unoshape.cxx:3167
constexpr OUStringLiteral sUNO_service_style_CharacterPropertiesAsian
Definition: unoshape.cxx:3137
constexpr OUStringLiteral sUNO_service_drawing_EllipseShape
Definition: unoshape.cxx:3160
constexpr OUStringLiteral sUNO_service_style_CharacterProperties
Definition: unoshape.cxx:3135
constexpr OUStringLiteral sUNO_service_drawing_PolyPolygonShape
Definition: unoshape.cxx:3161
constexpr OUStringLiteral sUNO_service_drawing_CaptionShape
Definition: unoshape.cxx:3169
constexpr OUStringLiteral sUNO_service_drawing_MeasureProperties
Definition: unoshape.cxx:3143
constexpr OUStringLiteral sUNO_service_drawing_ConnectorShape
Definition: unoshape.cxx:3173
constexpr OUStringLiteral sUNO_service_style_CharacterPropertiesComplex
Definition: unoshape.cxx:3136
constexpr OUStringLiteral sUNO_service_drawing_TextProperties
Definition: unoshape.cxx:3140
constexpr OUStringLiteral sUNO_service_drawing_GraphicObjectShape
Definition: unoshape.cxx:3166
constexpr OUStringLiteral sUNO_service_drawing_ClosedBezierShape
Definition: unoshape.cxx:3164
constexpr OUStringLiteral sUNO_service_drawing_PageShape
Definition: unoshape.cxx:3168
static bool svx_needLogicRectHack(SdrObject const *pObj)
Definition: unoshape.cxx:990
constexpr OUStringLiteral sUNO_service_drawing_FillProperties
Definition: unoshape.cxx:3139
constexpr OUStringLiteral sUNO_service_drawing_LineShape
Definition: unoshape.cxx:3157
static void svx_setLogicRectHack(SdrObject *pObj, const tools::Rectangle &rRect)
Definition: unoshape.cxx:1030
constexpr OUStringLiteral sUNO_service_drawing_CustomShapeProperties
Definition: unoshape.cxx:3151
constexpr OUStringLiteral sUNO_service_drawing_Shape
Definition: unoshape.cxx:3158
constexpr OUStringLiteral sUNO_service_style_ParagraphProperties
Definition: unoshape.cxx:3132
constexpr OUStringLiteral sUNO_service_drawing_MeasureShape
Definition: unoshape.cxx:3170
constexpr OUStringLiteral sUNO_service_drawing_ConnectorProperties
Definition: unoshape.cxx:3142
constexpr OUStringLiteral sUNO_service_drawing_CustomShape
Definition: unoshape.cxx:3152
constexpr OUStringLiteral sUNO_service_drawing_PolyLineShape
Definition: unoshape.cxx:3162
void SvxItemPropertySet_setPropertyValue(const SfxItemPropertyMapEntry *pMap, const uno::Any &rVal, SfxItemSet &rSet)
Definition: unoshape.cxx:4012
constexpr OUStringLiteral sUNO_service_style_ParagraphPropertiesAsian
Definition: unoshape.cxx:3134
constexpr OUStringLiteral sUNO_service_drawing_Text
Definition: unoshape.cxx:3148
constexpr OUStringLiteral sUNO_service_drawing_PolyPolygonDescriptor
Definition: unoshape.cxx:3154
constexpr OUStringLiteral sUNO_service_drawing_RectangleShape
Definition: unoshape.cxx:3159
constexpr OUStringLiteral sUNO_service_drawing_GroupShape
Definition: unoshape.cxx:3149
constexpr OUStringLiteral sUNO_service_drawing_PolyPolygonBezierDescriptor
Definition: unoshape.cxx:3155
uno::Any SvxItemPropertySet_getPropertyValue(const SfxItemPropertyMapEntry *pMap, const SfxItemSet &rSet)
Definition: unoshape.cxx:4002
constexpr OUStringLiteral sUNO_service_drawing_MediaShape
Definition: unoshape.cxx:3174
constexpr OUStringLiteral sUNO_service_style_ParagraphPropertiesComplex
Definition: unoshape.cxx:3133
constexpr OUStringLiteral sUNO_service_drawing_TextShape
Definition: unoshape.cxx:3165
constexpr OUStringLiteral sUNO_service_drawing_RotationDescriptor
Definition: unoshape.cxx:3146
constexpr OUStringLiteral sUNO_service_drawing_ShadowProperties
Definition: unoshape.cxx:3144
static void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemPropertySet &rPropSet, SvxItemPropertySetUsrAnys &rAnys, SfxItemSet &rSet, const uno::Reference< beans::XPropertySet > &xSet, const SfxItemPropertyMap *pMap)
Definition: unoshape.cxx:538
constexpr OUStringLiteral sUNO_service_drawing_ControlShape
Definition: unoshape.cxx:3172
constexpr OUStringLiteral sUNO_service_drawing_LineProperties
Definition: unoshape.cxx:3141
constexpr OUStringLiteral sUNO_service_drawing_FrameShape
Definition: unoshape.cxx:3171
constexpr OUStringLiteral sUNO_service_drawing_OpenBezierShape
Definition: unoshape.cxx:3163
uno::Reference< drawing::XShape > GetXShapeForSdrObject(SdrObject *pObj) noexcept
returns a StarOffice API wrapper for the given SdrObject
Definition: unoshape.cxx:3989
static tools::Rectangle svx_getLogicRectHack(SdrObject const *pObj)
Definition: unoshape.cxx:1017
#define OWN_ATTR_MISC_OBJ_TITLE
Definition: unoshprp.hxx:167
#define OWN_ATTR_METAFILE
Definition: unoshprp.hxx:96
#define OWN_ATTR_HYPERLINK
Definition: unoshprp.hxx:198
#define OWN_ATTR_INTEROPGRABBAG
Definition: unoshprp.hxx:182
#define OWN_ATTR_EDGE_START_OBJ
Definition: unoshprp.hxx:90
#define OWN_ATTR_MEASURE_END_POS
Definition: unoshprp.hxx:110
#define OWN_ATTR_FILLBMP_MODE
Definition: unoshprp.hxx:114
#define OWN_ATTR_EDGE_POLYPOLYGONBEZIER
Definition: unoshprp.hxx:178
#define OWN_ATTR_TRANSFORMATION
Definition: unoshprp.hxx:115
#define OWN_ATTR_FRAMERECT
Definition: unoshprp.hxx:94
#define OWN_ATTR_TEXTCOLUMNS
Definition: unoshprp.hxx:197
#define OWN_ATTR_LDNAME
Definition: unoshprp.hxx:99
#define OWN_ATTR_BITMAP
Definition: unoshprp.hxx:89
#define OWN_ATTR_CAPTION_POINT
Definition: unoshprp.hxx:148
#define OWN_ATTR_LDBITMAP
Definition: unoshprp.hxx:100
#define OWN_ATTR_GLUEID_HEAD
Definition: unoshprp.hxx:107
#define OWN_ATTR_EDGE_START_POS
Definition: unoshprp.hxx:91
#define OWN_ATTR_PAGE_NUMBER
Definition: unoshprp.hxx:149
#define OWN_ATTR_GLUEID_TAIL
Definition: unoshprp.hxx:106
#define OWN_ATTR_BOUNDRECT
Definition: unoshprp.hxx:98
#define OWN_ATTR_MISC_OBJ_DESCRIPTION
Definition: unoshprp.hxx:168
#define OWN_ATTR_MEASURE_START_POS
Definition: unoshprp.hxx:109
#define OWN_ATTR_UINAME_SINGULAR
Definition: unoshprp.hxx:159
#define OWN_ATTR_EDGE_END_POS
Definition: unoshprp.hxx:93
#define OWN_ATTR_MIRRORED
Definition: unoshprp.hxx:104
#define OWN_ATTR_ZORDER
Definition: unoshprp.hxx:108
#define OWN_ATTR_TEXTFITTOSIZESCALE
Definition: unoshprp.hxx:196
#define OWN_ATTR_EDGE_END_OBJ
Definition: unoshprp.hxx:92
#define OWN_ATTR_ISFONTWORK
Definition: unoshprp.hxx:97
#define OWN_ATTR_UINAME_PLURAL
Definition: unoshprp.hxx:160
const SvxItemPropertySet * ImplGetSvxUnoOutlinerTextCursorSvxPropertySet()
VCL_DLLPUBLIC bool ConvertGDIMetaFileToWMF(const GDIMetaFile &rMTF, SvStream &rTargetStream, FilterConfigItem const *pConfigItem, bool bPlaceable=true)
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr TypedWhichId< XLineColorItem > XATTR_LINECOLOR(XATTR_LINE_FIRST+3)
constexpr TypedWhichId< SfxMetricItem > XATTR_FILLBMP_SIZEX(XATTR_FILL_FIRST+9)
constexpr TypedWhichId< XLineDashItem > XATTR_LINEDASH(XATTR_LINE_FIRST+1)
constexpr TypedWhichId< XLineEndItem > XATTR_LINEEND(XATTR_LINE_FIRST+5)
constexpr TypedWhichId< XLineStartItem > XATTR_LINESTART(XATTR_LINE_FIRST+4)
constexpr TypedWhichId< XFillBmpSizeYItem > XATTR_FILLBMP_SIZEY(XATTR_FILL_FIRST+10)
constexpr TypedWhichId< XFillBmpStretchItem > XATTR_FILLBMP_STRETCH(XATTR_FILL_FIRST+16)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
constexpr TypedWhichId< XFillBmpTileItem > XATTR_FILLBMP_TILE(XATTR_FILL_FIRST+7)
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)