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