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