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