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