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