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