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