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