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