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/globl3d.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  }
1124  }
1125  return false;
1126 }
1127 
1128 
1130 {
1131  if(svx_needLogicRectHack(pObj))
1132  {
1133  return pObj->GetSnapRect();
1134  }
1135  else
1136  {
1137  return pObj->GetLogicRect();
1138  }
1139 }
1140 
1141 
1142 static void svx_setLogicRectHack( SdrObject* pObj, const tools::Rectangle& rRect )
1143 {
1144  if(svx_needLogicRectHack(pObj))
1145  {
1146  pObj->SetSnapRect( rRect );
1147  }
1148  else
1149  {
1150  pObj->SetLogicRect( rRect );
1151  }
1152 }
1153 
1154 
1155 awt::Point SAL_CALL SvxShape::getPosition()
1156 {
1157  ::SolarMutexGuard aGuard;
1158 
1159  if(HasSdrObject())
1160  {
1162  Point aPt( aRect.Left(), aRect.Top() );
1163 
1164  // Position is relative to anchor, so recalc to absolute position
1166  aPt -= GetSdrObject()->GetAnchorPos();
1167 
1168  ForceMetricTo100th_mm(aPt);
1169  return css::awt::Point( aPt.X(), aPt.Y() );
1170  }
1171  else
1172  {
1173  return maPosition;
1174  }
1175 }
1176 
1177 
1178 void SAL_CALL SvxShape::setPosition( const awt::Point& Position )
1179 {
1180  ::SolarMutexGuard aGuard;
1181 
1182  if(HasSdrObject())
1183  {
1184  // do NOT move 3D objects, this would change the homogen
1185  // transformation matrix
1186  if(dynamic_cast<const E3dCompoundObject* >(GetSdrObject()) == nullptr)
1187  {
1189  Point aLocalPos( Position.X, Position.Y );
1190  ForceMetricToItemPoolMetric(aLocalPos);
1191 
1192  // Position is absolute, so recalc to position relative to anchor
1193  if( GetSdrObject()->getSdrModelFromSdrObject().IsWriter() )
1194  aLocalPos += GetSdrObject()->GetAnchorPos();
1195 
1196  long nDX = aLocalPos.X() - aRect.Left();
1197  long nDY = aLocalPos.Y() - aRect.Top();
1198 
1199  GetSdrObject()->Move( Size( nDX, nDY ) );
1201  }
1202  }
1203 
1204  maPosition = Position;
1205 }
1206 
1207 
1208 awt::Size SAL_CALL SvxShape::getSize()
1209 {
1210  ::SolarMutexGuard aGuard;
1211 
1212  if(HasSdrObject())
1213  {
1215  Size aObjSize( aRect.getWidth(), aRect.getHeight() );
1216  ForceMetricTo100th_mm(aObjSize);
1217  return css::awt::Size( aObjSize.getWidth(), aObjSize.getHeight() );
1218  }
1219  else
1220  return maSize;
1221 }
1222 
1223 
1224 void SAL_CALL SvxShape::setSize( const awt::Size& rSize )
1225 {
1226  ::SolarMutexGuard aGuard;
1227 
1228  if(HasSdrObject())
1229  {
1230  // #i123539# optimization for 3D chart object generation: do not use UNO
1231  // API commands to get the range, this is too expensive since for 3D
1232  // scenes it may recalculate the whole scene since in AOO this depends
1233  // on the contained geometry (layouted to show all content)
1234  const bool b3DConstruction(dynamic_cast< E3dObject* >(GetSdrObject()) && GetSdrObject()->getSdrModelFromSdrObject().isLocked());
1235  tools::Rectangle aRect(
1236  b3DConstruction ?
1237  tools::Rectangle(maPosition.X, maPosition.Y, maSize.Width, maSize.Height) :
1239  Size aLocalSize( rSize.Width, rSize.Height );
1240  ForceMetricToItemPoolMetric(aLocalSize);
1241 
1242  if(GetSdrObject()->GetObjInventor() == SdrInventor::Default && GetSdrObject()->GetObjIdentifier() == OBJ_MEASURE )
1243  {
1244  Fraction aWdt(aLocalSize.Width(),aRect.Right()-aRect.Left());
1245  Fraction aHgt(aLocalSize.Height(),aRect.Bottom()-aRect.Top());
1246  Point aPt = GetSdrObject()->GetSnapRect().TopLeft();
1247  GetSdrObject()->Resize(aPt,aWdt,aHgt);
1248  }
1249  else
1250  {
1251  //aRect.SetSize(aLocalSize); // this call subtract 1 // https://bz.apache.org/ooo/show_bug.cgi?id=83193
1252  if ( !aLocalSize.Width() )
1253  {
1254  aRect.SetWidthEmpty();
1255  }
1256  else
1257  aRect.setWidth(aLocalSize.Width());
1258  if ( !aLocalSize.Height() )
1259  {
1260  aRect.SetHeightEmpty();
1261  }
1262  else
1263  aRect.setHeight(aLocalSize.Height());
1264 
1265  svx_setLogicRectHack( GetSdrObject(), aRect );
1266  }
1267 
1269  }
1270  maSize = rSize;
1271 }
1272 
1273 
1274 // XNamed
1275 OUString SAL_CALL SvxShape::getName( )
1276 {
1277  ::SolarMutexGuard aGuard;
1278  if( HasSdrObject() )
1279  {
1280  return GetSdrObject()->GetName();
1281  }
1282  else
1283  {
1284  return maShapeName;
1285  }
1286 }
1287 
1288 
1289 void SAL_CALL SvxShape::setName( const OUString& aName )
1290 {
1291  ::SolarMutexGuard aGuard;
1292  if( HasSdrObject() )
1293  {
1294  GetSdrObject()->SetName( aName );
1295  }
1296  else
1297  {
1298  maShapeName = aName;
1299  }
1300 }
1301 
1302 // XShapeDescriptor
1303 
1304 
1305 OUString SAL_CALL SvxShape::getShapeType()
1306 {
1307  if( !maShapeType.getLength() )
1308  return UHashMap::getNameFromId( mpImpl->mnObjId );
1309  else
1310  return maShapeType;
1311 }
1312 
1313 // XComponent
1314 
1315 
1316 void SAL_CALL SvxShape::dispose()
1317 {
1318  ::SolarMutexGuard aGuard;
1319 
1320  if( mpImpl->mbDisposing )
1321  return; // caught a recursion
1322 
1323  mpImpl->mbDisposing = true;
1324 
1325  lang::EventObject aEvt;
1326  aEvt.Source = *static_cast<OWeakAggObject*>(this);
1327  mpImpl->maDisposeListeners.disposeAndClear(aEvt);
1328  mpImpl->maPropertyNotifier.disposing();
1329 
1330  if ( !HasSdrObject() )
1331  return;
1332 
1333  SdrObject* pObject = GetSdrObject();
1334 
1335  EndListening( pObject->getSdrModelFromSdrObject() );
1336  bool bFreeSdrObject = false;
1337 
1338  if ( pObject->IsInserted() && pObject->getSdrPageFromSdrObject() )
1339  {
1340  OSL_ENSURE( HasSdrObjectOwnership(), "SvxShape::dispose: is the below code correct?" );
1341  // normally, we are allowed to free the SdrObject only if we have its ownership.
1342  // Why isn't this checked here?
1343 
1344  SdrPage* pPage = pObject->getSdrPageFromSdrObject();
1345  // delete the SdrObject from the page
1346  const size_t nCount = pPage->GetObjCount();
1347  for ( size_t nNum = 0; nNum < nCount; ++nNum )
1348  {
1349  if ( pPage->GetObj( nNum ) == pObject )
1350  {
1351  OSL_VERIFY( pPage->RemoveObject( nNum ) == pObject );
1352  bFreeSdrObject = true;
1353  break;
1354  }
1355  }
1356  }
1357 
1358  pObject->setUnoShape(nullptr);
1359 
1360  if ( bFreeSdrObject )
1361  {
1362  // in case we have the ownership of the SdrObject, a Free
1363  // would do nothing. So ensure the ownership is reset.
1364  mpImpl->mbHasSdrObjectOwnership = false;
1365  SdrObject::Free( pObject );
1366  }
1367 }
1368 
1369 
1370 void SAL_CALL SvxShape::addEventListener( const Reference< lang::XEventListener >& xListener )
1371 {
1372  mpImpl->maDisposeListeners.addInterface(xListener);
1373 }
1374 
1375 
1376 void SAL_CALL SvxShape::removeEventListener( const Reference< lang::XEventListener >& aListener )
1377 {
1378  mpImpl->maDisposeListeners.removeInterface(aListener);
1379 }
1380 
1381 // XPropertySet
1382 
1383 
1386 {
1387  if( mpImpl->mpMaster )
1388  {
1389  return mpImpl->mpMaster->getPropertySetInfo();
1390  }
1391  else
1392  {
1393  return _getPropertySetInfo();
1394  }
1395 }
1396 
1399 {
1400  return mpPropSet->getPropertySetInfo();
1401 }
1402 
1403 
1404 void SAL_CALL SvxShape::addPropertyChangeListener( const OUString& _propertyName, const Reference< beans::XPropertyChangeListener >& _listener )
1405 {
1406  ::osl::MutexGuard aGuard( maMutex );
1407  mpImpl->maPropertyNotifier.addPropertyChangeListener( _propertyName, _listener );
1408 }
1409 
1410 
1411 void SAL_CALL SvxShape::removePropertyChangeListener( const OUString& _propertyName, const Reference< beans::XPropertyChangeListener >& _listener )
1412 {
1413  ::osl::MutexGuard aGuard( maMutex );
1414  mpImpl->maPropertyNotifier.removePropertyChangeListener( _propertyName, _listener );
1415 }
1416 
1417 
1418 void SAL_CALL SvxShape::addVetoableChangeListener( const OUString& , const Reference< beans::XVetoableChangeListener >& )
1419 {
1420  OSL_FAIL( "SvxShape::addVetoableChangeListener: don't have any vetoable properties, so why ...?" );
1421 }
1422 
1423 
1424 void SAL_CALL SvxShape::removeVetoableChangeListener( const OUString& , const Reference< beans::XVetoableChangeListener >& )
1425 {
1426  OSL_FAIL( "SvxShape::removeVetoableChangeListener: don't have any vetoable properties, so why ...?" );
1427 }
1428 
1429 
1430 bool SvxShape::SetFillAttribute( sal_uInt16 nWID, const OUString& rName )
1431 {
1432  if(HasSdrObject())
1433  {
1434  SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), {{nWID, nWID}} );
1435 
1436  if( SetFillAttribute( nWID, rName, aSet, &GetSdrObject()->getSdrModelFromSdrObject() ) )
1437  {
1438  //GetSdrObject()->SetItemSetAndBroadcast(aSet);
1440 
1441  return true;
1442  }
1443  }
1444 
1445  return false;
1446 }
1447 
1448 
1449 bool SvxShape::SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet, SdrModel const * pModel )
1450 {
1451  // check if an item with the given name and which id is inside the models
1452  // pool or the stylesheet pool, if found it's put in the itemset
1453  if( !SetFillAttribute( nWID, rName, rSet ) )
1454  {
1455  // we did not find such item in one of the pools, so we check
1456  // the property lists that are loaded for the model for items
1457  // that support such.
1458  OUString aStrName = SvxUnogetInternalNameForItem(nWID, rName);
1459 
1460  switch( nWID )
1461  {
1462  case XATTR_FILLBITMAP:
1463  {
1464  XBitmapListRef pBitmapList = pModel->GetBitmapList();
1465 
1466  if( !pBitmapList.is() )
1467  return false;
1468 
1469  long nPos = pBitmapList->GetIndex(aStrName);
1470  if( nPos == -1 )
1471  return false;
1472 
1473  const XBitmapEntry* pEntry = pBitmapList->GetBitmap(nPos);
1474  XFillBitmapItem aBmpItem(rName, pEntry->GetGraphicObject());
1475  rSet.Put(aBmpItem);
1476  break;
1477  }
1478  case XATTR_FILLGRADIENT:
1479  {
1480  XGradientListRef pGradientList = pModel->GetGradientList();
1481 
1482  if( !pGradientList.is() )
1483  return false;
1484 
1485  long nPos = pGradientList->GetIndex(aStrName);
1486  if( nPos == -1 )
1487  return false;
1488 
1489  const XGradientEntry* pEntry = pGradientList->GetGradient(nPos);
1490  XFillGradientItem aGrdItem(rName, pEntry->GetGradient());
1491  rSet.Put( aGrdItem );
1492  break;
1493  }
1494  case XATTR_FILLHATCH:
1495  {
1496  XHatchListRef pHatchList = pModel->GetHatchList();
1497 
1498  if( !pHatchList.is() )
1499  return false;
1500 
1501  long nPos = pHatchList->GetIndex(aStrName);
1502  if( nPos == -1 )
1503  return false;
1504 
1505  const XHatchEntry* pEntry = pHatchList->GetHatch( nPos );
1506  XFillHatchItem aHatchItem(rName, pEntry->GetHatch());
1507  rSet.Put( aHatchItem );
1508  break;
1509  }
1510  case XATTR_LINEEND:
1511  case XATTR_LINESTART:
1512  {
1513  XLineEndListRef pLineEndList = pModel->GetLineEndList();
1514 
1515  if( !pLineEndList.is() )
1516  return false;
1517 
1518  long nPos = pLineEndList->GetIndex(aStrName);
1519  if( nPos == -1 )
1520  return false;
1521 
1522  const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nPos);
1523  if( sal_uInt16(XATTR_LINEEND) == nWID )
1524  {
1525  XLineEndItem aLEItem(rName, pEntry->GetLineEnd());
1526  rSet.Put( aLEItem );
1527  }
1528  else
1529  {
1530  XLineStartItem aLSItem(rName, pEntry->GetLineEnd());
1531  rSet.Put( aLSItem );
1532  }
1533 
1534  break;
1535  }
1536  case XATTR_LINEDASH:
1537  {
1538  XDashListRef pDashList = pModel->GetDashList();
1539 
1540  if( !pDashList.is() )
1541  return false;
1542 
1543  long nPos = pDashList->GetIndex(aStrName);
1544  if( nPos == -1 )
1545  return false;
1546 
1547  const XDashEntry* pEntry = pDashList->GetDash(nPos);
1548  XLineDashItem aDashItem(rName, pEntry->GetDash());
1549  rSet.Put( aDashItem );
1550  break;
1551  }
1552  default:
1553  return false;
1554  }
1555  }
1556 
1557  return true;
1558 }
1559 
1560 
1561 bool SvxShape::SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet )
1562 {
1563  OUString aName = SvxUnogetInternalNameForItem(nWID, rName);
1564 
1565  if (aName.isEmpty())
1566  {
1567  switch( nWID )
1568  {
1569  case XATTR_LINEEND:
1570  case XATTR_LINESTART:
1571  {
1572  const basegfx::B2DPolyPolygon aEmptyPoly;
1573  if( nWID == sal_uInt16(XATTR_LINEEND) )
1574  rSet.Put( XLineEndItem( "", aEmptyPoly ) );
1575  else
1576  rSet.Put( XLineStartItem( "", aEmptyPoly ) );
1577 
1578  return true;
1579  }
1581  {
1582  // #85953# Set a disabled XFillFloatTransparenceItem
1584 
1585  return true;
1586  }
1587  }
1588 
1589  return false;
1590  }
1591 
1592  for (const SfxPoolItem* p : rSet.GetPool()->GetItemSurrogates(nWID))
1593  {
1594  const NameOrIndex* pItem = static_cast<const NameOrIndex*>(p);
1595  if( pItem->GetName() == aName )
1596  {
1597  rSet.Put( *pItem );
1598  return true;
1599  }
1600  }
1601 
1602  return false;
1603 }
1604 
1605 
1606 void SAL_CALL SvxShape::setPropertyValue( const OUString& rPropertyName, const uno::Any& rVal )
1607 {
1608  if( mpImpl->mpMaster )
1609  {
1610  mpImpl->mpMaster->setPropertyValue( rPropertyName, rVal );
1611  }
1612  else
1613  {
1614  _setPropertyValue( rPropertyName, rVal );
1615  }
1616 }
1617 
1618 void SvxShape::_setPropertyValue( const OUString& rPropertyName, const uno::Any& rVal )
1619 {
1620  ::SolarMutexGuard aGuard;
1621 
1622  const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(rPropertyName);
1623 
1624  if (!HasSdrObject())
1625  {
1626  // Since we have no actual sdr object right now, remember all
1627  // properties in a list. These properties will be set when the sdr
1628  // object is created.
1629 
1630  if (pMap && pMap->nWID)
1631  {
1632  // FIXME: We should throw a UnknownPropertyException here.
1633  // But since this class is aggregated from classes that
1634  // support additional properties that we don't know here we
1635  // silently store *all* properties, even if they may be not
1636  // supported after creation.
1637  mpPropSet->setPropertyValue( pMap, rVal );
1638  }
1639 
1640  return;
1641  }
1642 
1643  if (!pMap)
1644  {
1645  // reduce log noise by ignoring two properties that higher level code queries for on all objects
1646  SAL_WARN_IF(rPropertyName != "FromWordArt" && rPropertyName != "GraphicColorMode",
1647  "svx.uno", "Unknown Property: " << rPropertyName);
1648  throw beans::UnknownPropertyException( rPropertyName, static_cast<cppu::OWeakObject*>(this));
1649  }
1650 
1651  if ((pMap->nFlags & beans::PropertyAttribute::READONLY) != 0)
1652  throw beans::PropertyVetoException(
1653  "Readonly property can't be set: " + rPropertyName,
1654  uno::Reference<drawing::XShape>(this));
1655 
1657 
1658  if (setPropertyValueImpl(rPropertyName, pMap, rVal))
1659  return;
1660 
1661  DBG_ASSERT( pMap->nWID == SDRATTR_TEXTDIRECTION || pMap->nWID < SDRATTR_NOTPERSIST_FIRST || pMap->nWID > SDRATTR_NOTPERSIST_LAST, "Not persist item not handled!" );
1662  DBG_ASSERT( pMap->nWID < OWN_ATTR_VALUE_START || pMap->nWID > OWN_ATTR_VALUE_END, "Not item property not handled!" );
1663 
1664  bool bIsNotPersist = pMap->nWID >= SDRATTR_NOTPERSIST_FIRST && pMap->nWID <= SDRATTR_NOTPERSIST_LAST && pMap->nWID != SDRATTR_TEXTDIRECTION;
1665 
1666  if( pMap->nWID == SDRATTR_ECKENRADIUS )
1667  {
1668  sal_Int32 nCornerRadius = 0;
1669  if( !(rVal >>= nCornerRadius) || (nCornerRadius < 0) || (nCornerRadius > 5000000))
1670  throw IllegalArgumentException();
1671  }
1672 
1673  SfxItemSet* pSet;
1674  if( mbIsMultiPropertyCall && !bIsNotPersist )
1675  {
1676  if( mpImpl->mpItemSet == nullptr )
1677  {
1678  mpImpl->mpItemSet.reset(new SfxItemSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), {{pMap->nWID, pMap->nWID}}));
1679  }
1680  else
1681  {
1682  mpImpl->mpItemSet->MergeRange(pMap->nWID, pMap->nWID);
1683  }
1684  pSet = mpImpl->mpItemSet.get();
1685  }
1686  else
1687  {
1688  pSet = new SfxItemSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), {{pMap->nWID, pMap->nWID}});
1689  }
1690 
1691  if( pSet->GetItemState( pMap->nWID ) != SfxItemState::SET )
1692  pSet->Put(GetSdrObject()->GetMergedItem(pMap->nWID));
1693 
1694  if( !SvxUnoTextRangeBase::SetPropertyValueHelper( pMap, rVal, *pSet ))
1695  {
1696  if( pSet->GetItemState( pMap->nWID ) != SfxItemState::SET )
1697  {
1698  if(bIsNotPersist)
1699  {
1700  // not-persistent attribute, get those extra
1701  GetSdrObject()->TakeNotPersistAttr(*pSet);
1702  }
1703  }
1704 
1705  if( pSet->GetItemState( pMap->nWID ) != SfxItemState::SET )
1706  {
1707  // get default from ItemPool
1708  if(SfxItemPool::IsWhich(pMap->nWID))
1709  pSet->Put(GetSdrObject()->getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
1710  }
1711 
1712  if( pSet->GetItemState( pMap->nWID ) == SfxItemState::SET )
1713  {
1714  SvxItemPropertySet_setPropertyValue( pMap, rVal, *pSet );
1715  }
1716  }
1717 
1718  if(bIsNotPersist)
1719  {
1720  // set not-persistent attribute extra
1721  GetSdrObject()->ApplyNotPersistAttr( *pSet );
1722  delete pSet;
1723  }
1724  else
1725  {
1726  // if we have a XMultiProperty call then the item set
1727  // will be set in setPropertyValues later
1728  if( !mbIsMultiPropertyCall )
1729  {
1731 
1732  delete pSet;
1733  }
1734  }
1735 }
1736 
1737 
1738 uno::Any SAL_CALL SvxShape::getPropertyValue( const OUString& PropertyName )
1739 {
1740  if ( mpImpl->mpMaster )
1741  return mpImpl->mpMaster->getPropertyValue( PropertyName );
1742  else
1743  return _getPropertyValue( PropertyName );
1744 }
1745 
1746 
1747 uno::Any SvxShape::_getPropertyValue( const OUString& PropertyName )
1748 {
1749  ::SolarMutexGuard aGuard;
1750 
1751  const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName);
1752 
1753  uno::Any aAny;
1754  if(HasSdrObject())
1755  {
1756  if(pMap == nullptr )
1757  throw beans::UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this));
1758 
1759  if( !getPropertyValueImpl( PropertyName, pMap, aAny ) )
1760  {
1761  DBG_ASSERT( pMap->nWID == SDRATTR_TEXTDIRECTION || (pMap->nWID < SDRATTR_NOTPERSIST_FIRST || pMap->nWID > SDRATTR_NOTPERSIST_LAST), "Not persist item not handled!" );
1762  DBG_ASSERT( pMap->nWID < OWN_ATTR_VALUE_START || pMap->nWID > OWN_ATTR_VALUE_END, "Not item property not handled!" );
1763 
1764  SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), {{pMap->nWID, pMap->nWID}});
1765  aSet.Put(GetSdrObject()->GetMergedItem(pMap->nWID));
1766 
1767  if(SvxUnoTextRangeBase::GetPropertyValueHelper( aSet, pMap, aAny ))
1768  return aAny;
1769 
1770  if(!aSet.Count())
1771  {
1773  {
1774  // not-persistent attribute, get those extra
1776  }
1777  }
1778 
1779  if(!aSet.Count())
1780  {
1781  // get default from ItemPool
1782  if(SfxItemPool::IsWhich(pMap->nWID))
1783  aSet.Put(GetSdrObject()->getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
1784  }
1785 
1786  if(aSet.Count())
1787  aAny = GetAnyForItem( aSet, pMap );
1788  }
1789  }
1790  else
1791  {
1792 
1793 // Fixme: we should return default values for OWN_ATTR !
1794 
1795  if(pMap && pMap->nWID)
1796 // FixMe: see setPropertyValue
1797  aAny = mpPropSet->getPropertyValue( pMap );
1798 
1799  }
1800  return aAny;
1801 }
1802 
1803 
1804 // XMultiPropertySet
1805 void SAL_CALL SvxShape::setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues )
1806 {
1807  ::SolarMutexGuard aSolarGuard;
1808 
1809  const sal_Int32 nCount = aPropertyNames.getLength();
1810  const OUString* pNames = aPropertyNames.getConstArray();
1811 
1812  const uno::Any* pValues = aValues.getConstArray();
1813 
1814  // make sure mbIsMultiPropertyCall and mpImpl->mpItemSet are
1815  // reset even when an exception is thrown
1816  const ::comphelper::ScopeGuard aGuard( [this] () { return this->endSetPropertyValues(); } );
1817 
1818  mbIsMultiPropertyCall = true;
1819 
1820  if( mpImpl->mpMaster )
1821  {
1822  for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++, pNames++, pValues++ )
1823  {
1824  try
1825  {
1826  setPropertyValue( *pNames, *pValues );
1827  }
1828  catch( beans::UnknownPropertyException& ) {}
1829  catch( uno::Exception& ) {}
1830  }
1831  }
1832  else
1833  {
1834  uno::Reference< beans::XPropertySet > xSet;
1836 
1837  for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++, pNames++, pValues++ )
1838  {
1839  try
1840  {
1841  xSet->setPropertyValue( *pNames, *pValues );
1842  }
1843  catch( beans::UnknownPropertyException& ) {}
1844  catch( uno::Exception& ) {}
1845  }
1846  }
1847 
1848  if( mpImpl->mpItemSet && HasSdrObject() )
1850 }
1851 
1852 
1854 {
1855  mbIsMultiPropertyCall = false;
1856  mpImpl->mpItemSet.reset();
1857 }
1858 
1859 
1860 css::uno::Sequence< css::uno::Any > SAL_CALL SvxShape::getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames )
1861 {
1862  const sal_Int32 nCount = aPropertyNames.getLength();
1863  const OUString* pNames = aPropertyNames.getConstArray();
1864 
1865  uno::Sequence< uno::Any > aRet( nCount );
1866  uno::Any* pValue = aRet.getArray();
1867 
1868  if( mpImpl->mpMaster )
1869  {
1870  for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++, pValue++, pNames++ )
1871  {
1872  try
1873  {
1874  *pValue = getPropertyValue( *pNames );
1875  }
1876  catch( uno::Exception& )
1877  {
1878  OSL_FAIL( "SvxShape::getPropertyValues, unknown property asked" );
1879  }
1880  }
1881  }
1882  else
1883  {
1884  uno::Reference< beans::XPropertySet > xSet;
1886 
1887  for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++, pValue++, pNames++ )
1888  {
1889  try
1890  {
1891  *pValue = xSet->getPropertyValue( *pNames );
1892  }
1893  catch( uno::Exception& )
1894  {
1895  OSL_FAIL( "SvxShape::getPropertyValues, unknown property asked" );
1896  }
1897  }
1898  }
1899 
1900  return aRet;
1901 }
1902 
1903 void SAL_CALL SvxShape::addPropertiesChangeListener( const css::uno::Sequence< OUString >& , const css::uno::Reference< css::beans::XPropertiesChangeListener >& )
1904 {
1905 }
1906 
1907 void SAL_CALL SvxShape::removePropertiesChangeListener( const css::uno::Reference< css::beans::XPropertiesChangeListener >& )
1908 {
1909 }
1910 
1911 void SAL_CALL SvxShape::firePropertiesChangeEvent( const css::uno::Sequence< OUString >& , const css::uno::Reference< css::beans::XPropertiesChangeListener >& )
1912 {
1913 }
1914 
1915 
1917 {
1919  uno::Any aAny;
1920 
1921  switch(pMap->nWID)
1922  {
1924  {
1925  const SfxPoolItem* pPoolItem=nullptr;
1926  if(aSet.GetItemState(SDRATTR_CIRCSTARTANGLE,false,&pPoolItem)==SfxItemState::SET)
1927  {
1928  sal_Int32 nAngle = static_cast<const SdrAngleItem*>(pPoolItem)->GetValue();
1929  aAny <<= nAngle;
1930  }
1931  break;
1932  }
1933 
1934  case SDRATTR_CIRCENDANGLE:
1935  {
1936  const SfxPoolItem* pPoolItem=nullptr;
1937  if (aSet.GetItemState(SDRATTR_CIRCENDANGLE,false,&pPoolItem)==SfxItemState::SET)
1938  {
1939  sal_Int32 nAngle = static_cast<const SdrAngleItem*>(pPoolItem)->GetValue();
1940  aAny <<= nAngle;
1941  }
1942  break;
1943  }
1944 
1945  case SDRATTR_CIRCKIND:
1946  {
1948  {
1949  drawing::CircleKind eKind;
1950  switch(GetSdrObject()->GetObjIdentifier())
1951  {
1952  case OBJ_CIRC: // circle, ellipse
1953  eKind = drawing::CircleKind_FULL;
1954  break;
1955  case OBJ_CCUT: // segment of circle
1956  eKind = drawing::CircleKind_CUT;
1957  break;
1958  case OBJ_CARC: // arc of circle
1959  eKind = drawing::CircleKind_ARC;
1960  break;
1961  case OBJ_SECT: // sector
1962  eKind = drawing::CircleKind_SECTION;
1963  break;
1964  }
1965  aAny <<= eKind;
1966  }
1967  break;
1968  }
1969  default:
1970  {
1971  // get value from ItemSet
1972  aAny = SvxItemPropertySet_getPropertyValue( pMap, aSet );
1973 
1974  if( pMap->aType != aAny.getValueType() )
1975  {
1976  // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here
1977  if( ( pMap->aType == ::cppu::UnoType<sal_Int16>::get()) && aAny.getValueType() == ::cppu::UnoType<sal_Int32>::get() )
1978  {
1979  sal_Int32 nValue = 0;
1980  aAny >>= nValue;
1981  aAny <<= static_cast<sal_Int16>(nValue);
1982  }
1983  else
1984  {
1985  OSL_FAIL("SvxShape::GetAnyForItem() Returnvalue has wrong Type!" );
1986  }
1987  }
1988 
1989  }
1990  }
1991 
1992  return aAny;
1993 }
1994 
1995 
1996 // XPropertyState
1997 beans::PropertyState SAL_CALL SvxShape::getPropertyState( const OUString& PropertyName )
1998 {
1999  if( mpImpl->mpMaster )
2000  {
2001  return mpImpl->mpMaster->getPropertyState( PropertyName );
2002  }
2003  else
2004  {
2005  return _getPropertyState( PropertyName );
2006  }
2007 }
2008 
2009 beans::PropertyState SvxShape::_getPropertyState( const OUString& PropertyName )
2010 {
2011  ::SolarMutexGuard aGuard;
2012 
2013  const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName);
2014 
2015  if( !HasSdrObject() || pMap == nullptr )
2016  throw beans::UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this));
2017 
2018  beans::PropertyState eState;
2019  if( !getPropertyStateImpl( pMap, eState ) )
2020  {
2021  const SfxItemSet& rSet = GetSdrObject()->GetMergedItemSet();
2022 
2023  switch( rSet.GetItemState( pMap->nWID, false ) )
2024  {
2025  case SfxItemState::READONLY:
2026  case SfxItemState::SET:
2027  eState = beans::PropertyState_DIRECT_VALUE;
2028  break;
2029  case SfxItemState::DEFAULT:
2030  eState = beans::PropertyState_DEFAULT_VALUE;
2031  break;
2032  default:
2033  eState = beans::PropertyState_AMBIGUOUS_VALUE;
2034  break;
2035  }
2036 
2037  // if an item is set, this doesn't mean we want it :)
2038  if( beans::PropertyState_DIRECT_VALUE == eState )
2039  {
2040  switch( pMap->nWID )
2041  {
2042  // the following items are disabled by changing the
2043  // fill style or the line style. so there is no need
2044  // to export items without names which should be empty
2045  case XATTR_FILLBITMAP:
2046  case XATTR_FILLGRADIENT:
2047  case XATTR_FILLHATCH:
2048  case XATTR_LINEDASH:
2049  {
2050  const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>(pMap->nWID);
2051  if( ( pItem == nullptr ) || pItem->GetName().isEmpty() )
2052  eState = beans::PropertyState_DEFAULT_VALUE;
2053  }
2054  break;
2055 
2056  // #i36115#
2057  // If e.g. the LineStart is on NONE and thus the string has length 0, it still
2058  // may be a hard attribute covering the set LineStart of the parent (Style).
2059  // #i37644#
2060  // same is for fill float transparency
2061  case XATTR_LINEEND:
2062  case XATTR_LINESTART:
2064  {
2065  const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>(pMap->nWID);
2066  if ( pItem == nullptr )
2067  eState = beans::PropertyState_DEFAULT_VALUE;
2068  }
2069  break;
2070  }
2071  }
2072  }
2073  return eState;
2074 }
2075 
2076 bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue )
2077 {
2078  switch( pProperty->nWID )
2079  {
2081  {
2082  awt::Point aPnt;
2083  if( rValue >>= aPnt )
2084  {
2085  Point aVclPoint( aPnt.X, aPnt.Y );
2086 
2087  // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
2088  // Need to adapt aVclPoint from 100thmm to app-specific
2089  ForceMetricToItemPoolMetric(aVclPoint);
2090 
2091  // #90763# position is relative to top left, make it absolute
2092  basegfx::B2DPolyPolygon aNewPolyPolygon;
2093  basegfx::B2DHomMatrix aNewHomogenMatrix;
2094  GetSdrObject()->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
2095 
2096  aVclPoint.AdjustX(basegfx::fround(aNewHomogenMatrix.get(0, 2)) );
2097  aVclPoint.AdjustY(basegfx::fround(aNewHomogenMatrix.get(1, 2)) );
2098 
2099  // #88491# position relative to anchor
2101  {
2102  aVclPoint += GetSdrObject()->GetAnchorPos();
2103  }
2104 
2105  static_cast<SdrCaptionObj*>(GetSdrObject())->SetTailPos(aVclPoint);
2106 
2107  return true;
2108  }
2109  break;
2110  }
2112  {
2113  drawing::HomogenMatrix3 aMatrix;
2114  if(rValue >>= aMatrix)
2115  {
2116  basegfx::B2DPolyPolygon aNewPolyPolygon;
2117  basegfx::B2DHomMatrix aNewHomogenMatrix;
2118 
2119  // tdf#117145 SdrModel data is app-specific
2120  GetSdrObject()->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
2121 
2122  aNewHomogenMatrix.set(0, 0, aMatrix.Line1.Column1);
2123  aNewHomogenMatrix.set(0, 1, aMatrix.Line1.Column2);
2124  aNewHomogenMatrix.set(0, 2, aMatrix.Line1.Column3);
2125  aNewHomogenMatrix.set(1, 0, aMatrix.Line2.Column1);
2126  aNewHomogenMatrix.set(1, 1, aMatrix.Line2.Column2);
2127  aNewHomogenMatrix.set(1, 2, aMatrix.Line2.Column3);
2128  aNewHomogenMatrix.set(2, 0, aMatrix.Line3.Column1);
2129  aNewHomogenMatrix.set(2, 1, aMatrix.Line3.Column2);
2130  aNewHomogenMatrix.set(2, 2, aMatrix.Line3.Column3);
2131 
2132  // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
2133  // Need to adapt aNewHomogenMatrix from 100thmm to app-specific
2134  ForceMetricToItemPoolMetric(aNewHomogenMatrix);
2135 
2136  GetSdrObject()->TRSetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
2137  return true;
2138  }
2139  break;
2140  }
2141 
2142  case OWN_ATTR_ZORDER:
2143  {
2144  sal_Int32 nNewOrdNum = 0;
2145  if(rValue >>= nNewOrdNum)
2146  {
2148  if( pObjList )
2149  {
2150  SdrObject* pCheck =
2151  pObjList->SetObjectOrdNum( GetSdrObject()->GetOrdNum(), static_cast<size_t>(nNewOrdNum) );
2152  DBG_ASSERT( pCheck == GetSdrObject(), "GetOrdNum() failed!" );
2153  }
2154  return true;
2155  }
2156  break;
2157  }
2158  case OWN_ATTR_FRAMERECT:
2159  {
2160  awt::Rectangle aUnoRect;
2161  if(rValue >>= aUnoRect)
2162  {
2163  Point aTopLeft( aUnoRect.X, aUnoRect.Y );
2164  Size aObjSize( aUnoRect.Width, aUnoRect.Height );
2165  ForceMetricToItemPoolMetric(aTopLeft);
2166  ForceMetricToItemPoolMetric(aObjSize);
2167  tools::Rectangle aRect;
2168  aRect.SetPos(aTopLeft);
2169  aRect.SetSize(aObjSize);
2170  GetSdrObject()->SetSnapRect(aRect);
2171  return true;
2172  }
2173  break;
2174  }
2175  case OWN_ATTR_MIRRORED:
2176  {
2177  bool bMirror;
2178  if(rValue >>= bMirror )
2179  {
2180  SdrGrafObj* pObj = dynamic_cast< SdrGrafObj* >( GetSdrObject() );
2181  if( pObj )
2182  pObj->SetMirrored(bMirror);
2183  return true;
2184  }
2185  break;
2186  }
2188  case OWN_ATTR_EDGE_END_OBJ:
2189  case OWN_ATTR_GLUEID_HEAD:
2190  case OWN_ATTR_GLUEID_TAIL:
2192  case OWN_ATTR_EDGE_END_POS:
2194  {
2195  SdrEdgeObj* pEdgeObj = dynamic_cast< SdrEdgeObj* >(GetSdrObject());
2196  if(pEdgeObj)
2197  {
2198  switch(pProperty->nWID)
2199  {
2201  case OWN_ATTR_EDGE_END_OBJ:
2202  {
2203  Reference< drawing::XShape > xShape;
2204  if( rValue >>= xShape )
2205  {
2206  SdrObject* pNode = GetSdrObjectFromXShape( xShape );
2207  if( pNode )
2208  {
2209  pEdgeObj->ConnectToNode( pProperty->nWID == OWN_ATTR_EDGE_START_OBJ, pNode );
2210  pEdgeObj->setGluePointIndex( pProperty->nWID == OWN_ATTR_EDGE_START_OBJ );
2211  return true;
2212  }
2213  }
2214  break;
2215  }
2216 
2218  case OWN_ATTR_EDGE_END_POS:
2219  {
2220  awt::Point aUnoPoint;
2221  if( rValue >>= aUnoPoint )
2222  {
2223  Point aPoint( aUnoPoint.X, aUnoPoint.Y );
2224 
2225  // Reintroduction of fix for issue i59051 (#i108851#)
2226  // perform metric change before applying anchor position,
2227  // because the anchor position is in pool metric.
2228  ForceMetricToItemPoolMetric( aPoint );
2229  if( GetSdrObject()->getSdrModelFromSdrObject().IsWriter() )
2230  aPoint += GetSdrObject()->GetAnchorPos();
2231 
2232  pEdgeObj->SetTailPoint( pProperty->nWID == OWN_ATTR_EDGE_START_POS, aPoint );
2233  return true;
2234  }
2235  break;
2236  }
2237 
2238  case OWN_ATTR_GLUEID_HEAD:
2239  case OWN_ATTR_GLUEID_TAIL:
2240  {
2241  sal_Int32 nId = 0;
2242  if( rValue >>= nId )
2243  {
2244  pEdgeObj->setGluePointIndex( pProperty->nWID == OWN_ATTR_GLUEID_HEAD, nId );
2245  return true;
2246  }
2247  break;
2248  }
2250  {
2251  basegfx::B2DPolyPolygon aNewPolyPolygon;
2252 
2253  // #123616# be a little bit more flexible regarding the data type used
2254  if( auto s = o3tl::tryAccess<drawing::PointSequenceSequence>(rValue) )
2255  {
2256  // get polygpon data from PointSequenceSequence
2258  *s);
2259  }
2260  else if( auto cs = o3tl::tryAccess<drawing::PolyPolygonBezierCoords>(rValue) )
2261  {
2262  // get polygpon data from PolyPolygonBezierCoords
2264  *cs);
2265  }
2266 
2267  if(aNewPolyPolygon.count())
2268  {
2269  // Reintroduction of fix for issue i59051 (#i108851#)
2270  ForceMetricToItemPoolMetric( aNewPolyPolygon );
2271  if( GetSdrObject()->getSdrModelFromSdrObject().IsWriter() )
2272  {
2273  Point aPoint( GetSdrObject()->GetAnchorPos() );
2274  aNewPolyPolygon.transform(basegfx::utils::createTranslateB2DHomMatrix(aPoint.X(), aPoint.Y()));
2275  }
2276  pEdgeObj->SetEdgeTrackPath( aNewPolyPolygon );
2277  return true;
2278  }
2279  }
2280  }
2281  }
2282  break;
2283  }
2286  {
2287  SdrMeasureObj* pMeasureObj = dynamic_cast< SdrMeasureObj* >(GetSdrObject());
2288  awt::Point aUnoPoint;
2289  if(pMeasureObj && ( rValue >>= aUnoPoint ) )
2290  {
2291  Point aPoint( aUnoPoint.X, aUnoPoint.Y );
2292 
2293  // Reintroduction of fix for issue #i59051# (#i108851#)
2294  ForceMetricToItemPoolMetric( aPoint );
2295  if( GetSdrObject()->getSdrModelFromSdrObject().IsWriter() )
2296  aPoint += GetSdrObject()->GetAnchorPos();
2297 
2298  pMeasureObj->NbcSetPoint( aPoint, pProperty->nWID == OWN_ATTR_MEASURE_START_POS ? 0 : 1 );
2299  pMeasureObj->SetChanged();
2300  pMeasureObj->BroadcastObjectChange();
2301  return true;
2302  }
2303  break;
2304  }
2305  case OWN_ATTR_FILLBMP_MODE:
2306  {
2307  drawing::BitmapMode eMode;
2308  if(!(rValue >>= eMode) )
2309  {
2310  sal_Int32 nMode = 0;
2311  if(!(rValue >>= nMode))
2312  break;
2313 
2314  eMode = static_cast<drawing::BitmapMode>(nMode);
2315  }
2316  GetSdrObject()->SetMergedItem( XFillBmpStretchItem( eMode == drawing::BitmapMode_STRETCH ) );
2317  GetSdrObject()->SetMergedItem( XFillBmpTileItem( eMode == drawing::BitmapMode_REPEAT ) );
2318  return true;
2319  }
2320 
2321  case SDRATTR_LAYERID:
2322  {
2323  sal_Int16 nLayerId = sal_Int16();
2324  if( rValue >>= nLayerId )
2325  {
2327  if( pLayer )
2328  {
2329  GetSdrObject()->SetLayer(SdrLayerID(nLayerId));
2330  return true;
2331  }
2332  }
2333  break;
2334  }
2335 
2336  case SDRATTR_LAYERNAME:
2337  {
2338  OUString aLayerName;
2339  if( rValue >>= aLayerName )
2340  {
2341  const SdrLayer* pLayer = GetSdrObject()->getSdrModelFromSdrObject().GetLayerAdmin().GetLayer(aLayerName);
2342  if( pLayer != nullptr )
2343  {
2344  GetSdrObject()->SetLayer( pLayer->GetID() );
2345  return true;
2346  }
2347  }
2348  break;
2349  }
2350  case SDRATTR_ROTATEANGLE:
2351  {
2352  sal_Int32 nAngle = 0;
2353  if( rValue >>= nAngle )
2354  {
2355  Point aRef1(GetSdrObject()->GetSnapRect().Center());
2356  nAngle -= GetSdrObject()->GetRotateAngle();
2357  if (nAngle!=0)
2358  {
2359  double nSin = sin(nAngle * F_PI18000);
2360  double nCos = cos(nAngle * F_PI18000);
2361  GetSdrObject()->Rotate(aRef1,nAngle,nSin,nCos);
2362  }
2363  return true;
2364  }
2365 
2366  break;
2367  }
2368 
2369  case SDRATTR_SHEARANGLE:
2370  {
2371  sal_Int32 nShear = 0;
2372  if( rValue >>= nShear )
2373  {
2374  nShear -= GetSdrObject()->GetShearAngle();
2375  if(nShear != 0 )
2376  {
2377  Point aRef1(GetSdrObject()->GetSnapRect().Center());
2378  double nTan = tan(nShear * F_PI18000);
2379  GetSdrObject()->Shear(aRef1,nShear,nTan,false);
2380  return true;
2381  }
2382  }
2383 
2384  break;
2385  }
2386 
2388  {
2389  GetSdrObject()->SetGrabBagItem(rValue);
2390  return true;
2391  }
2392 
2394  {
2395  bool bMoveProtect;
2396  if( rValue >>= bMoveProtect )
2397  {
2398  GetSdrObject()->SetMoveProtect(bMoveProtect);
2399  return true;
2400  }
2401  break;
2402  }
2403  case SDRATTR_OBJECTNAME:
2404  {
2405  OUString aName;
2406  if( rValue >>= aName )
2407  {
2408  GetSdrObject()->SetName( aName );
2409  return true;
2410  }
2411  break;
2412  }
2413 
2415  {
2416  sal_Int16 nMaxScale = 0;
2417  if (rValue >>= nMaxScale)
2418  {
2420  aItem.SetMaxScale(nMaxScale);
2421  GetSdrObject()->SetMergedItem(aItem);
2422  return true;
2423  }
2424  break;
2425  }
2426 
2427  // #i68101#
2429  {
2430  OUString aTitle;
2431  if( rValue >>= aTitle )
2432  {
2433  GetSdrObject()->SetTitle( aTitle );
2434  return true;
2435  }
2436  break;
2437  }
2439  {
2440  OUString aDescription;
2441  if( rValue >>= aDescription )
2442  {
2443  GetSdrObject()->SetDescription( aDescription );
2444  return true;
2445  }
2446  break;
2447  }
2448 
2449  case SDRATTR_OBJPRINTABLE:
2450  {
2451  bool bPrintable;
2452  if( rValue >>= bPrintable )
2453  {
2454  GetSdrObject()->SetPrintable(bPrintable);
2455  return true;
2456  }
2457  break;
2458  }
2459  case SDRATTR_OBJVISIBLE:
2460  {
2461  bool bVisible;
2462  if( rValue >>= bVisible )
2463  {
2464  GetSdrObject()->SetVisible(bVisible);
2465  return true;
2466  }
2467  break;
2468  }
2470  {
2471  bool bResizeProtect;
2472  if( rValue >>= bResizeProtect )
2473  {
2474  GetSdrObject()->SetResizeProtect(bResizeProtect);
2475  return true;
2476  }
2477  break;
2478  }
2479  case OWN_ATTR_PAGE_NUMBER:
2480  {
2481  sal_Int32 nPageNum = 0;
2482  if( (rValue >>= nPageNum) && ( nPageNum >= 0 ) && ( nPageNum <= 0xffff ) )
2483  {
2484  SdrPageObj* pPageObj = dynamic_cast< SdrPageObj* >(GetSdrObject());
2485  if( pPageObj )
2486  {
2487  SdrModel& rModel(pPageObj->getSdrModelFromSdrObject());
2488  SdrPage* pNewPage = nullptr;
2489  const sal_uInt16 nDestinationPageNum(static_cast<sal_uInt16>((nPageNum << 1) - 1));
2490 
2491  if(nDestinationPageNum < rModel.GetPageCount())
2492  {
2493  pNewPage = rModel.GetPage(nDestinationPageNum);
2494  }
2495 
2496  pPageObj->SetReferencedPage(pNewPage);
2497  }
2498 
2499  return true;
2500  }
2501  break;
2502  }
2503  case XATTR_FILLBITMAP:
2504  case XATTR_FILLGRADIENT:
2505  case XATTR_FILLHATCH:
2507  case XATTR_LINEEND:
2508  case XATTR_LINESTART:
2509  case XATTR_LINEDASH:
2510  {
2511  if( pProperty->nMemberId == MID_NAME )
2512  {
2513  OUString aApiName;
2514  if( rValue >>= aApiName )
2515  {
2516  if( SetFillAttribute( pProperty->nWID, aApiName ) )
2517  return true;
2518  }
2519  break;
2520  }
2521  else
2522  {
2523  return false;
2524  }
2525  }
2526  default:
2527  {
2528  return false;
2529  }
2530  }
2531 
2532  OUString sExceptionMessage ("IllegalArgumentException in SvxShape::setPropertyValueImpl."
2533  " Property Type: " + pProperty->aType.getTypeName() + " Property nWID: " + OUString::number(pProperty->nWID)
2534  + " Value Type: " + (rValue.hasValue() ? rValue.getValueTypeName() : "void (no value)"));
2535 
2536  throw lang::IllegalArgumentException(sExceptionMessage, nullptr, 1);
2537 }
2538 
2539 
2540 bool SvxShape::getPropertyValueImpl( const OUString&, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue )
2541 {
2542  switch( pProperty->nWID )
2543  {
2545  {
2546  Point aVclPoint = static_cast<SdrCaptionObj*>(GetSdrObject())->GetTailPos();
2547 
2548  // #88491# make pos relative to anchor
2550  {
2551  aVclPoint -= GetSdrObject()->GetAnchorPos();
2552  }
2553 
2554  // #90763# pos is absolute, make it relative to top left
2555  basegfx::B2DPolyPolygon aNewPolyPolygon;
2556  basegfx::B2DHomMatrix aNewHomogenMatrix;
2557  GetSdrObject()->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
2558 
2559  aVclPoint.AdjustX( -(basegfx::fround(aNewHomogenMatrix.get(0, 2))) );
2560  aVclPoint.AdjustY( -(basegfx::fround(aNewHomogenMatrix.get(1, 2))) );
2561 
2562  // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
2563  // Need to adapt aVclPoint from app-specific to 100thmm
2564  ForceMetricTo100th_mm(aVclPoint);
2565 
2566  awt::Point aPnt( aVclPoint.X(), aVclPoint.Y() );
2567  rValue <<= aPnt;
2568  break;
2569  }
2570 
2572  {
2573  basegfx::B2DPolyPolygon aNewPolyPolygon;
2574  basegfx::B2DHomMatrix aNewHomogenMatrix;
2575  GetSdrObject()->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
2576  drawing::HomogenMatrix3 aMatrix;
2577 
2578  // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
2579  // Need to adapt aNewHomogenMatrix from app-specific to 100thmm
2580  ForceMetricTo100th_mm(aNewHomogenMatrix);
2581 
2582  aMatrix.Line1.Column1 = aNewHomogenMatrix.get(0, 0);
2583  aMatrix.Line1.Column2 = aNewHomogenMatrix.get(0, 1);
2584  aMatrix.Line1.Column3 = aNewHomogenMatrix.get(0, 2);
2585  aMatrix.Line2.Column1 = aNewHomogenMatrix.get(1, 0);
2586  aMatrix.Line2.Column2 = aNewHomogenMatrix.get(1, 1);
2587  aMatrix.Line2.Column3 = aNewHomogenMatrix.get(1, 2);
2588  aMatrix.Line3.Column1 = aNewHomogenMatrix.get(2, 0);
2589  aMatrix.Line3.Column2 = aNewHomogenMatrix.get(2, 1);
2590  aMatrix.Line3.Column3 = aNewHomogenMatrix.get(2, 2);
2591 
2592  rValue <<= aMatrix;
2593 
2594  break;
2595  }
2596 
2597  case OWN_ATTR_ZORDER:
2598  {
2599  rValue <<= static_cast<sal_Int32>(GetSdrObject()->GetOrdNum());
2600  break;
2601  }
2602 
2603  case OWN_ATTR_BITMAP:
2604  {
2605  rValue = GetBitmap();
2606  if(!rValue.hasValue())
2607  throw uno::RuntimeException();
2608 
2609  break;
2610  }
2611 
2612  case OWN_ATTR_ISFONTWORK:
2613  {
2614  rValue <<= dynamic_cast<const SdrTextObj*>(GetSdrObject()) != nullptr && static_cast<SdrTextObj*>(GetSdrObject())->IsFontwork();
2615  break;
2616  }
2617 
2618  case OWN_ATTR_FRAMERECT:
2619  {
2620  tools::Rectangle aRect( GetSdrObject()->GetSnapRect() );
2621  Point aTopLeft( aRect.TopLeft() );
2622  Size aObjSize( aRect.GetWidth(), aRect.GetHeight() );
2623  ForceMetricTo100th_mm(aTopLeft);
2624  ForceMetricTo100th_mm(aObjSize);
2625  css::awt::Rectangle aUnoRect(
2626  aTopLeft.X(), aTopLeft.Y(),
2627  aObjSize.getWidth(), aObjSize.getHeight() );
2628  rValue <<= aUnoRect;
2629  break;
2630  }
2631 
2632  case OWN_ATTR_BOUNDRECT:
2633  {
2634  tools::Rectangle aRect( GetSdrObject()->GetCurrentBoundRect() );
2635  Point aTopLeft( aRect.TopLeft() );
2636  Size aObjSize( aRect.GetWidth(), aRect.GetHeight() );
2637  ForceMetricTo100th_mm(aTopLeft);
2638  ForceMetricTo100th_mm(aObjSize);
2639  css::awt::Rectangle aUnoRect(
2640  aTopLeft.X(), aTopLeft.Y(),
2641  aObjSize.getWidth(), aObjSize.getHeight() );
2642  rValue <<= aUnoRect;
2643  break;
2644  }
2645 
2646  case OWN_ATTR_LDNAME:
2647  {
2648  OUString aName( GetSdrObject()->GetName() );
2649  rValue <<= aName;
2650  break;
2651  }
2652 
2653  case OWN_ATTR_LDBITMAP:
2654  {
2655  OUString sId;
2656  if( GetSdrObject()->GetObjInventor() == SdrInventor::Default && GetSdrObject()->GetObjIdentifier() == OBJ_OLE2 )
2657  {
2658  sId = RID_UNODRAW_OLE2;
2659  }
2660  else if( GetSdrObject()->GetObjInventor() == SdrInventor::Default && GetSdrObject()->GetObjIdentifier() == OBJ_GRAF )
2661  {
2662  sId = RID_UNODRAW_GRAPHICS;
2663  }
2664  else
2665  {
2666  sId = RID_UNODRAW_OBJECTS;
2667  }
2668 
2669  BitmapEx aBmp(sId);
2670  Reference<awt::XBitmap> xBmp(VCLUnoHelper::CreateBitmap(aBmp));
2671 
2672  rValue <<= xBmp;
2673  break;
2674  }
2675 
2676  case OWN_ATTR_MIRRORED:
2677  {
2678  bool bMirror = false;
2679  if( HasSdrObject() && dynamic_cast<const SdrGrafObj*>(GetSdrObject()) != nullptr )
2680  bMirror = static_cast<SdrGrafObj*>(GetSdrObject())->IsMirrored();
2681 
2682  rValue <<= bMirror;
2683  break;
2684  }
2685 
2688  case OWN_ATTR_EDGE_END_POS:
2689  case OWN_ATTR_EDGE_END_OBJ:
2690  case OWN_ATTR_GLUEID_HEAD:
2691  case OWN_ATTR_GLUEID_TAIL:
2693  {
2694  SdrEdgeObj* pEdgeObj = dynamic_cast<SdrEdgeObj*>(GetSdrObject());
2695  if(pEdgeObj)
2696  {
2697  switch(pProperty->nWID)
2698  {
2700  case OWN_ATTR_EDGE_END_OBJ:
2701  {
2702  SdrObject* pNode = pEdgeObj->GetConnectedNode(pProperty->nWID == OWN_ATTR_EDGE_START_OBJ);
2703  if(pNode)
2704  {
2705  Reference< drawing::XShape > xShape( GetXShapeForSdrObject( pNode ) );
2706  if(xShape.is())
2707  rValue <<= xShape;
2708 
2709  }
2710  break;
2711  }
2712 
2714  case OWN_ATTR_EDGE_END_POS:
2715  {
2716  Point aPoint( pEdgeObj->GetTailPoint( pProperty->nWID == OWN_ATTR_EDGE_START_POS ) );
2718  aPoint -= GetSdrObject()->GetAnchorPos();
2719 
2720  ForceMetricTo100th_mm( aPoint );
2721  awt::Point aUnoPoint( aPoint.X(), aPoint.Y() );
2722 
2723  rValue <<= aUnoPoint;
2724  break;
2725  }
2726  case OWN_ATTR_GLUEID_HEAD:
2727  case OWN_ATTR_GLUEID_TAIL:
2728  {
2729  rValue <<= pEdgeObj->getGluePointIndex( pProperty->nWID == OWN_ATTR_GLUEID_HEAD );
2730  break;
2731  }
2733  {
2734  basegfx::B2DPolyPolygon aPolyPoly( pEdgeObj->GetEdgeTrackPath() );
2736  {
2737  Point aPoint( GetSdrObject()->GetAnchorPos() );
2738  aPolyPoly.transform(basegfx::utils::createTranslateB2DHomMatrix(-aPoint.X(), -aPoint.Y()));
2739  }
2740  // Reintroduction of fix for issue #i59051# (#i108851#)
2741  ForceMetricTo100th_mm( aPolyPoly );
2742  drawing::PolyPolygonBezierCoords aRetval;
2744  rValue <<= aRetval;
2745  break;
2746  }
2747  }
2748  }
2749  break;
2750  }
2751 
2754  {
2755  SdrMeasureObj* pMeasureObj = dynamic_cast<SdrMeasureObj*>(GetSdrObject());
2756  if(pMeasureObj)
2757  {
2758  Point aPoint( pMeasureObj->GetPoint( pProperty->nWID == OWN_ATTR_MEASURE_START_POS ? 0 : 1 ) );
2760  aPoint -= GetSdrObject()->GetAnchorPos();
2761 
2762  // Reintroduction of fix for issue #i59051# (#i108851#)
2763  ForceMetricTo100th_mm( aPoint );
2764  awt::Point aUnoPoint( aPoint.X(), aPoint.Y() );
2765 
2766  rValue <<= aUnoPoint;
2767  break;
2768  }
2769  break;
2770  }
2771 
2772  case OWN_ATTR_FILLBMP_MODE:
2773  {
2774  const SfxItemSet& rObjItemSet = GetSdrObject()->GetMergedItemSet();
2775 
2776  if (rObjItemSet.Get(XATTR_FILLBMP_TILE).GetValue())
2777  {
2778  rValue <<= drawing::BitmapMode_REPEAT;
2779  }
2780  else if (rObjItemSet.Get(XATTR_FILLBMP_STRETCH).GetValue())
2781  {
2782  rValue <<= drawing::BitmapMode_STRETCH;
2783  }
2784  else
2785  {
2786  rValue <<= drawing::BitmapMode_NO_REPEAT;
2787  }
2788  break;
2789  }
2790  case SDRATTR_LAYERID:
2791  rValue <<= sal_uInt16(sal_uInt8(GetSdrObject()->GetLayer()));
2792  break;
2793 
2794  case SDRATTR_LAYERNAME:
2795  {
2797  if( pLayer )
2798  {
2799  rValue <<= pLayer->GetName();
2800  }
2801  break;
2802  }
2803 
2804  case SDRATTR_ROTATEANGLE:
2805  rValue <<= static_cast<sal_Int32>(GetSdrObject()->GetRotateAngle());
2806  break;
2807 
2808  case SDRATTR_SHEARANGLE:
2809  rValue <<= static_cast<sal_Int32>(GetSdrObject()->GetShearAngle());
2810  break;
2811 
2813  {
2814  GetSdrObject()->GetGrabBagItem(rValue);
2815  break;
2816  }
2817 
2819  rValue <<= GetSdrObject()->IsMoveProtect();
2820  break;
2821 
2822  case SDRATTR_OBJECTNAME:
2823  {
2824  OUString aName( GetSdrObject()->GetName() );
2825  rValue <<= aName;
2826  break;
2827  }
2828 
2829  // #i68101#
2831  {
2832  OUString aTitle( GetSdrObject()->GetTitle() );
2833  rValue <<= aTitle;
2834  break;
2835  }
2836 
2838  {
2839  OUString aDescription( GetSdrObject()->GetDescription() );
2840  rValue <<= aDescription;
2841  break;
2842  }
2843 
2844  case SDRATTR_OBJPRINTABLE:
2845  rValue <<= GetSdrObject()->IsPrintable();
2846  break;
2847 
2848  case SDRATTR_OBJVISIBLE:
2849  rValue <<= GetSdrObject()->IsVisible();
2850  break;
2851 
2853  rValue <<= GetSdrObject()->IsResizeProtect();
2854  break;
2855 
2856  case OWN_ATTR_PAGE_NUMBER:
2857  {
2858  SdrPageObj* pPageObj = dynamic_cast<SdrPageObj*>(GetSdrObject());
2859  if(pPageObj)
2860  {
2861  SdrPage* pPage = pPageObj->GetReferencedPage();
2862  sal_Int32 nPageNumber = pPage ? pPage->GetPageNum() : 0;
2863  nPageNumber++;
2864  nPageNumber >>= 1;
2865  rValue <<= nPageNumber;
2866  }
2867  break;
2868  }
2869 
2871  {
2872  rValue <<= GetSdrObject()->TakeObjNameSingul();
2873  break;
2874  }
2875 
2877  {
2878  rValue <<= GetTextFitToSizeScale(GetSdrObject());
2879  break;
2880  }
2881 
2883  {
2884  rValue <<= GetSdrObject()->TakeObjNamePlural();
2885  break;
2886  }
2887  case OWN_ATTR_METAFILE:
2888  {
2889  SdrOle2Obj* pObj = dynamic_cast<SdrOle2Obj*>(GetSdrObject());
2890  if( pObj )
2891  {
2892  const Graphic* pGraphic = pObj->GetGraphic();
2893  if( pGraphic )
2894  {
2895  bool bIsWMF = false;
2896  if ( pGraphic->IsGfxLink() )
2897  {
2898  GfxLink aLnk = pGraphic->GetGfxLink();
2899  if ( aLnk.GetType() == GfxLinkType::NativeWmf )
2900  {
2901  bIsWMF = true;
2902  uno::Sequence<sal_Int8> aSeq(reinterpret_cast<sal_Int8 const *>(aLnk.GetData()), static_cast<sal_Int32>(aLnk.GetDataSize()));
2903  rValue <<= aSeq;
2904  }
2905  }
2906  if ( !bIsWMF )
2907  {
2908  // #119735# just use GetGDIMetaFile, it will create a buffered version of contained bitmap now automatically
2909  GDIMetaFile aMtf(pObj->GetGraphic()->GetGDIMetaFile());
2910  SvMemoryStream aDestStrm( 65535, 65535 );
2911  ConvertGDIMetaFileToWMF( aMtf, aDestStrm, nullptr, false );
2912  const uno::Sequence<sal_Int8> aSeq(
2913  static_cast< const sal_Int8* >(aDestStrm.GetData()),
2914  aDestStrm.GetEndOfData());
2915  rValue <<= aSeq;
2916  }
2917  }
2918  }
2919  else
2920  {
2921  rValue = GetBitmap( true );
2922  }
2923  break;
2924  }
2925 
2926 
2927  default:
2928  return false;
2929  }
2930  return true;
2931 }
2932 
2933 
2934 bool SvxShape::getPropertyStateImpl( const SfxItemPropertySimpleEntry* pProperty, css::beans::PropertyState& rState )
2935 {
2936  if( pProperty->nWID == OWN_ATTR_FILLBMP_MODE )
2937  {
2938  const SfxItemSet& rSet = GetSdrObject()->GetMergedItemSet();
2939 
2940  if( rSet.GetItemState( XATTR_FILLBMP_STRETCH, false ) == SfxItemState::SET ||
2941  rSet.GetItemState( XATTR_FILLBMP_TILE, false ) == SfxItemState::SET )
2942  {
2943  rState = beans::PropertyState_DIRECT_VALUE;
2944  }
2945  else
2946  {
2947  rState = beans::PropertyState_AMBIGUOUS_VALUE;
2948  }
2949  }
2950  else if((( pProperty->nWID >= OWN_ATTR_VALUE_START && pProperty->nWID <= OWN_ATTR_VALUE_END ) ||
2951  ( pProperty->nWID >= SDRATTR_NOTPERSIST_FIRST && pProperty->nWID <= SDRATTR_NOTPERSIST_LAST )) && ( pProperty->nWID != SDRATTR_TEXTDIRECTION ) )
2952  {
2953  rState = beans::PropertyState_DIRECT_VALUE;
2954  }
2955  else
2956  {
2957  return false;
2958  }
2959 
2960  return true;
2961 }
2962 
2963 
2965 {
2966  if( pProperty->nWID == OWN_ATTR_FILLBMP_MODE )
2967  {
2970  return true;
2971  }
2972  else if((pProperty->nWID >= OWN_ATTR_VALUE_START && pProperty->nWID <= OWN_ATTR_VALUE_END ) ||
2973  ( pProperty->nWID >= SDRATTR_NOTPERSIST_FIRST && pProperty->nWID <= SDRATTR_NOTPERSIST_LAST ))
2974  {
2975  return true;
2976  }
2977  else
2978  {
2979  return false;
2980  }
2981 }
2982 
2983 
2984 uno::Sequence< beans::PropertyState > SAL_CALL SvxShape::getPropertyStates( const uno::Sequence< OUString >& aPropertyName )
2985 {
2986  const sal_Int32 nCount = aPropertyName.getLength();
2987  uno::Sequence< beans::PropertyState > aRet( nCount );
2988 
2989  std::transform(aPropertyName.begin(), aPropertyName.end(), aRet.begin(),
2990  [this](const OUString& rName) -> beans::PropertyState { return getPropertyState(rName); });
2991 
2992  return aRet;
2993 }
2994 
2995 
2996 void SAL_CALL SvxShape::setPropertyToDefault( const OUString& PropertyName )
2997 {
2998  if( mpImpl->mpMaster )
2999  {
3000  mpImpl->mpMaster->setPropertyToDefault( PropertyName );
3001  }
3002  else
3003  {
3004  _setPropertyToDefault( PropertyName );
3005  }
3006 }
3007 
3008 void SvxShape::_setPropertyToDefault( const OUString& PropertyName )
3009 {
3010  ::SolarMutexGuard aGuard;
3011 
3012  const SfxItemPropertySimpleEntry* pProperty = mpPropSet->getPropertyMapEntry(PropertyName);
3013 
3014  if( !HasSdrObject() || pProperty == nullptr )
3015  throw beans::UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this));
3016 
3017  if( !setPropertyToDefaultImpl( pProperty ) )
3018  {
3019  GetSdrObject()->ClearMergedItem( pProperty->nWID );
3020  }
3021 
3023 }
3024 
3025 
3026 uno::Any SAL_CALL SvxShape::getPropertyDefault( const OUString& aPropertyName )
3027 {
3028  if( mpImpl->mpMaster )
3029  {
3030  return mpImpl->mpMaster->getPropertyDefault( aPropertyName );
3031  }
3032  else
3033  {
3034  return _getPropertyDefault( aPropertyName );
3035  }
3036 }
3037 
3038 uno::Any SvxShape::_getPropertyDefault( const OUString& aPropertyName )
3039 {
3040  ::SolarMutexGuard aGuard;
3041 
3042  const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(aPropertyName);
3043 
3044  if( !HasSdrObject() || pMap == nullptr )
3045  throw beans::UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(this));
3046 
3047  if(( pMap->nWID >= OWN_ATTR_VALUE_START && pMap->nWID <= OWN_ATTR_VALUE_END ) ||
3048  ( pMap->nWID >= SDRATTR_NOTPERSIST_FIRST && pMap->nWID <= SDRATTR_NOTPERSIST_LAST ))
3049  {
3050  return getPropertyValue( aPropertyName );
3051  }
3052 
3053  // get default from ItemPool
3054  if(!SfxItemPool::IsWhich(pMap->nWID))
3055  throw beans::UnknownPropertyException( "No WhichID " + OUString::number(pMap->nWID) + " for " + aPropertyName, static_cast<cppu::OWeakObject*>(this));
3056 
3057  SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), {{pMap->nWID, pMap->nWID}});
3058  aSet.Put(GetSdrObject()->getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
3059 
3060  return GetAnyForItem( aSet, pMap );
3061 }
3062 
3063 // XMultiPropertyStates
3065 {
3066  ::SolarMutexGuard aGuard;
3067 
3068  if( !HasSdrObject() )
3069  throw lang::DisposedException();
3070  GetSdrObject()->ClearMergedItem(); // nWhich == 0 => all
3071 
3072  if(dynamic_cast<const SdrGrafObj*>(GetSdrObject()) != nullptr)
3073  {
3074  // defaults for graphic objects have changed:
3075  GetSdrObject()->SetMergedItem( XFillStyleItem( drawing::FillStyle_NONE ) );
3076  GetSdrObject()->SetMergedItem( XLineStyleItem( drawing::LineStyle_NONE ) );
3077  }
3078 
3079  // #i68523# special handling for Svx3DCharacterModeItem, this is not saved
3080  // but needs to be sal_True in svx, pool default (false) in sch. Since sch
3081  // does not load lathe or extrude objects, it is possible to set the items
3082  // here.
3083  // For other solution possibilities, see task description.
3084  if( dynamic_cast<const E3dLatheObj* >(GetSdrObject()) != nullptr|| dynamic_cast<const E3dExtrudeObj* >(GetSdrObject()) != nullptr)
3085  {
3087  }
3088 
3090 }
3091 
3093  const uno::Sequence<OUString>& aPropertyNames )
3094 {
3095  for ( const auto& rPropertyName : aPropertyNames )
3096  setPropertyToDefault( rPropertyName );
3097 }
3098 
3099 uno::Sequence<uno::Any> SvxShape::getPropertyDefaults(
3100  const uno::Sequence<OUString>& aPropertyNames )
3101 {
3102  ::std::vector<uno::Any> ret;
3103  ret.reserve(aPropertyNames.getLength());
3104  std::transform(aPropertyNames.begin(), aPropertyNames.end(), std::back_inserter(ret),
3105  [this](const OUString& rName) -> uno::Any { return getPropertyDefault(rName); });
3106  return uno::Sequence<uno::Any>( ret.data(), ret.size() );
3107 }
3108 
3109 
3110 // XServiceInfo
3111 
3113 {
3114  return "SvxShape";
3115 }
3116 
3117 const char sUNO_service_style_ParagraphProperties[] = "com.sun.star.style.ParagraphProperties";
3118 const char sUNO_service_style_ParagraphPropertiesComplex[] = "com.sun.star.style.ParagraphPropertiesComplex";
3119 const char sUNO_service_style_ParagraphPropertiesAsian[] = "com.sun.star.style.ParagraphPropertiesAsian";
3120 const char sUNO_service_style_CharacterProperties[] = "com.sun.star.style.CharacterProperties";
3121 const char sUNO_service_style_CharacterPropertiesComplex[] = "com.sun.star.style.CharacterPropertiesComplex";
3122 const char sUNO_service_style_CharacterPropertiesAsian[] = "com.sun.star.style.CharacterPropertiesAsian";
3123 
3124 const char sUNO_service_drawing_FillProperties[] = "com.sun.star.drawing.FillProperties";
3125 const char sUNO_service_drawing_TextProperties[] = "com.sun.star.drawing.TextProperties";
3126 const char sUNO_service_drawing_LineProperties[] = "com.sun.star.drawing.LineProperties";
3127 const char sUNO_service_drawing_ConnectorProperties[] = "com.sun.star.drawing.ConnectorProperties";
3128 const char sUNO_service_drawing_MeasureProperties[] = "com.sun.star.drawing.MeasureProperties";
3129 const char sUNO_service_drawing_ShadowProperties[] = "com.sun.star.drawing.ShadowProperties";
3130 
3131 const char sUNO_service_drawing_RotationDescriptor[] = "com.sun.star.drawing.RotationDescriptor";
3132 
3133 const char sUNO_service_drawing_Text[] = "com.sun.star.drawing.Text";
3134 const char sUNO_service_drawing_GroupShape[] = "com.sun.star.drawing.GroupShape";
3135 
3136 const char sUNO_service_drawing_CustomShapeProperties[] = "com.sun.star.drawing.CustomShapeProperties";
3137 const char sUNO_service_drawing_CustomShape[] = "com.sun.star.drawing.CustomShape";
3138 
3139 const char sUNO_service_drawing_PolyPolygonDescriptor[] = "com.sun.star.drawing.PolyPolygonDescriptor";
3140 const char sUNO_service_drawing_PolyPolygonBezierDescriptor[]= "com.sun.star.drawing.PolyPolygonBezierDescriptor";
3141 
3142 const char sUNO_service_drawing_LineShape[] = "com.sun.star.drawing.LineShape";
3143 const char sUNO_service_drawing_Shape[] = "com.sun.star.drawing.Shape";
3144 const char sUNO_service_drawing_RectangleShape[] = "com.sun.star.drawing.RectangleShape";
3145 const char sUNO_service_drawing_EllipseShape[] = "com.sun.star.drawing.EllipseShape";
3146 const char sUNO_service_drawing_PolyPolygonShape[] = "com.sun.star.drawing.PolyPolygonShape";
3147 const char sUNO_service_drawing_PolyLineShape[] = "com.sun.star.drawing.PolyLineShape";
3148 const char sUNO_service_drawing_OpenBezierShape[] = "com.sun.star.drawing.OpenBezierShape";
3149 const char sUNO_service_drawing_ClosedBezierShape[] = "com.sun.star.drawing.ClosedBezierShape";
3150 const char sUNO_service_drawing_TextShape[] = "com.sun.star.drawing.TextShape";
3151 const char sUNO_service_drawing_GraphicObjectShape[] = "com.sun.star.drawing.GraphicObjectShape";
3152 const char sUNO_service_drawing_OLE2Shape[] = "com.sun.star.drawing.OLE2Shape";
3153 const char sUNO_service_drawing_PageShape[] = "com.sun.star.drawing.PageShape";
3154 const char sUNO_service_drawing_CaptionShape[] = "com.sun.star.drawing.CaptionShape";
3155 const char sUNO_service_drawing_MeasureShape[] = "com.sun.star.drawing.MeasureShape";
3156 const char sUNO_service_drawing_FrameShape[] = "com.sun.star.drawing.FrameShape";
3157 const char sUNO_service_drawing_ControlShape[] = "com.sun.star.drawing.ControlShape";
3158 const char sUNO_service_drawing_ConnectorShape[] = "com.sun.star.drawing.ConnectorShape";
3159 const char sUNO_service_drawing_MediaShape[] = "com.sun.star.drawing.MediaShape";
3160 
3161 
3162 uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
3163 {
3164  if( mpImpl->mpMaster )
3165  {
3166  return mpImpl->mpMaster->getSupportedServiceNames();
3167  }
3168  else
3169  {
3170  return _getSupportedServiceNames();
3171  }
3172 }
3173 
3174 uno::Sequence< OUString > SvxShape::_getSupportedServiceNames()
3175 {
3176  ::SolarMutexGuard aGuard;
3177 
3178  if( HasSdrObject() && GetSdrObject()->GetObjInventor() == SdrInventor::Default)
3179  {
3180  const sal_uInt16 nIdent = GetSdrObject()->GetObjIdentifier();
3181 
3182  switch(nIdent)
3183  {
3184  case OBJ_GRUP:
3185  {
3186  static const uno::Sequence<OUString> aSvxShape_GroupServices
3188  sUNO_service_drawing_Shape };
3189  return aSvxShape_GroupServices;
3190  }
3191  case OBJ_CUSTOMSHAPE:
3192  {
3193  static const uno::Sequence<OUString> aSvxShape_CustomShapeServices
3208  sUNO_service_drawing_RotationDescriptor };
3209  return aSvxShape_CustomShapeServices;
3210  }
3211  case OBJ_LINE:
3212  {
3213  static const uno::Sequence<OUString> aSvxShape_LineServices
3215 
3218 
3227 
3230  sUNO_service_drawing_RotationDescriptor };
3231  return aSvxShape_LineServices;
3232  }
3233 
3234  case OBJ_RECT:
3235  {
3236  static const uno::Sequence<OUString> aSvxShape_RectServices
3238 
3250 
3252  sUNO_service_drawing_RotationDescriptor };
3253  return aSvxShape_RectServices;
3254  }
3255 
3256  case OBJ_CIRC:
3257  case OBJ_SECT:
3258  case OBJ_CARC:
3259  case OBJ_CCUT:
3260  {
3261  static const uno::Sequence<OUString> aSvxShape_CircServices
3263 
3267 
3276 
3278  sUNO_service_drawing_RotationDescriptor };
3279  return aSvxShape_CircServices;
3280  }
3281 
3282  case OBJ_PATHPLIN:
3283  case OBJ_PLIN:
3284  {
3285  static const uno::Sequence<OUString> aSvxShape_PathServices
3287 
3290 
3292 
3301 
3303  sUNO_service_drawing_RotationDescriptor };
3304  return aSvxShape_PathServices;
3305  }
3306 
3307  case OBJ_PATHPOLY:
3308  case OBJ_POLY:
3309  {
3310  static const uno::Sequence<OUString> aSvxShape_PolyServices
3312 
3316 
3318 
3327 
3329  sUNO_service_drawing_RotationDescriptor };
3330  return aSvxShape_PolyServices;
3331  }
3332 
3333  case OBJ_FREELINE:
3334  case OBJ_PATHLINE:
3335  {
3336  static const uno::Sequence<OUString> aSvxShape_FreeLineServices
3338 
3342 
3344 
3353 
3355  sUNO_service_drawing_RotationDescriptor };
3356  return aSvxShape_FreeLineServices;
3357  }
3358 
3359  case OBJ_FREEFILL:
3360  case OBJ_PATHFILL:
3361  {
3362  static const uno::Sequence<OUString> aSvxShape_FreeFillServices
3364 
3368 
3370 
3379 
3381  sUNO_service_drawing_RotationDescriptor };
3382  return aSvxShape_FreeFillServices;
3383  }
3384 
3385  case OBJ_OUTLINETEXT:
3386  case OBJ_TITLETEXT:
3387  case OBJ_TEXT:
3388  {
3389  static const uno::Sequence<OUString> aSvxShape_TextServices
3391 
3395 
3404 
3406  sUNO_service_drawing_RotationDescriptor };
3407  return aSvxShape_TextServices;
3408  }
3409 
3410  case OBJ_GRAF:
3411  {
3412  static const uno::Sequence<OUString> aSvxShape_GrafServices
3414 
3416 
3425 
3427  sUNO_service_drawing_RotationDescriptor};
3428  return aSvxShape_GrafServices;
3429  }
3430 
3431  case OBJ_OLE2:
3432  {
3433  static const uno::Sequence<OUString> aSvxShape_Ole2Services
3436 
3437  // #i118485# Added Text, Shadow and Rotation
3446 
3448  sUNO_service_drawing_RotationDescriptor };
3449  return aSvxShape_Ole2Services;
3450  }
3451 
3452  case OBJ_CAPTION:
3453  {
3454  static const uno::Sequence<OUString> aSvxShape_CaptionServices
3456 
3460 
3469 
3471  sUNO_service_drawing_RotationDescriptor };
3472  return aSvxShape_CaptionServices;
3473  }
3474 
3475  case OBJ_PAGE:
3476  {
3477  static const uno::Sequence<OUString> aSvxShape_PageServices
3479  sUNO_service_drawing_Shape };
3480  return aSvxShape_PageServices;
3481  }
3482 
3483  case OBJ_MEASURE:
3484  {
3485  static const uno::Sequence<OUString> aSvxShape_MeasureServices
3487 
3489 
3492 
3501 
3504  sUNO_service_drawing_RotationDescriptor };
3505  return aSvxShape_MeasureServices;
3506  }
3507 
3508  case OBJ_FRAME:
3509  {
3510  static const uno::Sequence<OUString> aSvxShape_FrameServices
3512  sUNO_service_drawing_Shape };
3513  return aSvxShape_FrameServices;
3514  }
3515 
3516  case OBJ_UNO:
3517  {
3518  static const uno::Sequence<OUString> aSvxShape_UnoServices
3520  sUNO_service_drawing_Shape };
3521  return aSvxShape_UnoServices;
3522  }
3523 
3524  case OBJ_EDGE:
3525  {
3526  static const uno::Sequence<OUString> aSvxShape_EdgeServices
3529 
3532 
3541 
3544  sUNO_service_drawing_RotationDescriptor };
3545  return aSvxShape_EdgeServices;
3546  }
3547  case OBJ_MEDIA:
3548  {
3549  static const uno::Sequence<OUString> aSvxShape_MediaServices
3551  sUNO_service_drawing_Shape };
3552  return aSvxShape_MediaServices;
3553  }
3554  }
3555  }
3556  else if( HasSdrObject() && GetSdrObject()->GetObjInventor() == SdrInventor::FmForm)
3557  {
3558 #if OSL_DEBUG_LEVEL > 0
3559  const sal_uInt16 nIdent = GetSdrObject()->GetObjIdentifier();
3560  OSL_ENSURE( nIdent == OBJ_UNO, "SvxShape::_getSupportedServiceNames: SdrInventor::FmForm, but no UNO object?" );
3561 #endif
3562  static const uno::Sequence<OUString> aSvxShape_UnoServices
3564  sUNO_service_drawing_Shape };
3565  return aSvxShape_UnoServices;
3566  }
3567  OSL_FAIL( "SvxShape::_getSupportedServiceNames: could not determine object type!" );
3568  uno::Sequence< OUString > aSeq;
3569  return aSeq;
3570 }
3571 
3572 sal_Bool SAL_CALL SvxShape::supportsService( const OUString& ServiceName )
3573 {
3574  return cppu::supportsService(this, ServiceName);
3575 }
3576 
3577 // XGluePointsSupplier
3578 uno::Reference< container::XIndexContainer > SAL_CALL SvxShape::getGluePoints()
3579 {
3580  ::SolarMutexGuard aGuard;
3581  uno::Reference< container::XIndexContainer > xGluePoints( mxGluePoints );
3582 
3583  if( HasSdrObject() && !xGluePoints.is() )
3584  {
3585  uno::Reference< container::XIndexContainer > xNew( SvxUnoGluePointAccess_createInstance( GetSdrObject() ), uno::UNO_QUERY );
3586  mxGluePoints = xGluePoints = xNew;
3587  }
3588 
3589  return xGluePoints;
3590 }
3591 
3592 // XChild
3593 uno::Reference<uno::XInterface> SAL_CALL SvxShape::getParent()
3594 {
3595  ::SolarMutexGuard aGuard;
3596  const SdrObject* pSdrObject(GetSdrObject());
3597 
3598  if(nullptr != pSdrObject)
3599  {
3600  const SdrObjList* pParentSdrObjList(GetSdrObject()->getParentSdrObjListFromSdrObject());
3601 
3602  if(nullptr != pParentSdrObjList)
3603  {
3604  // SdrObject is member of a SdrObjList. That may be a SdrObject
3605  // (SdrObjGroup or E3dScene) or a SdrPage.
3606  // Check for SdrObject first - using getSdrPageFromSdrObjList
3607  // *will* get the SdrPage even when the SdrObject is deep buried
3608  // in a construct of SdrObjGroup.
3609  // We want to ask for the direct parent here...
3610  SdrObject* pParentSdrObject(pParentSdrObjList->getSdrObjectFromSdrObjList());
3611 
3612  if(nullptr != pParentSdrObject)
3613  {
3614  // SdrObject is member of a SdrObject-based Group (SdrObjGroup or E3dScene).
3615  return pParentSdrObject->getUnoShape();
3616  }
3617  else
3618  {
3619  SdrPage* pParentSdrPage(pParentSdrObjList->getSdrPageFromSdrObjList());
3620 
3621  if(nullptr != pParentSdrPage)
3622  {
3623  // SdrObject is inserted to a SdrPage. Since
3624  // we checked for getSdrObjectFromSdrObjList first,
3625  // we can even say that it is directly member of that
3626  // SdrPage.
3627  return pParentSdrPage->getUnoPage();
3628  }
3629  }
3630 
3631  // not member of any SdrObjList, no parent
3632  OSL_FAIL( "SvxShape::getParent( ): unexpected Parent SdrObjList" );
3633  }
3634  }
3635 
3636  // no SdrObject, no parent
3637  return uno::Reference<uno::XInterface>();
3638 }
3639 
3640 void SAL_CALL SvxShape::setParent( const css::uno::Reference< css::uno::XInterface >& )
3641 {
3642  throw lang::NoSupportException();
3643 }
3644 
3645 
3648 {
3649 }
3650 
3651 
3654 {
3655 }
3656 
3657 
3658 // XActionLockable
3660 {
3661  ::SolarMutexGuard aGuard;
3662 
3663  return mnLockCount != 0;
3664 }
3665 
3666 
3667 void SAL_CALL SvxShape::addActionLock( )
3668 {
3669  ::SolarMutexGuard aGuard;
3670 
3671  DBG_ASSERT( mnLockCount < 0xffff, "lock overflow in SvxShape!" );
3672  mnLockCount++;
3673 
3674  if( mnLockCount == 1 )
3675  lock();
3676 }
3677 
3678 
3680 {
3681  ::SolarMutexGuard aGuard;
3682 
3683  DBG_ASSERT( mnLockCount > 0, "lock underflow in SvxShape!" );
3684  mnLockCount--;
3685 
3686  if( mnLockCount == 0 )
3687  unlock();
3688 }
3689 
3690 
3691 void SAL_CALL SvxShape::setActionLocks( sal_Int16 nLock )
3692 {
3693  ::SolarMutexGuard aGuard;
3694 
3695  if( (mnLockCount == 0) && (nLock != 0) )
3696  unlock();
3697 
3698  if( (mnLockCount != 0) && (nLock == 0) )
3699  lock();
3700 
3701  mnLockCount = static_cast<sal_uInt16>(nLock);
3702 }
3703 
3704 
3705 sal_Int16 SAL_CALL SvxShape::resetActionLocks( )
3706 {
3707  ::SolarMutexGuard aGuard;
3708 
3709  if( mnLockCount != 0 )
3710  unlock();
3711 
3712  sal_Int16 nOldLocks = static_cast<sal_Int16>(mnLockCount);
3713  mnLockCount = 0;
3714 
3715  return nOldLocks;
3716 }
3717 
3718 
3725 {
3726  switch( mpImpl->mnObjId )
3727  {
3728  case OBJ_LINE:
3729  case OBJ_POLY:
3730  case OBJ_PLIN:
3731  case OBJ_PATHLINE:
3732  case OBJ_PATHFILL:
3733  case OBJ_FREELINE:
3734  case OBJ_FREEFILL:
3735  case OBJ_PATHPOLY:
3736  case OBJ_PATHPLIN:
3737  {
3738  const sal_uInt32 nId = GetSdrObject()->GetObjIdentifier();
3739 
3740  if( nId != mpImpl->mnObjId )
3741  {
3742  mpImpl->mnObjId = nId;
3743 
3744  }
3745  break;
3746  }
3747  }
3748 }
3749 
3751 : SvxShape( pObject, getSvxMapProvider().GetMap(SVXMAP_TEXT), getSvxMapProvider().GetPropertySet(SVXMAP_TEXT, SdrObject::GetGlobalDrawObjectItemPool()) ), SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() )
3752 {
3753  if( pObject )
3754  SetEditSource( new SvxTextEditSource( pObject, nullptr ) );
3755 }
3756 
3757 
3758 SvxShapeText::SvxShapeText(SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet)
3759 : SvxShape( pObject, pPropertyMap, pPropertySet ), SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() )
3760 {
3761  if( pObject )
3762  SetEditSource( new SvxTextEditSource( pObject, nullptr ) );
3763 }
3764 
3765 
3767 {
3768  // check if only this instance is registered at the ranges
3769  DBG_ASSERT( (nullptr == GetEditSource()) || (GetEditSource()->getRanges().size()==1),
3770  "svx::SvxShapeText::~SvxShapeText(), text shape with living text ranges destroyed!");
3771 }
3772 
3773 void SvxShapeText::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage )
3774 {
3775  if( pNewObj && (nullptr == GetEditSource()))
3776  SetEditSource( new SvxTextEditSource( pNewObj, nullptr ) );
3777  SvxShape::Create( pNewObj, pNewPage );
3778 }
3779 
3780 // XInterface
3781 
3783 {
3784  return SvxShape::queryInterface( rType );
3785 }
3786 
3787 
3789 {
3790  uno::Any aAny( SvxShape::queryAggregation( rType ) );
3791  if( aAny.hasValue() )
3792  return aAny;
3793 
3794  return SvxUnoTextBase::queryAggregation( rType );
3795 }
3796 
3797 
3798 // XServiceInfo
3799 
3801 {
3802  return "SvxShapeText";
3803 }
3804 
3805 
3806 uno::Sequence< OUString > SAL_CALL SvxShapeText::getSupportedServiceNames()
3807 {
3809 }
3810 
3811 
3812 sal_Bool SAL_CALL SvxShapeText::supportsService( const OUString& ServiceName )
3813 {
3814  return cppu::supportsService(static_cast<SvxShape*>(this), ServiceName);
3815 }
3816 
3817  // XTypeProvider
3818 
3819 uno::Sequence< uno::Type > SAL_CALL SvxShapeText::getTypes()
3820 {
3821  return SvxShape::getTypes();
3822 }
3823 
3824 sal_Int64 SAL_CALL SvxShapeText::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
3825 {
3826  const sal_Int64 nReturn = SvxShape::getSomething( rId );
3827  if( nReturn )
3828  return nReturn;
3829 
3830  return SvxUnoTextBase::getSomething( rId );
3831 }
3832 
3833 
3834 uno::Sequence< sal_Int8 > SAL_CALL SvxShapeText::getImplementationId()
3835 {
3836  return css::uno::Sequence<sal_Int8>();
3837 }
3838 
3839 
3842 {
3843  SvxTextEditSource* pEditSource = static_cast<SvxTextEditSource*>(GetEditSource());
3844  if( pEditSource )
3845  pEditSource->lock();
3846 }
3847 
3848 
3851 {
3852  SvxTextEditSource* pEditSource = static_cast<SvxTextEditSource*>(GetEditSource());
3853  if( pEditSource )
3854  pEditSource->unlock();
3855 }
3856 
3857 // css::text::XTextRange
3858 uno::Reference< text::XTextRange > SAL_CALL SvxShapeText::getStart()
3859 {
3860  ::SolarMutexGuard aGuard;
3861  SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr;
3862  if( pForwarder )
3863  ::GetSelection( maSelection, pForwarder );
3864  return SvxUnoTextBase::getStart();
3865 
3866 }
3867 
3868 uno::Reference< text::XTextRange > SAL_CALL SvxShapeText::getEnd()
3869 {
3870  ::SolarMutexGuard aGuard;
3871  SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr;
3872  if( pForwarder )
3873  ::GetSelection( maSelection, pForwarder );
3874  return SvxUnoTextBase::getEnd();
3875 }
3876 
3877 OUString SAL_CALL SvxShapeText::getString()
3878 {
3879  ::SolarMutexGuard aGuard;
3880  SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr;
3881  if( pForwarder )
3882  ::GetSelection( maSelection, pForwarder );
3883  return SvxUnoTextBase::getString();
3884 }
3885 
3886 
3887 void SAL_CALL SvxShapeText::setString( const OUString& aString )
3888 {
3889  ::SolarMutexGuard aGuard;
3890  SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr;
3891  if( pForwarder )
3892  ::GetSelection( maSelection, pForwarder );
3893  SvxUnoTextBase::setString( aString );
3894 }
3895 
3896 // override these for special property handling in subcasses. Return true if property is handled
3897 bool SvxShapeText::setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue )
3898 {
3899  // HACK-fix #99090#
3900  // since SdrTextObj::SetVerticalWriting exchanges
3901  // SDRATTR_TEXT_AUTOGROWWIDTH and SDRATTR_TEXT_AUTOGROWHEIGHT,
3902  // we have to set the textdirection here
3903 
3904  if( pProperty->nWID == SDRATTR_TEXTDIRECTION )
3905  {
3906  SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( GetSdrObject() );
3907  if( pTextObj )
3908  {
3909  css::text::WritingMode eMode;
3910  if( rValue >>= eMode )
3911  {
3912  pTextObj->SetVerticalWriting( eMode == css::text::WritingMode_TB_RL );
3913  }
3914  }
3915  return true;
3916  }
3917  return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
3918 }
3919 
3920 bool SvxShapeText::getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue )
3921 {
3922  if( pProperty->nWID == SDRATTR_TEXTDIRECTION )
3923  {
3924  SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( GetSdrObject() );
3925  if( pTextObj && pTextObj->IsVerticalWriting() )
3926  rValue <<= css::text::WritingMode_TB_RL;
3927  else
3928  rValue <<= css::text::WritingMode_LR_TB;
3929  return true;
3930  }
3931 
3932  return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
3933 }
3934 
3935 bool SvxShapeText::getPropertyStateImpl( const SfxItemPropertySimpleEntry* pProperty, css::beans::PropertyState& rState )
3936 {
3937  return SvxShape::getPropertyStateImpl( pProperty, rState );
3938 }
3939 
3941 {
3942  return SvxShape::setPropertyToDefaultImpl( pProperty );
3943 }
3944 
3946 : SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_SHAPE), getSvxMapProvider().GetPropertySet(SVXMAP_SHAPE, SdrObject::GetGlobalDrawObjectItemPool()))
3947 {
3948 }
3949 
3951 {
3952 }
3953 
3955 {
3956  return SvxShapeText::queryInterface( rType );
3957 }
3958 
3960 {
3961  return SvxShapeText::queryAggregation( rType );
3962 }
3963 
3964 // XServiceInfo
3965 
3966 uno::Sequence< OUString > SvxShapeRect::getSupportedServiceNames()
3967 {
3969 }
3970 
3972 uno::Reference< drawing::XShape > GetXShapeForSdrObject( SdrObject* pObj ) throw ()
3973 {
3974  uno::Reference< drawing::XShape > xShape( pObj->getUnoShape(), uno::UNO_QUERY );
3975  return xShape;
3976 }
3977 
3979 SdrObject* GetSdrObjectFromXShape( const uno::Reference< drawing::XShape >& xShape ) throw()
3980 {
3981  SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
3982  return pShape ? pShape->GetSdrObject() : nullptr;
3983 }
3984 
3985 
3986 SdrObject* SdrObject::getSdrObjectFromXShape( const css::uno::Reference< css::uno::XInterface >& xInt )
3987 {
3988  SvxShape* pSvxShape = comphelper::getUnoTunnelImplementation<SvxShape>( xInt );
3989  return pSvxShape ? pSvxShape->GetSdrObject() : nullptr;
3990 }
3991 
3993 {
3994  if(!pMap || !pMap->nWID)
3995  return uno::Any();
3996 
3997  // Check is for items that store either metric values if they are positive or percentage if they are negative.
3998  bool bDontConvertNegativeValues = ( pMap->nWID == XATTR_FILLBMP_SIZEX || pMap->nWID == XATTR_FILLBMP_SIZEY );
3999  return SvxItemPropertySet::getPropertyValue( pMap, rSet, (pMap->nWID != SDRATTR_XMLATTRIBUTES), bDontConvertNegativeValues );
4000 }
4001 
4003 {
4004  if(!pMap || !pMap->nWID)
4005  return;
4006 
4007  bool bDontConvertNegativeValues = ( pMap->nWID == XATTR_FILLBMP_SIZEX || pMap->nWID == XATTR_FILLBMP_SIZEY );
4008  SvxItemPropertySet::setPropertyValue( pMap, rVal, rSet, bDontConvertNegativeValues );
4009 }
4010 
4011 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void TakeNotPersistAttr(SfxItemSet &rAttr) const
Definition: svdobj.cxx:2097
void setPropertyValue(const SfxItemPropertySimpleEntry *pMap, const css::uno::Any &rVal) const
Point TopLeft() const
const char sUNO_service_drawing_CustomShapeProperties[]
Definition: unoshape.cxx:3136
long getHeight() const
long Width() const
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unoshape.cxx:3162
virtual void SAL_CALL removePropertiesChangeListener(const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
Definition: unoshape.cxx:1907
const sal_uInt16 E3D_LATHEOBJ_ID
Definition: globl3d.hxx:30
void SetPos(const Point &rPoint)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoshape.cxx:3819
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshape.cxx:3782
OutlineText, special text object for StarDraw.
Definition: svdobj.hxx:137
virtual bool setPropertyToDefaultImpl(const SfxItemPropertySimpleEntry *pProperty)
Definition: unoshape.cxx:2964
const css::uno::WeakReference< css::uno::XInterface > & getWeakUnoShape() const
Definition: svdobj.hxx:918
virtual void unlock()
called from the XActionLockable interface methods on final unlock
Definition: unoshape.cxx:3653
#define OWN_ATTR_EDGE_START_OBJ
Definition: unoshprp.hxx:89
long GetWidth() const
default implementation of an IPropertyValueProvider
const char sUNO_service_drawing_MeasureProperties[]
Definition: unoshape.cxx:3128
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &aType) override
Definition: unoshape.cxx:296
const char sUNO_service_drawing_TextShape[]
Definition: unoshape.cxx:3150
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:3578
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: unoshape.cxx:2996
uno::Reference< drawing::XShape > GetXShapeForSdrObject(SdrObject *pObj)
returns a StarOffice API wrapper for the given SdrObject
Definition: unoshape.cxx:3972
void setHeight(long n)
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)
css::uno::Any _getPropertyDefault(const OUString &aPropertyName)
Definition: unoshape.cxx:3038
SdrHintKind GetKind() const
Definition: svdmodel.hxx:123
long GetHeight() const
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:854
virtual bool getPropertyStateImpl(const SfxItemPropertySimpleEntry *pProperty, css::beans::PropertyState &rState) override
Definition: unoshape.cxx:3935
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyDefaults(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: unoshape.cxx:3099
SvxShapeRect(SdrObject *pObj)
Definition: unoshape.cxx:3945
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
Definition: svdobj.cxx:1484
Universal Network Object packed into SvDraw object.
Definition: svdobj.hxx:147
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
constexpr TypedWhichId< XLineStartItem > XATTR_LINESTART(XATTR_LINE_FIRST+4)
foreign graphic (StarView Graphic)
Definition: svdobj.hxx:138
void updateShapeKind()
since polygon shapes can change their kind during editing, we have to recheck it here.
Definition: unoshape.cxx:3724
#define OWN_ATTR_METAFILE
Definition: unoshprp.hxx:95
void SetResizeProtect(bool bProt)
Definition: svdobj.cxx:2569
#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:114
natural cubic Spline (ni)
Definition: svdobj.hxx:133
::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
media shape
Definition: svdobj.hxx:149
const char sUNO_service_style_ParagraphPropertiesComplex[]
Definition: unoshape.cxx:3118
#define MID_NAME
#define OWN_ATTR_MIRRORED
Definition: unoshprp.hxx:103
const char sUNO_service_style_CharacterPropertiesAsian[]
Definition: unoshape.cxx:3122
long Height() const
std::unique_ptr< SvxEditSource > mpEditSource
Polyline represented by SdrPathObj.
Definition: svdobj.hxx:143
void _setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue)
Definition: unoshape.cxx:1618
const sal_uInt16 E3D_POLYGONOBJ_ID
Definition: globl3d.hxx:32
virtual void lock()
called from the XActionLockable interface methods on initial locking
Definition: unoshape.cxx:3647
constexpr TypedWhichId< SfxMetricItem > XATTR_FILLBMP_SIZEX(XATTR_FILL_FIRST+9)
long getWidth() const
periodic cubic Spline (ni)
Definition: svdobj.hxx:134
#define OWN_ATTR_BITMAP
Definition: unoshprp.hxx:88
void SetMirrored(bool _bMirrored)
Definition: svdograf.cxx:1025
constexpr TypedWhichId< SdrObjPrintableItem > SDRATTR_OBJPRINTABLE(SDRATTR_NOTPERSIST_FIRST+2)
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:3986
#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
const char sUNO_service_drawing_OLE2Shape[]
Definition: unoshape.cxx:3152
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:758
caption object
Definition: svdobj.hxx:141
bool IsInserted() const
Definition: svdobj.hxx:794
size_t GetObjCount() const
Definition: svdpage.cxx:752
virtual void SAL_CALL setActionLocks(sal_Int16 nLock) override
Definition: unoshape.cxx:3691
void SetPrefSize(const Size &rSize)
virtual OUString SAL_CALL getName() override
Definition: unoshape.cxx:1275
void setUnoShape(const css::uno::Reference< css::uno::XInterface > &_rxUnoShape)
Definition: svdobj.cxx:2856
sal_Int16 nId
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
Definition: unoshape.cxx:3858
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertySimpleEntry *pProperty, const css::uno::Any &rValue) override
Definition: unoshape.cxx:3897
#define OWN_ATTR_MISC_OBJ_DESCRIPTION
Definition: unoshprp.hxx:167
XDashListRef GetDashList() const
Definition: svdmodel.hxx:527
const char sUNO_service_drawing_ConnectorProperties[]
Definition: unoshape.cxx:3127
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unoshape.cxx:1411
std::unique_ptr< SvxShapeImpl > mpImpl
these members are used to optimize XMultiProperty calls
Definition: unoshape.hxx:119
SdrInventor
Definition: svdobj.hxx:153
virtual OUString TakeObjNameSingul() const
Definition: svdobj.cxx:1018
measurement object
Definition: svdobj.hxx:145
OLE object.
Definition: svdobj.hxx:139
constexpr TypedWhichId< SdrYesNoItem > SDRATTR_OBJMOVEPROTECT(SDRATTR_NOTPERSIST_FIRST+0)
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
Definition: unoshape.cxx:3026
B2DPolyPolygon UnoPointSequenceSequenceToB2DPolyPolygon(const css::drawing::PointSequenceSequence &rPointSequenceSequenceSource)
virtual void SAL_CALL setString(const OUString &aString) override
bool AreThereOwnUsrAnys() const
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
circle cut
Definition: svdobj.hxx:126
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:1606
SVX_DLLPRIVATE void impl_construct()
CTOR-Impl.
Definition: unoshape.cxx:337
open free-hand line
Definition: svdobj.hxx:131
const char sUNO_service_drawing_ClosedBezierShape[]
Definition: unoshape.cxx:3149
virtual ~SvxShape() override
Definition: unoshape.cxx:223
Center
virtual void Create(SdrObject *pNewOpj, SvxDrawPage *pNewPage) override
Definition: unoshape.cxx:3773
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertySimpleEntry *pProperty, css::uno::Any &rValue)
Definition: unoshape.cxx:2540
#define OWN_ATTR_FILLBMP_MODE
Definition: unoshprp.hxx:113
const char sUNO_service_drawing_ShadowProperties[]
Definition: unoshape.cxx:3129
virtual css::awt::Size SAL_CALL getSize() override
Definition: unoshape.cxx:1208
#define OWN_ATTR_UINAME_SINGULAR
Definition: unoshprp.hxx:158
polygon, PolyPolygon
Definition: svdobj.hxx:127
object that represents a SdrPage
Definition: svdobj.hxx:144
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
line
Definition: svdobj.hxx:121
SvxShapeImpl(SvxShape &_rAntiImpl,::osl::Mutex &_rMutex)
Definition: unoshape.cxx:124
css::uno::WeakReference< css::container::XIndexContainer > mxGluePoints
Definition: unoshape.hxx:122
virtual void Rotate(const Point &rRef, long nAngle, double sn, double cs)
Definition: svdobj.cxx:1512
void ConnectToNode(bool bTail1, SdrObject *pObj) override
Definition: svdoedge.cxx:448
void SetGrabBagItem(const css::uno::Any &rVal)
Definition: svdobj.cxx:822
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:1598
const char sUNO_service_drawing_ControlShape[]
Definition: unoshape.cxx:3157
bool IsVisible() const
Definition: svdobj.hxx:806
virtual css::uno::Any SAL_CALL queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
::osl::Mutex maMutex
Definition: unoshape.hxx:78
#define OWN_ATTR_ISFONTWORK
Definition: unoshprp.hxx:96
std::size_t GetEndOfData() const
const sal_Int16 OBJ_OLE2_APPLET
Globals.
Definition: unoprov.hxx:99
virtual bool getPropertyStateImpl(const SfxItemPropertySimpleEntry *pProperty, css::beans::PropertyState &rState)
Definition: unoshape.cxx:2934
const char sUNO_service_drawing_PolyPolygonDescriptor[]
Definition: unoshape.cxx:3139
custom shape
Definition: svdobj.hxx:148
const char sUNO_service_drawing_MeasureShape[]
Definition: unoshape.cxx:3155
sal_uInt32 getShapeKind() const
Definition: unoshape.cxx:284
Polygon/PolyPolygon represented by SdrPathObj.
Definition: svdobj.hxx:142
basegfx::B2DPolyPolygon GetEdgeTrackPath() const
Definition: svdoedge.cxx:1721
void ClearMergedItem(const sal_uInt16 nWhich=0)
Definition: svdobj.cxx:1905
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
long Right() const
bool IsMirrored(const long nPageLeftMargin, const long nPageRightMargin, const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored)
#define OWN_ATTR_ZORDER
Definition: unoshprp.hxx:107
const char sUNO_service_drawing_TextProperties[]
Definition: unoshape.cxx:3125
UNOTOOLS_DLLPUBLIC bool GetTitle(OUString const &url, OUString *title)
connector object
Definition: svdobj.hxx:140
void Record(OutputDevice *pOutDev)
virtual css::uno::Reference< css::uno::XInterface > getUnoShape()
Definition: svdobj.cxx:2772
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:263
SdrLayerID GetID() const
Definition: svdlayer.hxx:94
const char sUNO_service_drawing_Text[]
Definition: unoshape.cxx:3133
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:3868
static tools::Rectangle svx_getLogicRectHack(SdrObject const *pObj)
Definition: unoshape.cxx:1129
continuously activated OLE (PlugIn-Frame or similar)
Definition: svdobj.hxx:146
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
Definition: unoshape.cxx:3640
#define OWN_ATTR_MISC_OBJ_TITLE
Definition: unoshprp.hxx:166
B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
const char sUNO_service_drawing_GraphicObjectShape[]
Definition: unoshape.cxx:3151
#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:1370
int nCount
virtual void SAL_CALL setName(const OUString &aName) override
Definition: unoshape.cxx:1289
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoshape.cxx:815
const char sUNO_service_drawing_RotationDescriptor[]
Definition: unoshape.cxx:3131
const ESelection & GetSelection() 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:3112
const GDIMetaFile & GetGDIMetaFile() const
css::uno::Any getPropertyValue(const SfxItemPropertySimpleEntry *pMap) const
PolyLine.
Definition: svdobj.hxx:128
Mode eMode
const sal_uInt16 E3D_SCENE_ID
Definition: globl3d.hxx:25
XLineEndListRef GetLineEndList() const
Definition: svdmodel.hxx:532
virtual sal_Int16 SAL_CALL resetActionLocks() override
Definition: unoshape.cxx:3705
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
long Top() const
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:2558
circle, ellipse
Definition: svdobj.hxx:123
const char sUNO_service_drawing_GroupShape[]
Definition: unoshape.cxx:3134
virtual void SetChanged(bool bFlg=true)
Definition: svdmodel.cxx:1261
o3tl::strong_int< sal_uInt8, struct SdrLayerIDTag > SdrLayerID
Definition: svdtypes.hxx:59
virtual void SAL_CALL dispose() override
Definition: unoshape.cxx:1316
B2IRange fround(const B2DRange &rRange)
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unoshape.cxx:3959
void setWidth(long n)
const GraphicObject & GetGraphicObject() const
Definition: xtable.hxx:125
OUString maShapeType
Definition: unoshape.hxx:115
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:211
::osl::Mutex maMutex
SdrObject * GetConnectedNode(bool bTail1) const override
Definition: svdoedge.cxx:472
const char sUNO_service_drawing_OpenBezierShape[]
Definition: unoshape.cxx:3148
virtual ~SvxShapeRect() override
Definition: unoshape.cxx:3950
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshape.cxx:3954
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unoshape.cxx:3812
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
static css::uno::Reference< css::awt::XBitmap > CreateBitmap(const BitmapEx &rBitmap)
bool mbHasSdrObjectOwnership
Definition: unoshape.cxx:110
virtual OUString SAL_CALL getImplementationName() override
Definition: unoshape.cxx:3800
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:1404
virtual void SAL_CALL addActionLock() override
Definition: unoshape.cxx:3667
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertySimpleEntry *pProperty, css::uno::Any &rValue) override
Definition: unoshape.cxx:3920
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:1860
virtual void SAL_CALL addPropertiesChangeListener(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
Definition: unoshape.cxx:1903
object group
Definition: svdobj.hxx:120
const char sUNO_service_drawing_PolyPolygonBezierDescriptor[]
Definition: unoshape.cxx:3140
#define MM_TO_TWIPS(val)
Definition: unopage.hxx:52
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: unoshape.cxx:1026
const char sUNO_service_drawing_PolyLineShape[]
Definition: unoshape.cxx:3147
const char sUNO_service_drawing_Shape[]
Definition: unoshape.cxx:3143
const char sUNO_service_drawing_PageShape[]
Definition: unoshape.cxx:3153
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)
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unoshape.cxx:1424
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
Definition: unoshape.cxx:1178
bool mbDisposing
Definition: unoshape.cxx:111
#define OWN_ATTR_TEXTFITTOSIZESCALE
Definition: unoshprp.hxx:195
bool IsWriter() const
Definition: svdmodel.hxx:575
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
Point GetTailPoint(bool bTail) const
Definition: svdoedge.cxx:2501
abstract object (SdrObject)
Definition: svdobj.hxx:119
void SingleObjectPainter(OutputDevice &rOut) const
Definition: svdobj.cxx:951
virtual sal_uInt16 GetObjIdentifier() const
Definition: svdobj.cxx:558
const char sUNO_service_drawing_FillProperties[]
Definition: unoshape.cxx:3124
#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:1916
const Graphic & GetGraphic() const
Definition: svdograf.cxx:330
constexpr TypedWhichId< SdrLayerNameItem > SDRATTR_LAYERNAME(SDRATTR_NOTPERSIST_FIRST+4)
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon)
Definition: svdobj.cxx:2915
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:905
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:1224
virtual Point GetPoint(sal_uInt32 i) const override
Definition: svdomeas.cxx:1097
bool IsPrintable() const
Definition: svdobj.hxx:804
#define OWN_ATTR_GLUEID_HEAD
Definition: unoshprp.hxx:106
const SfxItemPropertySimpleEntry * getPropertyMapEntry(const OUString &rName) const
constexpr TypedWhichId< SdrObjVisibleItem > SDRATTR_OBJVISIBLE(SDRATTR_NOTPERSIST_FIRST+35)
const OUString & GetName() const
Definition: svdlayer.hxx:77
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:1930
XGradientListRef GetGradientList() const
Definition: svdmodel.hxx:533
unsigned char sal_Bool
long Bottom() const
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:3572
void transform(const basegfx::B2DHomMatrix &rMatrix)
virtual void SAL_CALL setString(const OUString &aString) override
Definition: unoshape.cxx:3887
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:796
SdrLayer * GetLayerPerID(SdrLayerID nID)
Definition: svdlayer.hxx:147
OUString maShapeName
Definition: unoshape.hxx:116
virtual long GetShearAngle(bool bVertical=false) const
Definition: svdobj.cxx:1646
bool mbIsMultiPropertyCall
Definition: unoshape.hxx:120
void SetVisible(bool bVisible)
Definition: svdobj.cxx:2594
size
const char sUNO_service_drawing_FrameShape[]
Definition: unoshape.cxx:3156
virtual void SetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1632
virtual void Move(const Size &rSiz)
Definition: svdobj.cxx:1467
css::uno::Type const & get()
void SetMergedItem(const SfxPoolItem &rItem)
Definition: svdobj.cxx:1900
const char sUNO_service_drawing_RectangleShape[]
Definition: unoshape.cxx:3144
const char sUNO_service_style_CharacterPropertiesComplex[]
Definition: unoshape.cxx:3121
const sal_uInt16 E3D_EXTRUDEOBJ_ID
Definition: globl3d.hxx:29
void reset(reference_type *pReference)
std::unique_ptr< SfxItemSet > mpItemSet
Definition: unoshape.cxx:107
SvxShape & mrAntiImpl
Definition: unoshape.cxx:106
void SetTailPoint(bool bTail, const Point &rPt)
Definition: svdoedge.cxx:2526
bool IsResizeProtect() const
Definition: svdobj.hxx:802
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
virtual void SAL_CALL setAllPropertiesToDefault() override
Definition: unoshape.cxx:3064
void SetUserCall(SdrObjUserCall *pUser)
Definition: svdobj.cxx:2649
constexpr TypedWhichId< SdrShearAngleItem > SDRATTR_SHEARANGLE(SDRATTR_NOTPERSIST_FIRST+17)
void _setPropertyToDefault(const OUString &PropertyName)
Definition: unoshape.cxx:3008
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
#define OWN_ATTR_PAGE_NUMBER
Definition: unoshprp.hxx:148
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
Abstract DrawObject.
Definition: svdobj.hxx:313
const char sUNO_service_style_CharacterProperties[]
Definition: unoshape.cxx:3120
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:1376
const char sUNO_service_drawing_LineProperties[]
Definition: unoshape.cxx:3126
SfxItemPool * GetPool() const
virtual SdrObject * RemoveObject(size_t nObjNum)
Definition: svdpage.cxx:421
const SfxItemPropertySimpleEntry * getByName(const OUString &rName) const
OUString GetName() const
Definition: svdobj.cxx:698
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:3966
css::uno::Any GetBitmap(bool bMetaFile=false) const
Definition: unoshape.cxx:684
css::awt::Size maSize
Definition: unoshape.hxx:113
void endSetPropertyValues()
Definition: unoshape.cxx:1853
std::vector< SfxItemPropertyNamedEntry > PropertyEntryVector_t
virtual ~SvxShapeText() override
Definition: unoshape.cxx:3766
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unoshape.cxx:1418
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
Definition: unoshape.cxx:1997
const basegfx::B2DPolyPolygon & GetLineEnd() const
Definition: xtable.hxx:65
sal_uInt32 mnObjId
Definition: unoshape.cxx:108
void SetEditSource(SvxEditSource *_pEditSource)
closed Bezier-curve
Definition: svdobj.hxx:130
#define E3D_INVENTOR_FLAG
Definition: unoprov.hxx:102
const PropertyValue * pValues
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
circle section
Definition: svdobj.hxx:124
TitleText, special text object for StarDraw.
Definition: svdobj.hxx:136
virtual void SAL_CALL removeActionLock() override
Definition: unoshape.cxx:3679
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:3788
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:129
PropertyEntryVector_t getPropertyEntries() const
sal_uInt32 count() const
void setMaster(SvxShapeMaster *pMaster)
Definition: unoshape.cxx:290
XHatchListRef GetHatchList() const
Definition: svdmodel.hxx:528
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unoshape.cxx:1155
#define OWN_ATTR_EDGE_END_OBJ
Definition: unoshprp.hxx:91
circle arc
Definition: svdobj.hxx:125
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:814
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:1747
static void svx_setLogicRectHack(SdrObject *pObj, const tools::Rectangle &rRect)
Definition: unoshape.cxx:1142
constexpr TypedWhichId< XFillBmpStretchItem > XATTR_FILLBMP_STRETCH(XATTR_FILL_FIRST+16)
::tools::WeakReference< SdrObject > mpSdrObjectWeakReference
Definition: unoshape.hxx:133
void SvxItemPropertySet_setPropertyValue(const SfxItemPropertySimpleEntry *pMap, const uno::Any &rVal, SfxItemSet &rSet)
Definition: unoshape.cxx:4002
static bool SetPropertyValueHelper(const SfxItemPropertySimpleEntry *pMap, const css::uno::Any &aValue, SfxItemSet &rNewSet, const ESelection *pSelection=nullptr, SvxEditSource *pEditSource=nullptr)
const char sUNO_service_style_ParagraphPropertiesAsian[]
Definition: unoshape.cxx:3119
css::uno::Reference< css::uno::XInterface > const & getUnoPage()
Definition: svdpage.cxx:1667
const char sUNO_service_drawing_ConnectorShape[]
Definition: unoshape.cxx:3158
void Move(long nX, long nY)
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:1911
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Sequence< css::uno::Any > &aValues) override
Definition: unoshape.cxx:1805
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
const SfxItemSet & GetMergedItemSet() const
Definition: svdobj.cxx:1890
virtual bool setPropertyToDefaultImpl(const SfxItemPropertySimpleEntry *pProperty) override
Definition: unoshape.cxx:3940
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:51
SdrObject * GetSdrObject() const
Definition: unoshape.hxx:210
#define F_PI18000
void SetDescription(const OUString &rStr)
Definition: svdobj.cxx:752
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unoshape.cxx:1385
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
const char sUNO_service_drawing_PolyPolygonShape[]
Definition: unoshape.cxx:3146
const char sUNO_service_style_ParagraphProperties[]
Definition: unoshape.cxx:3117
virtual long GetRotateAngle() const
Definition: svdobj.cxx:1641
virtual void SAL_CALL setPropertiesToDefault(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: unoshape.cxx:3092
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)
long Left() const
const char sUNO_service_drawing_LineShape[]
Definition: unoshape.cxx:3142
const char sUNO_service_drawing_MediaShape[]
Definition: unoshape.cxx:3159
const Point & GetAnchorPos() const
Definition: svdobj.cxx:1589
virtual OUString TakeObjNamePlural() const
Definition: svdobj.cxx:1033
const sal_Int16 OBJ_OLE2_PLUGIN
Definition: unoprov.hxx:100
#define OWN_ATTR_EDGE_POLYPOLYGONBEZIER
Definition: unoshprp.hxx:177
XBitmapListRef GetBitmapList() const
Definition: svdmodel.hxx:530
virtual void Shear(const Point &rRef, long nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1532
OUString sId
css::uno::Sequence< OUString > _getSupportedServiceNames()
Definition: unoshape.cxx:3174
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1623
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &aPropertyName) override
Definition: unoshape.cxx:2984
void SetEdgeTrackPath(const basegfx::B2DPolyPolygon &rPoly)
Definition: svdoedge.cxx:1701
OUString const & GetName() const
Definition: xit.hxx:52
SvxEditSource * GetEditSource() const
sal_Int32 getGluePointIndex(bool bTail)
this method is used by the api to return a glue point id for a connection.
Definition: svdoedge.cxx:2571
const sal_uInt16 E3D_SPHEREOBJ_ID
Definition: globl3d.hxx:28
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 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:1608
const char sUNO_service_drawing_EllipseShape[]
Definition: unoshape.cxx:3145
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:3824
virtual OUString SAL_CALL getShapeType() override
Definition: unoshape.cxx:1305
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertySimpleEntry *pProperty, const css::uno::Any &rValue)
Definition: unoshape.cxx:2076
bool SetFillAttribute(sal_uInt16 nWID, const OUString &rName)
Definition: unoshape.cxx:1430
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:2009
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const
Definition: svdobj.cxx:2888
const char sUNO_service_drawing_CaptionShape[]
Definition: unoshape.cxx:3154
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
uno::Any SvxItemPropertySet_getPropertyValue(const SfxItemPropertySimpleEntry *pMap, const SfxItemSet &rSet)
Definition: unoshape.cxx:3992
SdrObject * GetSdrObjectFromXShape(const uno::Reference< drawing::XShape > &xShape)
returns the SdrObject from the given StarOffice API wrapper
Definition: unoshape.cxx:3979
const SdrLayerAdmin & GetLayerAdmin() const
Definition: svdmodel.hxx:310
helper class for notifying XPropertyChangeListeners
const char sUNO_service_drawing_CustomShape[]
Definition: unoshape.cxx:3137
virtual void SetChanged()
Definition: svdobj.cxx:929
SvxUnoPropertyMapProvider & getSvxMapProvider()
Definition: unoprov.cxx:888
::comphelper::OInterfaceContainerHelper2 maDisposeListeners
Definition: unoshape.cxx:121
#define OWN_ATTR_MEASURE_START_POS
Definition: unoshprp.hxx:108
sal_uInt16 mnLockCount
used from the XActionLockable interface
Definition: unoshape.hxx:163
constexpr TypedWhichId< SdrMetricItem > SDRATTR_ECKENRADIUS(SDRATTR_MISC_FIRST+0)
const sal_uInt16 E3D_CUBEOBJ_ID
Definition: globl3d.hxx:27
sal_uInt16 GetPageNum() const
Definition: svdpage.cxx:1501
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:2580
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unoshape.cxx:1738
void SetName(const OUString &rStr)
Definition: svdobj.cxx:664
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
SdrObjUserCall * GetUserCall() const
Definition: svdobj.hxx:886
virtual SdrObject * getSdrObjectFromSdrObjList() const
Definition: svdpage.cxx:137
void SetTitle(const OUString &rStr)
Definition: svdobj.cxx:708
#define OWN_ATTR_MEASURE_END_POS
Definition: unoshprp.hxx:109
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoshape.cxx:3834
text object
Definition: svdobj.hxx:135
virtual void lock() override
called from the XActionLockable interface methods on initial locking
Definition: unoshape.cxx:3841
virtual void SetVerticalWriting(bool bVertical)
Definition: svdotext.cxx:1509
open Bezier-curve
Definition: svdobj.hxx:129
virtual OUString SAL_CALL getString() override
Definition: unoshape.cxx:3877
void ApplyNotPersistAttr(const SfxItemSet &rAttr)
Definition: svdobj.cxx:1935
svx::PropertyChangeNotifier & getShapePropertyChangeNotifier()
Definition: unoshape.cxx:331
closed free-hand line
Definition: svdobj.hxx:132
ESelection maSelection
virtual void unlock() override
called from the XActionLockable interface methods on final unlock
Definition: unoshape.cxx:3850
#define OWN_ATTR_LDNAME
Definition: unoshprp.hxx:98
constexpr TypedWhichId< SfxStringItem > SDRATTR_OBJECTNAME(SDRATTR_NOTPERSIST_FIRST+5)
SvxShapeText(SdrObject *pObj)
Definition: unoshape.cxx:3750
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:3593
bool IsMoveProtect() const
Definition: svdobj.hxx:800
sal_uInt16 nPos
SvxShapeMaster * mpMaster
Definition: unoshape.cxx:109
virtual sal_Bool SAL_CALL isActionLocked() override
Definition: unoshape.cxx:3659
const Graphic * GetGraphic() const
Definition: svdoole2.cxx:1649
::basegfx::B2IVector maSize
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unoshape.cxx:3806
Utility class SdrEdgeObj.
Definition: svdoedge.hxx:128
sal_Int16 nValue
Definition: fmsrccfg.cxx:81
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:1398
const void * GetData()
void SetPrefMapMode(const MapMode &rMapMode)
rectangle (round corners optional)
Definition: svdobj.hxx:122
const SdrObject * GetObject() const
Definition: svdmodel.hxx:122
EnumT GetValue() const