LibreOffice Module svx (master)  1
unoshap2.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 
20 #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
21 #include <com/sun/star/lang/DisposedException.hpp>
22 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
23 #include <com/sun/star/awt/FontSlant.hpp>
24 #include <com/sun/star/style/VerticalAlignment.hpp>
25 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
26 #include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
27 #include <com/sun/star/awt/TextAlign.hpp>
28 #include <com/sun/star/style/ParagraphAdjust.hpp>
29 #include <com/sun/star/drawing/PointSequenceSequence.hpp>
30 #include <com/sun/star/drawing/PointSequence.hpp>
31 #include <com/sun/star/drawing/PolygonKind.hpp>
32 #include <com/sun/star/graphic/XGraphic.hpp>
33 #include <com/sun/star/drawing/QRCode.hpp>
34 #include <o3tl/any.hxx>
35 #include <o3tl/safeint.hxx>
36 #include <vcl/svapp.hxx>
37 #include <vcl/wmf.hxx>
38 #include <vcl/cvtgrf.hxx>
39 #include <vcl/GraphicLoader.hxx>
40 
41 #include <svx/svdpool.hxx>
42 
43 #include <editeng/unoprnms.hxx>
44 #include <svx/unoshape.hxx>
45 #include <svx/unopage.hxx>
46 #include <svx/svdobj.hxx>
47 #include <svx/svdpage.hxx>
48 #include <svx/svdmodel.hxx>
49 #include <svx/svdouno.hxx>
50 #include "shapeimpl.hxx"
51 #include <svx/unoshprp.hxx>
52 #include <svx/svdoashp.hxx>
53 #include <svx/svdviter.hxx>
54 #include <svx/svdview.hxx>
55 #include <svx/svdopath.hxx>
61 #include <com/sun/star/awt/XBitmap.hpp>
62 #include <svx/svdograf.hxx>
63 #include <sal/log.hxx>
65 #include <tools/stream.hxx>
66 
67 
68 #include <memory>
69 
70 using namespace ::osl;
71 using namespace ::cppu;
72 using namespace ::com::sun::star;
73 using namespace ::com::sun::star::uno;
74 using namespace ::com::sun::star::lang;
75 using namespace ::com::sun::star::container;
76 
77 #define QUERYINT( xint ) \
78  if( rType == cppu::UnoType<xint>::get() ) \
79  aAny <<= Reference< xint >(this)
80 
82  : SvxShape(pObj, getSvxMapProvider().GetMap(SVXMAP_GROUP), getSvxMapProvider().GetPropertySet(SVXMAP_GROUP, SdrObject::GetGlobalDrawObjectItemPool()))
83  , mxPage(pDrawPage)
84 {
85 }
86 
88 {
89 }
90 
91 void SvxShapeGroup::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage )
92 {
93  SvxShape::Create( pNewObj, pNewPage );
94  mxPage = pNewPage;
95 }
96 
97 
99 {
100  return SvxShape::queryInterface( rType );
101 }
102 
104 {
105  uno::Any aAny;
106 
107  QUERYINT( drawing::XShapeGroup );
108  else QUERYINT( drawing::XShapes );
109  else QUERYINT( drawing::XShapes2 );
110  else QUERYINT( container::XIndexAccess );
111  else QUERYINT( container::XElementAccess );
112  else
113  return SvxShape::queryAggregation( rType );
114 
115  return aAny;
116 }
117 
118 uno::Sequence< sal_Int8 > SAL_CALL SvxShapeGroup::getImplementationId()
119 {
120  return css::uno::Sequence<sal_Int8>();
121 }
122 
123 // css::drawing::XShape
124 
125 
126 OUString SAL_CALL SvxShapeGroup::getShapeType()
127 {
128  return SvxShape::getShapeType();
129 }
130 
131 awt::Point SAL_CALL SvxShapeGroup::getPosition()
132 {
133  return SvxShape::getPosition();
134 }
135 
136 
137 void SAL_CALL SvxShapeGroup::setPosition( const awt::Point& Position )
138 {
139  SvxShape::setPosition(Position);
140 }
141 
142 
143 awt::Size SAL_CALL SvxShapeGroup::getSize()
144 {
145  return SvxShape::getSize();
146 }
147 
148 
149 void SAL_CALL SvxShapeGroup::setSize( const awt::Size& rSize )
150 {
151  SvxShape::setSize( rSize );
152 }
153 
154 // drawing::XShapeGroup
155 
156 
158 {
159  // Todo
160 // pDrView->EnterMarkedGroup();
161 }
162 
163 
165 {
166  // Todo
167 // pDrView->LeaveOneGroup();
168 }
169 
170 void SvxShapeGroup::addUnoShape( const uno::Reference< drawing::XShape >& xShape, size_t nPos )
171 {
172  if (!HasSdrObject() || !mxPage.is())
173  {
174  OSL_FAIL("could not add XShape to group shape!");
175  return;
176  }
177 
178  SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
179  if (!pShape)
180  {
181  OSL_FAIL("could not add XShape to group shape!");
182  return;
183  }
184 
185  SdrObject* pSdrShape = pShape->GetSdrObject();
186  if( pSdrShape == nullptr )
187  pSdrShape = mxPage->CreateSdrObject_( xShape );
188 
189  if( pSdrShape->IsInserted() )
190  pSdrShape->getParentSdrObjListFromSdrObject()->RemoveObject( pSdrShape->GetOrdNum() );
191 
192  GetSdrObject()->GetSubList()->InsertObject(pSdrShape, nPos);
193  // TTTT Was created using mpModel in CreateSdrObject_ above
194  // TTTT may be good to add an assertion here for the future
195  // pSdrShape->SetModel(GetSdrObject()->GetModel());
196 
197  // #85922# It makes no sense to set the layer asked
198  // from the group object since this is an iteration
199  // over the contained objects. In consequence, this
200  // statement erases all layer information from the draw
201  // objects. Layers need to be set at draw objects directly
202  // and have nothing to do with grouping at all.
203  // pSdrShape->SetLayer(pObject->GetLayer());
204 
205  // Establish connection between new SdrObject and its wrapper before
206  // inserting the new shape into the group. There a new wrapper
207  // would be created when this connection would not already exist.
208  pShape->Create( pSdrShape, mxPage.get() );
209 
211 }
212 
213 // XShapes
214 void SAL_CALL SvxShapeGroup::add( const uno::Reference< drawing::XShape >& xShape )
215 {
216  ::SolarMutexGuard aGuard;
217 
218  // Add to the top of the stack (i.e. bottom of the list) by default.
219  addUnoShape(xShape, SAL_MAX_SIZE);
220 }
221 
222 
223 void SAL_CALL SvxShapeGroup::remove( const uno::Reference< drawing::XShape >& xShape )
224 {
225  ::SolarMutexGuard aGuard;
226 
227  SdrObject* pSdrShape = nullptr;
228  SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
229 
230  if( pShape )
231  pSdrShape = pShape->GetSdrObject();
232 
233  if( !HasSdrObject() || pSdrShape == nullptr || pSdrShape->getParentSdrObjectFromSdrObject() != GetSdrObject() )
234  throw uno::RuntimeException();
235 
236  SdrObjList& rList = *pSdrShape->getParentSdrObjListFromSdrObject();
237 
238  const size_t nObjCount = rList.GetObjCount();
239  size_t nObjNum = 0;
240  while( nObjNum < nObjCount )
241  {
242  if(rList.GetObj( nObjNum ) == pSdrShape )
243  break;
244  nObjNum++;
245  }
246 
247  if( nObjNum < nObjCount )
248  {
249  // #i29181#
250  // If the SdrObject which is about to be deleted is in any selection,
251  // deselect it first.
252  SdrViewIter aIter( pSdrShape );
253 
254  for ( SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView() )
255  {
256  if(SAL_MAX_SIZE != pView->TryToFindMarkedObject(pSdrShape))
257  {
258  pView->MarkObj(pSdrShape, pView->GetSdrPageView(), true);
259  }
260  }
261 
262  SdrObject* pObject = rList.NbcRemoveObject( nObjNum );
263  SdrObject::Free( pObject );
264  }
265  else
266  {
267  SAL_WARN( "svx", "Fatality! SdrObject is not belonging to its SdrObjList! [CL]" );
268  }
269 
271 }
272 
273 void SAL_CALL SvxShapeGroup::addTop( const uno::Reference< drawing::XShape >& xShape )
274 {
275  SolarMutexGuard aGuard;
276 
277  // Add to the top of the stack (i.e. bottom of the list).
278  addUnoShape(xShape, SAL_MAX_SIZE);
279 }
280 
281 void SAL_CALL SvxShapeGroup::addBottom( const uno::Reference< drawing::XShape >& xShape )
282 {
283  SolarMutexGuard aGuard;
284 
285  // Add to the bottom of the stack (i.e. top of the list).
286  addUnoShape(xShape, 0);
287 }
288 
289 // XIndexAccess
290 
291 
292 sal_Int32 SAL_CALL SvxShapeGroup::getCount()
293 {
294  ::SolarMutexGuard aGuard;
295 
296  if(!HasSdrObject() || !GetSdrObject()->GetSubList())
297  throw uno::RuntimeException();
298 
299  sal_Int32 nRetval = GetSdrObject()->GetSubList()->GetObjCount();
300  return nRetval;
301 }
302 
303 
305 {
306  ::SolarMutexGuard aGuard;
307 
308  if( !HasSdrObject() || GetSdrObject()->GetSubList() == nullptr )
309  throw uno::RuntimeException();
310 
311  if( Index<0 || GetSdrObject()->GetSubList()->GetObjCount() <= o3tl::make_unsigned(Index) )
312  throw lang::IndexOutOfBoundsException();
313 
314  SdrObject* pDestObj = GetSdrObject()->GetSubList()->GetObj( Index );
315 
316  if(pDestObj == nullptr)
317  throw lang::IndexOutOfBoundsException();
318 
319  Reference< drawing::XShape > xShape( pDestObj->getUnoShape(), uno::UNO_QUERY );
320  return uno::makeAny( xShape );
321 }
322 
323 // css::container::XElementAccess
324 
325 
327 {
329 }
330 
331 
333 {
334  ::SolarMutexGuard aGuard;
335 
336  return HasSdrObject() && GetSdrObject()->GetSubList() && (GetSdrObject()->GetSubList()->GetObjCount() > 0);
337 }
338 
340  : SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_CONNECTOR), getSvxMapProvider().GetPropertySet(SVXMAP_CONNECTOR, SdrObject::GetGlobalDrawObjectItemPool()) )
341 {
342 }
343 
344 
346 {
347 }
348 
349 
351 {
352  return SvxShapeText::queryInterface( rType );
353 }
354 
356 {
357  uno::Any aAny;
358 
359  QUERYINT( drawing::XConnectorShape );
360  else
361  return SvxShapeText::queryAggregation( rType );
362 
363  return aAny;
364 }
365 
366 // XTypeProvider
367 
368 uno::Sequence< uno::Type > SAL_CALL SvxShapeConnector::getTypes()
369 {
370  return SvxShape::getTypes();
371 }
372 
373 uno::Sequence< sal_Int8 > SAL_CALL SvxShapeConnector::getImplementationId()
374 {
375  return css::uno::Sequence<sal_Int8>();
376 }
377 
378 // css::drawing::XShape
379 
380 
382 {
384 }
385 
386 awt::Point SAL_CALL SvxShapeConnector::getPosition()
387 {
388  return SvxShapeText::getPosition();
389 }
390 
391 
392 void SAL_CALL SvxShapeConnector::setPosition( const awt::Point& Position )
393 {
394  SvxShapeText::setPosition(Position);
395 }
396 
397 
398 awt::Size SAL_CALL SvxShapeConnector::getSize()
399 {
400  return SvxShapeText::getSize();
401 }
402 
403 
404 void SAL_CALL SvxShapeConnector::setSize( const awt::Size& rSize )
405 {
406  SvxShapeText::setSize( rSize );
407 }
408 
409 
410 // XConnectorShape
411 
412 void SAL_CALL SvxShapeConnector::connectStart( const uno::Reference< drawing::XConnectableShape >& xShape, drawing::ConnectionType )
413 {
414  ::SolarMutexGuard aGuard;
415 
416  Reference< drawing::XShape > xRef( xShape, UNO_QUERY );
417  SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xRef );
418 
419  if( pShape )
420  GetSdrObject()->ConnectToNode( true, pShape->GetSdrObject() );
421 
423 }
424 
425 
426 void SAL_CALL SvxShapeConnector::connectEnd( const uno::Reference< drawing::XConnectableShape >& xShape, drawing::ConnectionType )
427 {
428  ::SolarMutexGuard aGuard;
429 
430  Reference< drawing::XShape > xRef( xShape, UNO_QUERY );
431  SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xRef );
432 
433  if( HasSdrObject() && pShape )
434  GetSdrObject()->ConnectToNode( false, pShape->GetSdrObject() );
435 
437 }
438 
439 
440 void SAL_CALL SvxShapeConnector::disconnectBegin( const uno::Reference< drawing::XConnectableShape >& )
441 {
442  ::SolarMutexGuard aGuard;
443 
444  if(HasSdrObject())
445  GetSdrObject()->DisconnectFromNode( true );
446 
448 }
449 
450 
451 void SAL_CALL SvxShapeConnector::disconnectEnd( const uno::Reference< drawing::XConnectableShape >& )
452 {
453  ::SolarMutexGuard aGuard;
454 
455  if(HasSdrObject())
456  GetSdrObject()->DisconnectFromNode( false );
457 
459 }
460 
462  : SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_CONTROL), getSvxMapProvider().GetPropertySet(SVXMAP_CONTROL, SdrObject::GetGlobalDrawObjectItemPool()) )
463 {
465 }
466 
467 
469 {
470 }
471 
472 
474 {
475  return SvxShapeText::queryInterface( rType );
476 }
477 
479 {
480  uno::Any aAny;
481 
482  QUERYINT( drawing::XControlShape );
483  else
484  return SvxShapeText::queryAggregation( rType );
485 
486  return aAny;
487 }
488 
489 // XTypeProvider
490 
491 uno::Sequence< uno::Type > SAL_CALL SvxShapeControl::getTypes()
492 {
493  return SvxShape::getTypes();
494 }
495 
496 uno::Sequence< sal_Int8 > SAL_CALL SvxShapeControl::getImplementationId()
497 {
498  return css::uno::Sequence<sal_Int8>();
499 }
500 
501 // css::drawing::XShape
502 
503 
504 OUString SAL_CALL SvxShapeControl::getShapeType()
505 {
507 }
508 
509 awt::Point SAL_CALL SvxShapeControl::getPosition()
510 {
511  return SvxShapeText::getPosition();
512 }
513 
514 
515 void SAL_CALL SvxShapeControl::setPosition( const awt::Point& Position )
516 {
517  SvxShapeText::setPosition(Position);
518 }
519 
520 
521 awt::Size SAL_CALL SvxShapeControl::getSize()
522 {
523  return SvxShapeText::getSize();
524 }
525 
526 
527 void SAL_CALL SvxShapeControl::setSize( const awt::Size& rSize )
528 {
529  SvxShapeText::setSize( rSize );
530 }
531 
532 
533 // XControlShape
534 
535 Reference< awt::XControlModel > SAL_CALL SvxShapeControl::getControl()
536 {
537  ::SolarMutexGuard aGuard;
538 
539  Reference< awt::XControlModel > xModel;
540 
541  SdrUnoObj* pUnoObj = dynamic_cast< SdrUnoObj * >(GetSdrObject());
542  if( pUnoObj )
543  xModel = pUnoObj->GetUnoControlModel();
544 
545  return xModel;
546 }
547 
548 
549 void SAL_CALL SvxShapeControl::setControl( const Reference< awt::XControlModel >& xControl )
550 {
551  ::SolarMutexGuard aGuard;
552 
553  SdrUnoObj* pUnoObj = dynamic_cast< SdrUnoObj * >(GetSdrObject());
554  if( pUnoObj )
555  pUnoObj->SetUnoControlModel( xControl );
556 
558 }
559 
560 struct
561 {
562  const char* mpAPIName;
563  sal_uInt16 mnAPINameLen;
564 
565  const char* mpFormName;
566  sal_uInt16 mnFormNameLen;
567 }
569 {
570  // Warning: The first entry must be FontSlant because the any needs to be converted
571  { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_CHAR_POSTURE), RTL_CONSTASCII_STRINGPARAM("FontSlant") }, // const sal_Int16 => css::awt::FontSlant
572  { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_CHAR_FONTNAME), RTL_CONSTASCII_STRINGPARAM("FontName") },
573  { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_CHAR_FONTSTYLENAME), RTL_CONSTASCII_STRINGPARAM("FontStyleName") },
574  { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_CHAR_FONTFAMILY), RTL_CONSTASCII_STRINGPARAM("FontFamily") },
575  { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_CHAR_FONTCHARSET), RTL_CONSTASCII_STRINGPARAM("FontCharset") },
576  { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_CHAR_HEIGHT), RTL_CONSTASCII_STRINGPARAM("FontHeight") },
577  { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_CHAR_FONTPITCH), RTL_CONSTASCII_STRINGPARAM("FontPitch" ) },
578  { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_CHAR_WEIGHT), RTL_CONSTASCII_STRINGPARAM("FontWeight" ) },
579  { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_CHAR_UNDERLINE), RTL_CONSTASCII_STRINGPARAM("FontUnderline") },
580  { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_CHAR_STRIKEOUT), RTL_CONSTASCII_STRINGPARAM("FontStrikeout") },
581  { RTL_CONSTASCII_STRINGPARAM("CharKerning"), RTL_CONSTASCII_STRINGPARAM("FontKerning") },
582  { RTL_CONSTASCII_STRINGPARAM("CharWordMode"), RTL_CONSTASCII_STRINGPARAM("FontWordLineMode" ) },
583  { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_CHAR_COLOR), RTL_CONSTASCII_STRINGPARAM("TextColor") },
584  { RTL_CONSTASCII_STRINGPARAM("CharBackColor"), RTL_CONSTASCII_STRINGPARAM("CharBackColor") },
585  { RTL_CONSTASCII_STRINGPARAM("CharBackTransparent"), RTL_CONSTASCII_STRINGPARAM("CharBackTransparent") },
586  { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_TEXT_CHAINNEXTNAME), RTL_CONSTASCII_STRINGPARAM(UNO_NAME_TEXT_CHAINNEXTNAME) },
587  { RTL_CONSTASCII_STRINGPARAM("CharRelief"), RTL_CONSTASCII_STRINGPARAM("FontRelief") },
588  { RTL_CONSTASCII_STRINGPARAM("CharUnderlineColor"), RTL_CONSTASCII_STRINGPARAM("TextLineColor") },
589  { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_PARA_ADJUST), RTL_CONSTASCII_STRINGPARAM("Align") },
590  { RTL_CONSTASCII_STRINGPARAM("TextVerticalAdjust"), RTL_CONSTASCII_STRINGPARAM("VerticalAlign") },
591  { RTL_CONSTASCII_STRINGPARAM("ControlBackground"), RTL_CONSTASCII_STRINGPARAM("BackgroundColor") },
592  { RTL_CONSTASCII_STRINGPARAM("ControlSymbolColor"), RTL_CONSTASCII_STRINGPARAM("SymbolColor") },
593  { RTL_CONSTASCII_STRINGPARAM("ControlBorder"), RTL_CONSTASCII_STRINGPARAM("Border") },
594  { RTL_CONSTASCII_STRINGPARAM("ControlBorderColor"), RTL_CONSTASCII_STRINGPARAM("BorderColor") },
595  { RTL_CONSTASCII_STRINGPARAM("ControlTextEmphasis"), RTL_CONSTASCII_STRINGPARAM("FontEmphasisMark") },
596  { RTL_CONSTASCII_STRINGPARAM("ImageScaleMode"), RTL_CONSTASCII_STRINGPARAM("ScaleMode") },
597  { RTL_CONSTASCII_STRINGPARAM("ControlWritingMode"), RTL_CONSTASCII_STRINGPARAM("WritingMode") },
598  //added for exporting OCX control
599  { RTL_CONSTASCII_STRINGPARAM("ControlTypeinMSO"), RTL_CONSTASCII_STRINGPARAM("ControlTypeinMSO") },
600  { RTL_CONSTASCII_STRINGPARAM("ObjIDinMSO"), RTL_CONSTASCII_STRINGPARAM("ObjIDinMSO") },
601  { RTL_CONSTASCII_STRINGPARAM("CharCaseMap"), RTL_CONSTASCII_STRINGPARAM("CharCaseMap") },
602  { nullptr,0, nullptr, 0 }
603 };
604 
605 namespace
606 {
607  bool lcl_convertPropertyName( const OUString& rApiName, OUString& rInternalName )
608  {
609  sal_uInt16 i = 0;
611  {
612  if( rApiName.reverseCompareToAsciiL( SvxShapeControlPropertyMapping[i].mpAPIName, SvxShapeControlPropertyMapping[i].mnAPINameLen ) == 0 )
613  {
614  rInternalName = OUString( SvxShapeControlPropertyMapping[i].mpFormName, SvxShapeControlPropertyMapping[i].mnFormNameLen, RTL_TEXTENCODING_ASCII_US );
615  }
616  ++i;
617  }
618  return !rInternalName.isEmpty();
619  }
620 
621  struct EnumConversionMap
622  {
623  style::ParagraphAdjust nAPIValue;
624  sal_Int16 nFormValue;
625  };
626 
627  EnumConversionMap const aMapAdjustToAlign[] =
628  {
629  // note that order matters:
630  // lcl_convertTextAlignmentToParaAdjustment and lcl_convertParaAdjustmentToTextAlignment search this map from the _beginning_
631  // and use the first matching entry
632  {style::ParagraphAdjust_LEFT, sal_Int16(awt::TextAlign::LEFT)},
633  {style::ParagraphAdjust_CENTER, sal_Int16(awt::TextAlign::CENTER)},
634  {style::ParagraphAdjust_RIGHT, sal_Int16(awt::TextAlign::RIGHT)},
635  {style::ParagraphAdjust_BLOCK, sal_Int16(awt::TextAlign::RIGHT)},
636  {style::ParagraphAdjust_STRETCH, sal_Int16(awt::TextAlign::LEFT)},
637  {style::ParagraphAdjust(-1),-1}
638  };
639 
640  void lcl_convertTextAlignmentToParaAdjustment( Any& _rValue )
641  {
642  sal_Int16 nValue = sal_Int16();
643  OSL_VERIFY( _rValue >>= nValue );
644 
645  for ( auto const & rEntry : aMapAdjustToAlign )
646  if ( nValue == rEntry.nFormValue )
647  {
648  _rValue <<= static_cast<sal_uInt16>(rEntry.nAPIValue);
649  return;
650  }
651  }
652 
653  void lcl_convertParaAdjustmentToTextAlignment( Any& _rValue )
654  {
655  sal_Int32 nValue = 0;
656  OSL_VERIFY( _rValue >>= nValue );
657 
658  for ( auto const & rEntry : aMapAdjustToAlign )
659  if ( static_cast<style::ParagraphAdjust>(nValue) == rEntry.nAPIValue )
660  {
661  _rValue <<= rEntry.nFormValue;
662  return;
663  }
664  }
665 
666  void convertVerticalAdjustToVerticalAlign( Any& _rValue )
667  {
668  if ( !_rValue.hasValue() )
669  return;
670 
671  drawing::TextVerticalAdjust eAdjust = drawing::TextVerticalAdjust_TOP;
672  style::VerticalAlignment eAlign = style::VerticalAlignment_TOP;
673  if ( !( _rValue >>= eAdjust ) )
674  throw lang::IllegalArgumentException();
675  switch ( eAdjust )
676  {
677  case drawing::TextVerticalAdjust_TOP: eAlign = style::VerticalAlignment_TOP; break;
678  case drawing::TextVerticalAdjust_BOTTOM: eAlign = style::VerticalAlignment_BOTTOM; break;
679  default: eAlign = style::VerticalAlignment_MIDDLE; break;
680  }
681  _rValue <<= eAlign;
682  }
683 
684  void convertVerticalAlignToVerticalAdjust( Any& _rValue )
685  {
686  if ( !_rValue.hasValue() )
687  return;
688  style::VerticalAlignment eAlign = style::VerticalAlignment_TOP;
689  drawing::TextVerticalAdjust eAdjust = drawing::TextVerticalAdjust_TOP;
690  OSL_VERIFY( _rValue >>= eAlign );
691  switch ( eAlign )
692  {
693  case style::VerticalAlignment_TOP: eAdjust = drawing::TextVerticalAdjust_TOP; break;
694  case style::VerticalAlignment_BOTTOM: eAdjust = drawing::TextVerticalAdjust_BOTTOM; break;
695  default: eAdjust = drawing::TextVerticalAdjust_CENTER; break;
696  }
697  _rValue <<= eAdjust;
698  }
699 }
700 
701 void SAL_CALL SvxShapeControl::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
702 {
703  OUString aFormsName;
704  if ( lcl_convertPropertyName( aPropertyName, aFormsName ) )
705  {
706  uno::Reference< beans::XPropertySet > xControl( getControl(), uno::UNO_QUERY );
707  if( xControl.is() )
708  {
709  uno::Reference< beans::XPropertySetInfo > xInfo( xControl->getPropertySetInfo() );
710  if( xInfo.is() && xInfo->hasPropertyByName( aFormsName ) )
711  {
712  uno::Any aConvertedValue( aValue );
713  if ( aFormsName == "FontSlant" )
714  {
715  awt::FontSlant nSlant;
716  if( !(aValue >>= nSlant ) )
717  throw lang::IllegalArgumentException();
718  aConvertedValue <<= static_cast<sal_Int16>(nSlant);
719  }
720  else if ( aFormsName == "Align" )
721  {
722  lcl_convertParaAdjustmentToTextAlignment( aConvertedValue );
723  }
724  else if ( aFormsName == "VerticalAlign" )
725  {
726  convertVerticalAdjustToVerticalAlign( aConvertedValue );
727  }
728 
729  xControl->setPropertyValue( aFormsName, aConvertedValue );
730  }
731  }
732  }
733  else
734  {
735  SvxShape::setPropertyValue( aPropertyName, aValue );
736  }
737 }
738 
739 uno::Any SAL_CALL SvxShapeControl::getPropertyValue( const OUString& aPropertyName )
740 {
741  OUString aFormsName;
742  if ( lcl_convertPropertyName( aPropertyName, aFormsName ) )
743  {
744  uno::Reference< beans::XPropertySet > xControl( getControl(), uno::UNO_QUERY );
745 
746  uno::Any aValue;
747  if( xControl.is() )
748  {
749  uno::Reference< beans::XPropertySetInfo > xInfo( xControl->getPropertySetInfo() );
750  if( xInfo.is() && xInfo->hasPropertyByName( aFormsName ) )
751  {
752  aValue = xControl->getPropertyValue( aFormsName );
753  if ( aFormsName == "FontSlant" )
754  {
755  awt::FontSlant eSlant = awt::FontSlant_NONE;
756  sal_Int16 nSlant = sal_Int16();
757  if ( aValue >>= nSlant )
758  {
759  eSlant = static_cast<awt::FontSlant>(nSlant);
760  }
761  else
762  {
763  OSL_VERIFY( aValue >>= eSlant );
764  }
765  aValue <<= eSlant;
766  }
767  else if ( aFormsName == "Align" )
768  {
769  lcl_convertTextAlignmentToParaAdjustment( aValue );
770  }
771  else if ( aFormsName == "VerticalAlign" )
772  {
773  convertVerticalAlignToVerticalAdjust( aValue );
774  }
775  }
776  }
777 
778  return aValue;
779  }
780  else
781  {
782  return SvxShape::getPropertyValue( aPropertyName );
783  }
784 
785 }
786 
787 // XPropertyState
788 beans::PropertyState SAL_CALL SvxShapeControl::getPropertyState( const OUString& PropertyName )
789 {
790  OUString aFormsName;
791  if ( lcl_convertPropertyName( PropertyName, aFormsName ) )
792  {
793  uno::Reference< beans::XPropertyState > xControl( getControl(), uno::UNO_QUERY );
794  uno::Reference< beans::XPropertySet > xPropSet( getControl(), uno::UNO_QUERY );
795 
796  if( xControl.is() && xPropSet.is() )
797  {
798  uno::Reference< beans::XPropertySetInfo > xInfo( xPropSet->getPropertySetInfo() );
799  if( xInfo.is() && xInfo->hasPropertyByName( aFormsName ) )
800  {
801  return xControl->getPropertyState( aFormsName );
802  }
803  }
804 
805  return beans::PropertyState_DEFAULT_VALUE;
806  }
807  else
808  {
809  return SvxShape::getPropertyState( PropertyName );
810  }
811 }
812 
813 void SAL_CALL SvxShapeControl::setPropertyToDefault( const OUString& PropertyName )
814 {
815  OUString aFormsName;
816  if ( lcl_convertPropertyName( PropertyName, aFormsName ) )
817  {
818  uno::Reference< beans::XPropertyState > xControl( getControl(), uno::UNO_QUERY );
819  uno::Reference< beans::XPropertySet > xPropSet( getControl(), uno::UNO_QUERY );
820 
821  if( xControl.is() && xPropSet.is() )
822  {
823  uno::Reference< beans::XPropertySetInfo > xInfo( xPropSet->getPropertySetInfo() );
824  if( xInfo.is() && xInfo->hasPropertyByName( aFormsName ) )
825  {
826  xControl->setPropertyToDefault( aFormsName );
827  }
828  }
829  }
830  else
831  {
832  SvxShape::setPropertyToDefault( PropertyName );
833  }
834 }
835 
836 uno::Any SAL_CALL SvxShapeControl::getPropertyDefault( const OUString& aPropertyName )
837 {
838  OUString aFormsName;
839  if ( lcl_convertPropertyName( aPropertyName, aFormsName ) )
840  {
841  uno::Reference< beans::XPropertyState > xControl( getControl(), uno::UNO_QUERY );
842 
843  if( xControl.is() )
844  {
845  Any aDefault( xControl->getPropertyDefault( aFormsName ) );
846  if ( aFormsName == "FontSlant" )
847  {
848  sal_Int16 nSlant( 0 );
849  aDefault >>= nSlant;
850  aDefault <<= static_cast<awt::FontSlant>(nSlant);
851  }
852  else if ( aFormsName == "Align" )
853  {
854  lcl_convertTextAlignmentToParaAdjustment( aDefault );
855  }
856  else if ( aFormsName == "VerticalAlign" )
857  {
858  convertVerticalAlignToVerticalAdjust( aDefault );
859  }
860  return aDefault;
861  }
862 
863  throw beans::UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(this));
864  }
865  else
866  {
867  return SvxShape::getPropertyDefault( aPropertyName );
868  }
869 }
870 
872  : SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_DIMENSIONING), getSvxMapProvider().GetPropertySet(SVXMAP_DIMENSIONING, SdrObject::GetGlobalDrawObjectItemPool()) )
873 {
874 }
875 
877 {
878 }
879 
881  : SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_CIRCLE), getSvxMapProvider().GetPropertySet(SVXMAP_CIRCLE, SdrObject::GetGlobalDrawObjectItemPool()) )
882 {
883 }
884 
886 {
887 }
888 
890 
892  SdrObject* pObj)
893 : SvxShapeText(
894  pObj,
896  getSvxMapProvider().GetPropertySet(SVXMAP_POLYPOLYGON, SdrObject::GetGlobalDrawObjectItemPool()))
897 {
898 }
899 
901 {
902 }
903 
904 bool SvxShapePolyPolygon::setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue )
905 {
906  switch( pProperty->nWID )
907  {
909  {
910  if( auto s = o3tl::tryAccess<drawing::PolyPolygonBezierCoords>(rValue) )
911  {
912  basegfx::B2DPolyPolygon aNewPolyPolygon(
914 
915  // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
916  ForceMetricToItemPoolMetric(aNewPolyPolygon);
917 
918  SetPolygon(aNewPolyPolygon);
919  return true;
920  }
921  break;
922  }
924  {
925  if( auto s = o3tl::tryAccess<drawing::PointSequenceSequence>(rValue) )
926  {
927  basegfx::B2DPolyPolygon aNewPolyPolygon(
929 
930  // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
931  ForceMetricToItemPoolMetric(aNewPolyPolygon);
932 
933  SetPolygon(aNewPolyPolygon);
934  return true;
935  }
936  break;
937  }
939  {
940  drawing::PointSequenceSequence aPointSequenceSequence;
941  drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords;
942 
943  if( rValue >>= aPointSequenceSequence)
944  {
945  if( HasSdrObject() )
946  {
947  basegfx::B2DPolyPolygon aNewPolyPolygon;
948  basegfx::B2DHomMatrix aNewHomogenMatrix;
949 
950  GetSdrObject()->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
951  aNewPolyPolygon = basegfx::utils::UnoPointSequenceSequenceToB2DPolyPolygon(aPointSequenceSequence);
952 
953  // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
954  // Need to adapt aNewPolyPolygon from 100thmm to app-specific
955  ForceMetricToItemPoolMetric(aNewPolyPolygon);
956 
957  GetSdrObject()->TRSetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
958  }
959  return true;
960  }
961  else if( rValue >>= aPolyPolygonBezierCoords)
962  {
963  if( HasSdrObject() )
964  {
965  basegfx::B2DPolyPolygon aNewPolyPolygon;
966  basegfx::B2DHomMatrix aNewHomogenMatrix;
967 
968  GetSdrObject()->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
969  aNewPolyPolygon = basegfx::utils::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(aPolyPolygonBezierCoords);
970 
971  // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
972  ForceMetricToItemPoolMetric(aNewPolyPolygon);
973 
974  GetSdrObject()->TRSetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
975  }
976  return true;
977  }
978  break;
979  }
981  {
982  if( auto pSequence = o3tl::tryAccess<drawing::PointSequence>(rValue) )
983  {
984  // prepare new polygon
985  basegfx::B2DPolygon aNewPolygon;
986 
987  // get pointer to arrays
988  const awt::Point* pArray = pSequence->getConstArray();
989  const awt::Point* pArrayEnd = pArray + pSequence->getLength();
990 
991  for(;pArray != pArrayEnd;++pArray)
992  {
993  aNewPolygon.append(basegfx::B2DPoint(pArray->X, pArray->Y));
994  }
995 
996  // check for closed state flag
997  basegfx::utils::checkClosed(aNewPolygon);
998 
999  // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
1000  basegfx::B2DPolyPolygon aNewPolyPolygon(aNewPolygon);
1001  ForceMetricToItemPoolMetric(aNewPolyPolygon);
1002 
1003  // set polygon
1004  SetPolygon(aNewPolyPolygon);
1005  return true;
1006  }
1007  break;
1008  }
1009  default:
1010  return SvxShapeText::setPropertyValueImpl( rName, pProperty, rValue );
1011  }
1012 
1013  throw lang::IllegalArgumentException();
1014 }
1015 
1016 bool SvxShapePolyPolygon::getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty,
1017  css::uno::Any& rValue )
1018 {
1019  switch( pProperty->nWID )
1020  {
1022  {
1023  // pack a tools::PolyPolygon in a struct tools::PolyPolygon
1024  basegfx::B2DPolyPolygon aPolyPoly(GetPolygon());
1025 
1026  // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
1027  ForceMetricTo100th_mm(aPolyPoly);
1028 
1029  drawing::PolyPolygonBezierCoords aRetval;
1031 
1032  rValue <<= aRetval;
1033  break;
1034  }
1036  {
1037  // pack a tools::PolyPolygon in a struct tools::PolyPolygon
1038  basegfx::B2DPolyPolygon aPolyPoly(GetPolygon());
1039 
1040  // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
1041  ForceMetricTo100th_mm(aPolyPoly);
1042 
1043  drawing::PointSequenceSequence aRetval( aPolyPoly.count() );
1045 
1046  rValue <<= aRetval;
1047  break;
1048  }
1050  {
1051  // pack a tools::PolyPolygon in struct PolyPolygon
1052  basegfx::B2DPolyPolygon aPolyPoly;
1053  basegfx::B2DHomMatrix aNewHomogenMatrix;
1054 
1055  if(HasSdrObject())
1056  {
1057  GetSdrObject()->TRGetBaseGeometry(aNewHomogenMatrix, aPolyPoly);
1058 
1059  // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
1060  ForceMetricTo100th_mm(aPolyPoly);
1061  }
1062 
1063  if(aPolyPoly.areControlPointsUsed())
1064  {
1065  drawing::PolyPolygonBezierCoords aRetval;
1067  rValue <<= aRetval;
1068  }
1069  else
1070  {
1071  drawing::PointSequenceSequence aRetval(aPolyPoly.count());
1073  rValue <<= aRetval;
1074  }
1075  break;
1076  }
1078  {
1079  // pack a tools::PolyPolygon in a struct tools::PolyPolygon
1080  basegfx::B2DPolyPolygon aPolyPoly(GetPolygon());
1081 
1082  // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
1083  ForceMetricTo100th_mm(aPolyPoly);
1084 
1085  const sal_Int32 nCount(0 == aPolyPoly.count() ? 0 : aPolyPoly.getB2DPolygon(0).count());
1086  drawing::PointSequence aRetval( nCount );
1087 
1088  if( nCount > 0 )
1089  {
1090  // get single polygon
1091  const basegfx::B2DPolygon& aPoly(aPolyPoly.getB2DPolygon(0));
1092 
1093  // get pointer to arrays
1094  awt::Point* pSequence = aRetval.getArray();
1095 
1096  for(sal_Int32 b=0;b<nCount;b++)
1097  {
1098  const basegfx::B2DPoint aPoint(aPoly.getB2DPoint(b));
1099  *pSequence++ = awt::Point( basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY()) );
1100  }
1101  }
1102 
1103  rValue <<= aRetval;
1104  break;
1105  }
1107  {
1108  rValue <<= GetPolygonKind();
1109  break;
1110  }
1111  default:
1112  return SvxShapeText::getPropertyValueImpl( rName, pProperty, rValue );
1113  }
1114 
1115  return true;
1116 }
1117 
1118 drawing::PolygonKind SvxShapePolyPolygon::GetPolygonKind() const
1119 {
1120  ::SolarMutexGuard aGuard;
1121  drawing::PolygonKind aRetval(drawing::PolygonKind_LINE);
1122 
1123  if(HasSdrObject())
1124  {
1125  switch(GetSdrObject()->GetObjIdentifier())
1126  {
1127  case OBJ_POLY: aRetval = drawing::PolygonKind_POLY; break;
1128  case OBJ_PLIN: aRetval = drawing::PolygonKind_PLIN; break;
1129  case OBJ_SPLNLINE:
1130  case OBJ_PATHLINE: aRetval = drawing::PolygonKind_PATHLINE; break;
1131  case OBJ_SPLNFILL:
1132  case OBJ_PATHFILL: aRetval = drawing::PolygonKind_PATHFILL; break;
1133  case OBJ_FREELINE: aRetval = drawing::PolygonKind_FREELINE; break;
1134  case OBJ_FREEFILL: aRetval = drawing::PolygonKind_FREEFILL; break;
1135  }
1136  }
1137 
1138  return aRetval;
1139 }
1140 
1142 {
1143  ::SolarMutexGuard aGuard;
1144 
1145  if(HasSdrObject())
1146  static_cast<SdrPathObj*>(GetSdrObject())->SetPathPoly(rNew);
1147 }
1148 
1149 
1151 {
1152  ::SolarMutexGuard aGuard;
1153 
1154  if(HasSdrObject())
1155  {
1156  return static_cast<SdrPathObj*>(GetSdrObject())->GetPathPoly();
1157  }
1158  else
1159  {
1160  return basegfx::B2DPolyPolygon();
1161  }
1162 }
1163 
1165 
1167  : SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_GRAPHICOBJECT), getSvxMapProvider().GetPropertySet(SVXMAP_GRAPHICOBJECT, SdrObject::GetGlobalDrawObjectItemPool()) )
1168 {
1169 }
1170 
1172 {
1173 }
1174 
1175 bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue )
1176 {
1177  bool bOk = false;
1178  switch( pProperty->nWID )
1179  {
1181  {
1182  if( auto pSeq = o3tl::tryAccess<uno::Sequence<sal_Int8>>(rValue) )
1183  {
1184  SvMemoryStream aMemStm;
1185  Graphic aGraphic;
1186 
1187  aMemStm.SetBuffer( const_cast<css::uno::Sequence<sal_Int8> *>(pSeq)->getArray(), pSeq->getLength(), pSeq->getLength() );
1188 
1189  if( GraphicConverter::Import( aMemStm, aGraphic ) == ERRCODE_NONE )
1190  {
1191  static_cast<SdrGrafObj*>(GetSdrObject())->SetGraphic(aGraphic);
1192  bOk = true;
1193  }
1194  }
1195  else if (rValue.getValueType() == cppu::UnoType<graphic::XGraphic>::get())
1196  {
1197  auto xGraphic = rValue.get<uno::Reference<graphic::XGraphic>>();
1198  if (xGraphic.is())
1199  {
1200  static_cast<SdrGrafObj*>(GetSdrObject())->SetGraphic(Graphic(xGraphic));
1201  bOk = true;
1202  }
1203  }
1204  else if (rValue.getValueType() == cppu::UnoType<awt::XBitmap>::get())
1205  {
1206  auto xBitmap = rValue.get<uno::Reference<awt::XBitmap>>();
1207  if (xBitmap.is())
1208  {
1209  uno::Reference<graphic::XGraphic> xGraphic(xBitmap, uno::UNO_QUERY);
1210  Graphic aGraphic(xGraphic);
1211  static_cast<SdrGrafObj*>(GetSdrObject())->SetGraphic(aGraphic);
1212  bOk = true;
1213  }
1214  }
1215  break;
1216  }
1217 
1219  {
1220  OUString aStreamURL;
1221 
1222  if( rValue >>= aStreamURL )
1223  {
1224  if( !aStreamURL.startsWith( UNO_NAME_GRAPHOBJ_URLPKGPREFIX ) )
1225  aStreamURL.clear();
1226 
1227  if( HasSdrObject() )
1228  {
1229  static_cast<SdrGrafObj*>(GetSdrObject())->SetGrafStreamURL( aStreamURL );
1230  }
1231  bOk = true;
1232  }
1233  break;
1234  }
1235 
1236  case OWN_ATTR_GRAPHIC_URL:
1237  {
1238  OUString aURL;
1239  uno::Reference<awt::XBitmap> xBitmap;
1240  if (rValue >>= aURL)
1241  {
1242  Graphic aGraphic = vcl::graphic::loadFromURL(aURL);
1243  if (!aGraphic.IsNone())
1244  {
1245  static_cast<SdrGrafObj*>(GetSdrObject())->SetGraphic(aGraphic);
1246  bOk = true;
1247  }
1248  }
1249  else if (rValue >>= xBitmap)
1250  {
1251  uno::Reference<graphic::XGraphic> xGraphic(xBitmap, uno::UNO_QUERY);
1252  if (xGraphic.is())
1253  {
1254  Graphic aGraphic = xGraphic;
1255  if (!aGraphic.IsNone())
1256  {
1257  static_cast<SdrGrafObj*>(GetSdrObject())->SetGraphic(aGraphic);
1258  bOk = true;
1259  }
1260  }
1261  }
1262  break;
1263  }
1264 
1266  {
1267  Reference< graphic::XGraphic > xGraphic( rValue, uno::UNO_QUERY );
1268  if( xGraphic.is() )
1269  {
1270  static_cast< SdrGrafObj*>( GetSdrObject() )->SetGraphic( xGraphic );
1271  bOk = true;
1272  }
1273  break;
1274  }
1275 
1277  {
1278  bool bIsSignatureLine;
1279  if (rValue >>= bIsSignatureLine)
1280  {
1281  static_cast<SdrGrafObj*>(GetSdrObject())->setIsSignatureLine(bIsSignatureLine);
1282  bOk = true;
1283  }
1284  break;
1285  }
1286 
1288  {
1289  OUString aSignatureLineId;
1290  if (rValue >>= aSignatureLineId)
1291  {
1292  static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineId(aSignatureLineId);
1293  bOk = true;
1294  }
1295  break;
1296  }
1297 
1299  {
1300  OUString aSuggestedSignerName;
1301  if (rValue >>= aSuggestedSignerName)
1302  {
1303  static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineSuggestedSignerName(aSuggestedSignerName);
1304  bOk = true;
1305  }
1306  break;
1307  }
1308 
1310  {
1311  OUString aSuggestedSignerTitle;
1312  if (rValue >>= aSuggestedSignerTitle)
1313  {
1314  static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineSuggestedSignerTitle(aSuggestedSignerTitle);
1315  bOk = true;
1316  }
1317  break;
1318  }
1319 
1321  {
1322  OUString aSuggestedSignerEmail;
1323  if (rValue >>= aSuggestedSignerEmail)
1324  {
1325  static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineSuggestedSignerEmail(aSuggestedSignerEmail);
1326  bOk = true;
1327  }
1328  break;
1329  }
1330 
1332  {
1333  OUString aSigningInstructions;
1334  if (rValue >>= aSigningInstructions)
1335  {
1336  static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineSigningInstructions(aSigningInstructions);
1337  bOk = true;
1338  }
1339  break;
1340  }
1341 
1343  {
1344  bool bShowSignDate;
1345  if (rValue >>= bShowSignDate)
1346  {
1347  static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineShowSignDate(bShowSignDate);
1348  bOk = true;
1349  }
1350  break;
1351  }
1352 
1354  {
1355  bool bCanAddComment;
1356  if (rValue >>= bCanAddComment)
1357  {
1358  static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineCanAddComment(bCanAddComment);
1359  bOk = true;
1360  }
1361  break;
1362  }
1363 
1365  {
1366  Reference<graphic::XGraphic> xGraphic(rValue, uno::UNO_QUERY);
1367  if (xGraphic.is())
1368  {
1369  static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineUnsignedGraphic(xGraphic);
1370  bOk = true;
1371  }
1372  break;
1373  }
1374 
1376  {
1377  bool bIsSigned;
1378  if (rValue >>= bIsSigned)
1379  {
1380  static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineIsSigned(bIsSigned);
1381  bOk = true;
1382  }
1383  break;
1384  }
1385 
1386  case OWN_ATTR_QRCODE:
1387  {
1388  css::drawing::QRCode aQrCode;
1389  if (rValue >>= aQrCode)
1390  {
1391  static_cast<SdrGrafObj*>(GetSdrObject())->setQrCode(aQrCode);
1392  bOk = true;
1393  }
1394  break;
1395  }
1396 
1397  default:
1398  return SvxShapeText::setPropertyValueImpl( rName, pProperty, rValue );
1399  }
1400 
1401  if( !bOk )
1402  throw lang::IllegalArgumentException();
1403 
1405 
1406  return true;
1407 }
1408 
1409 bool SvxGraphicObject::getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue )
1410 {
1411  switch( pProperty->nWID )
1412  {
1414  {
1415  const Graphic& rGraphic = static_cast<SdrGrafObj*>(GetSdrObject())->GetGraphic();
1416 
1417  if (rGraphic.GetType() != GraphicType::GdiMetafile)
1418  {
1419  uno::Reference<awt::XBitmap> xBitmap(rGraphic.GetXGraphic(), uno::UNO_QUERY);
1420  rValue <<= xBitmap;
1421  }
1422  else
1423  {
1424  SvMemoryStream aDestStrm( 65535, 65535 );
1425 
1426  ConvertGDIMetaFileToWMF( rGraphic.GetGDIMetaFile(), aDestStrm, nullptr, false );
1427  const uno::Sequence<sal_Int8> aSeq(
1428  static_cast< const sal_Int8* >(aDestStrm.GetData()),
1429  aDestStrm.GetEndOfData());
1430  rValue <<= aSeq;
1431  }
1432  break;
1433  }
1434 
1436  {
1437  const GraphicObject* pGrafObj = static_cast< SdrGrafObj* >(GetSdrObject())->GetReplacementGraphicObject();
1438 
1439  if (pGrafObj)
1440  {
1441  rValue <<= pGrafObj->GetGraphic().GetXGraphic();
1442  }
1443 
1444  break;
1445  }
1446 
1448  {
1449  const OUString aStreamURL( static_cast<SdrGrafObj*>( GetSdrObject() )->GetGrafStreamURL() );
1450  if( !aStreamURL.isEmpty() )
1451  rValue <<= aStreamURL;
1452  break;
1453  }
1454 
1455  case OWN_ATTR_GRAPHIC_URL:
1457  {
1458  if (pProperty->nWID == OWN_ATTR_GRAPHIC_URL)
1459  {
1460  SAL_WARN("svx", "Getting Graphic by URL is not supported, getting it by value");
1461  }
1462 
1463  Reference<graphic::XGraphic> xGraphic;
1464  auto pSdrGraphicObject = static_cast<SdrGrafObj*>(GetSdrObject());
1465  if (pSdrGraphicObject->GetGraphicObject().GetType() != GraphicType::NONE)
1466  xGraphic = pSdrGraphicObject->GetGraphic().GetXGraphic();
1467  rValue <<= xGraphic;
1468  break;
1469  }
1470 
1472  {
1473  rValue <<= static_cast< SdrGrafObj* >( GetSdrObject() )->getInputStream();
1474  break;
1475  }
1476 
1478  {
1479  rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->isSignatureLine();
1480  break;
1481  }
1482 
1484  {
1485  rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->getSignatureLineId();
1486  break;
1487  }
1488 
1490  {
1491  rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->getSignatureLineSuggestedSignerName();
1492  break;
1493  }
1494 
1496  {
1497  rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->getSignatureLineSuggestedSignerTitle();
1498  break;
1499  }
1500 
1502  {
1503  rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->getSignatureLineSuggestedSignerEmail();
1504  break;
1505  }
1506 
1508  {
1509  rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->getSignatureLineSigningInstructions();
1510  break;
1511  }
1512 
1514  {
1515  rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->isSignatureLineShowSignDate();
1516  break;
1517  }
1518 
1520  {
1521  rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->isSignatureLineCanAddComment();
1522  break;
1523  }
1524 
1526  {
1527  Reference<graphic::XGraphic> xGraphic(
1528  static_cast<SdrGrafObj*>(GetSdrObject())->getSignatureLineUnsignedGraphic());
1529  rValue <<= xGraphic;
1530  break;
1531  }
1532 
1534  {
1535  rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->isSignatureLineSigned();
1536  break;
1537  }
1538 
1539  case OWN_ATTR_QRCODE:
1540  {
1541  css::drawing::QRCode* ptr = static_cast<SdrGrafObj*>(GetSdrObject())->getQrCode();
1542  if(ptr)
1543  {
1544  rValue <<= *ptr;
1545  }
1546  break;
1547  }
1548 
1549  default:
1550  return SvxShapeText::getPropertyValueImpl(rName, pProperty,rValue);
1551  }
1552 
1553  return true;
1554 }
1555 
1556 
1558 : SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_CAPTION), getSvxMapProvider().GetPropertySet(SVXMAP_CAPTION, SdrObject::GetGlobalDrawObjectItemPool()) )
1559 {
1560 }
1561 
1563 {
1564 }
1565 
1567  : SvxShapeText( pObj, getSvxMapProvider().GetMap( SVXMAP_CUSTOMSHAPE ), getSvxMapProvider().GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool()) )
1568 {
1569 }
1570 
1572 {
1573 }
1574 
1576 {
1577  return SvxShapeText::queryInterface( rType );
1578 }
1579 
1581 {
1582  css::uno::Any aReturn = SvxShapeText::queryAggregation( rType );
1583  if ( !aReturn.hasValue() )
1584  aReturn = ::cppu::queryInterface(rType, static_cast<drawing::XEnhancedCustomShapeDefaulter*>(this) );
1585  return aReturn;
1586 }
1587 
1588 uno::Sequence< uno::Type > SAL_CALL SvxCustomShape::getTypes()
1589 {
1590  return SvxShapeText::getTypes();
1591 }
1592 
1593 uno::Sequence< sal_Int8 > SAL_CALL SvxCustomShape::getImplementationId()
1594 {
1595  return css::uno::Sequence<sal_Int8>();
1596 }
1597 
1598 // css::drawing::XShape
1599 
1600 
1601 awt::Point SAL_CALL SvxCustomShape::getPosition()
1602 {
1603  ::SolarMutexGuard aGuard;
1604  if ( HasSdrObject() )
1605  {
1606  SdrAShapeObjGeoData aCustomShapeGeoData;
1607  static_cast<SdrObjCustomShape*>(GetSdrObject())->SaveGeoData( aCustomShapeGeoData );
1608 
1609  bool bMirroredX = false;
1610  bool bMirroredY = false;
1611 
1612  if ( HasSdrObject() )
1613  {
1614  bMirroredX = static_cast<SdrObjCustomShape*>(GetSdrObject())->IsMirroredX();
1615  bMirroredY = static_cast<SdrObjCustomShape*>(GetSdrObject())->IsMirroredY();
1616  }
1617  // get aRect, this is the unrotated snaprect
1618  tools::Rectangle aRect(static_cast<SdrObjCustomShape*>(GetSdrObject())->GetLogicRect());
1619  tools::Rectangle aRectangle( aRect );
1620 
1621  if ( bMirroredX || bMirroredY )
1622  { // we have to retrieve the unmirrored rect
1623 
1624  GeoStat aNewGeo( aCustomShapeGeoData.aGeo );
1625  if ( bMirroredX )
1626  {
1627  tools::Polygon aPol( Rect2Poly( aRect, aNewGeo ) );
1628  tools::Rectangle aBoundRect( aPol.GetBoundRect() );
1629 
1630  Point aRef1( ( aBoundRect.Left() + aBoundRect.Right() ) >> 1, aBoundRect.Top() );
1631  Point aRef2( aRef1.X(), aRef1.Y() + 1000 );
1632  sal_uInt16 i;
1633  sal_uInt16 nPointCount=aPol.GetSize();
1634  for (i=0; i<nPointCount; i++)
1635  {
1636  MirrorPoint(aPol[i],aRef1,aRef2);
1637  }
1638  // turn and move polygon
1639  tools::Polygon aPol0(aPol);
1640  aPol[0]=aPol0[1];
1641  aPol[1]=aPol0[0];
1642  aPol[2]=aPol0[3];
1643  aPol[3]=aPol0[2];
1644  aPol[4]=aPol0[1];
1645  Poly2Rect(aPol,aRectangle,aNewGeo);
1646  }
1647  if ( bMirroredY )
1648  {
1649  tools::Polygon aPol( Rect2Poly( aRectangle, aNewGeo ) );
1650  tools::Rectangle aBoundRect( aPol.GetBoundRect() );
1651 
1652  Point aRef1( aBoundRect.Left(), ( aBoundRect.Top() + aBoundRect.Bottom() ) >> 1 );
1653  Point aRef2( aRef1.X() + 1000, aRef1.Y() );
1654  sal_uInt16 i;
1655  sal_uInt16 nPointCount=aPol.GetSize();
1656  for (i=0; i<nPointCount; i++)
1657  {
1658  MirrorPoint(aPol[i],aRef1,aRef2);
1659  }
1660  // turn and move polygon
1661  tools::Polygon aPol0(aPol);
1662  aPol[0]=aPol0[1];
1663  aPol[1]=aPol0[0];
1664  aPol[2]=aPol0[3];
1665  aPol[3]=aPol0[2];
1666  aPol[4]=aPol0[1];
1667  Poly2Rect( aPol, aRectangle, aNewGeo );
1668  }
1669  }
1670  Point aPt( aRectangle.TopLeft() );
1671 
1673  aPt -= GetSdrObject()->GetAnchorPos();
1674 
1675  ForceMetricTo100th_mm(aPt);
1676  return css::awt::Point( aPt.X(), aPt.Y() );
1677  }
1678  else
1679  return SvxShape::getPosition();
1680 }
1681 
1682 
1683 void SAL_CALL SvxCustomShape::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
1684 {
1685  ::SolarMutexGuard aGuard;
1686 
1688 
1689  // tdf#98163 Use a custom slot to have filter code flush the UNO
1690  // API implementations of SdrObjCustomShape. Used e.g. by
1691  // ~SdXMLCustomShapeContext, see there for more information
1692  if("FlushCustomShapeUnoApiObjects" == aPropertyName)
1693  {
1694  SdrObjCustomShape* pTarget = dynamic_cast< SdrObjCustomShape* >(pObject);
1695  if(pTarget)
1696  {
1697  // Luckily, the object causing problems in tdf#93994 is not the
1698  // UNO API object, but the XCustomShapeEngine involved. This
1699  // object is on-demand replaceable and can be reset here. This
1700  // will free the involved EditEngine and VirtualDevice.
1701  pTarget->mxCustomShapeEngine.set(nullptr);
1702  }
1703  // since this case is only for the application cores
1704  // we should return from this function now
1705  return;
1706  }
1707 
1708  bool bCustomShapeGeometry = pObject && aPropertyName == "CustomShapeGeometry";
1709 
1710  bool bMirroredX = false;
1711  bool bMirroredY = false;
1712 
1713  if ( bCustomShapeGeometry )
1714  {
1715  bMirroredX = static_cast<SdrObjCustomShape*>(pObject)->IsMirroredX();
1716  bMirroredY = static_cast<SdrObjCustomShape*>(pObject)->IsMirroredY();
1717  }
1718 
1719  SvxShape::setPropertyValue( aPropertyName, aValue );
1720 
1721  if ( bCustomShapeGeometry )
1722  {
1723  static_cast<SdrObjCustomShape*>(pObject)->MergeDefaultAttributes();
1724  tools::Rectangle aRect( pObject->GetSnapRect() );
1725 
1726  // #i38892#
1727  bool bNeedsMirrorX = static_cast<SdrObjCustomShape*>(pObject)->IsMirroredX() != bMirroredX;
1728  bool bNeedsMirrorY = static_cast<SdrObjCustomShape*>(pObject)->IsMirroredY() != bMirroredY;
1729 
1730  std::unique_ptr< SdrGluePointList > pListCopy;
1731  if( bNeedsMirrorX || bNeedsMirrorY )
1732  {
1733  const SdrGluePointList* pList = pObject->GetGluePointList();
1734  if( pList )
1735  pListCopy.reset( new SdrGluePointList(*pList) );
1736  }
1737 
1738  if ( bNeedsMirrorX )
1739  {
1740  Point aTop( ( aRect.Left() + aRect.Right() ) >> 1, aRect.Top() );
1741  Point aBottom( aTop.X(), aTop.Y() + 1000 );
1742  pObject->NbcMirror( aTop, aBottom );
1743  // NbcMirroring is flipping the current mirror state,
1744  // so we have to set the correct state again
1745  static_cast<SdrObjCustomShape*>(pObject)->SetMirroredX( !bMirroredX );
1746  }
1747  if ( bNeedsMirrorY )
1748  {
1749  Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 );
1750  Point aRight( aLeft.X() + 1000, aLeft.Y() );
1751  pObject->NbcMirror( aLeft, aRight );
1752  // NbcMirroring is flipping the current mirror state,
1753  // so we have to set the correct state again
1754  static_cast<SdrObjCustomShape*>(pObject)->SetMirroredY( !bMirroredY );
1755  }
1756 
1757  if( pListCopy )
1758  {
1759  SdrGluePointList* pNewList = const_cast< SdrGluePointList* >( pObject->GetGluePointList() );
1760  if(pNewList)
1761  *pNewList = *pListCopy;
1762  }
1763  }
1764 }
1765 
1766 bool SvxCustomShape::getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue )
1767 {
1768  switch( pProperty->nWID )
1769  {
1770  case SDRATTR_ROTATEANGLE:
1771  {
1772  double fAngle = static_cast<SdrObjCustomShape*>(GetSdrObject())->GetObjectRotation();
1773  fAngle *= 100;
1774  rValue <<= static_cast<sal_Int32>(fAngle);
1775  return true;
1776  }
1777  default:
1778  return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
1779  }
1780 }
1781 
1782 void SvxCustomShape::createCustomShapeDefaults( const OUString& rValueType )
1783 {
1784  if (!HasSdrObject())
1785  {
1786  OSL_FAIL("could not create Custom Shape Defaults!");
1787  return;
1788  }
1789 
1790  static_cast<SdrObjCustomShape*>(GetSdrObject())->MergeDefaultAttributes( &rValueType );
1791 }
1792 
1793 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Point TopLeft() const
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoshape.cxx:3773
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshape.cxx:3736
virtual void SAL_CALL setSize(const css::awt::Size &aSize) override
Definition: unoshap2.cxx:404
#define OWN_ATTR_SIGNATURELINE_SHOW_SIGN_DATE
Definition: unoshprp.hxx:190
URL aURL
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &aType) override
Definition: unoshape.cxx:269
struct @0 SvxShapeControlPropertyMapping[]
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: unoshape.cxx:2950
css::drawing::PolygonKind GetPolygonKind() const
Definition: unoshap2.cxx:1118
#define SVXMAP_CONNECTOR
Definition: unoprov.hxx:54
virtual void SAL_CALL disconnectEnd(const css::uno::Reference< css::drawing::XConnectableShape > &xShape) override
Definition: unoshap2.cxx:451
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unoshap2.cxx:1580
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
#define OWN_ATTR_VALUE_POLYGONKIND
Definition: unoshprp.hxx:78
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoshap2.cxx:496
natural cubic Spline (ni)
Definition: svdobj.hxx:132
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertySimpleEntry *pProperty, const css::uno::Any &rValue) override
Definition: unoshap2.cxx:1175
#define OWN_ATTR_REPLACEMENT_GRAPHIC
reuse attr slots for GraphicObject which will never be used together with graphic object ...
Definition: unoshprp.hxx:118
#define OWN_ATTR_SIGNATURELINE_CAN_ADD_COMMENT
Definition: unoshprp.hxx:191
bool IsNone() const
#define OWN_ATTR_QRCODE
Definition: unoshprp.hxx:194
void B2DPolyPolygonToUnoPointSequenceSequence(const B2DPolyPolygon &rPolyPolygon, css::drawing::PointSequenceSequence &rPointSequenceSequenceRetval)
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unoshap2.cxx:131
virtual sal_Bool SAL_CALL hasElements() override
Definition: unoshap2.cxx:332
#define OWN_ATTR_GRAFSTREAMURL
Definition: unoshprp.hxx:112
void Poly2Rect(const tools::Polygon &rPol, tools::Rectangle &rRect, GeoStat &rGeo)
Definition: svdtrans.cxx:487
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unoshap2.cxx:509
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshap2.cxx:1575
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unoshap2.cxx:739
bool ConvertGDIMetaFileToWMF(const GDIMetaFile &rMTF, SvStream &rTargetStream, FilterConfigItem const *pConfigItem, bool bPlaceable)
#define OWN_ATTR_VALUE_GRAPHIC
Definition: unoshprp.hxx:160
#define SVXMAP_CIRCLE
Definition: unoprov.hxx:56
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:758
bool IsInserted() const
Definition: svdobj.hxx:793
#define OWN_ATTR_SIGNATURELINE_UNSIGNED_IMAGE
Definition: unoshprp.hxx:192
size_t GetObjCount() const
Definition: svdpage.cxx:752
virtual void SAL_CALL connectEnd(const css::uno::Reference< css::drawing::XConnectableShape > &xShape, css::drawing::ConnectionType nPos) override
Definition: unoshap2.cxx:426
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshap2.cxx:473
#define OWN_ATTR_SIGNATURELINE_SUGGESTED_SIGNER_NAME
Definition: unoshprp.hxx:186
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertySimpleEntry *pProperty, const css::uno::Any &rValue) override
Definition: unoshape.cxx:3851
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
Definition: unoshape.cxx:2980
B2DPolyPolygon UnoPointSequenceSequenceToB2DPolyPolygon(const css::drawing::PointSequenceSequence &rPointSequenceSequenceSource)
virtual void ConnectToNode(bool bTail1, SdrObject *pObj)
Definition: svdobj.cxx:2259
circle cut
Definition: svdobj.hxx:125
static void Free(SdrObject *&_rpObject)
Definition: svdobj.cxx:396
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unoshape.cxx:1579
open free-hand line
Definition: svdobj.hxx:130
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:343
EmbeddedObjectRef * pObject
#define OWN_ATTR_VALUE_POLYGON
Definition: unoshprp.hxx:94
SvxShapeCircle(SdrObject *pObj)
Definition: unoshap2.cxx:880
Graphic loadFromURL(OUString const &rURL, weld::Window *pParentWin)
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertySimpleEntry *pProperty, css::uno::Any &rValue)
Definition: unoshape.cxx:2500
virtual css::awt::Size SAL_CALL getSize() override
Definition: unoshape.cxx:1181
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:647
sal_uInt16 mnFormNameLen
Definition: unoshap2.cxx:566
virtual ~SvxShapeDimensioning() override
Definition: unoshap2.cxx:876
#define UNO_NAME_GRAPHOBJ_URLPKGPREFIX
polygon, PolyPolygon
Definition: svdobj.hxx:126
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1597
virtual OUString SAL_CALL getShapeType() override
Definition: unoshap2.cxx:126
SdrView * NextView()
Definition: svdviter.cxx:165
std::size_t GetEndOfData() const
virtual void SAL_CALL connectStart(const css::uno::Reference< css::drawing::XConnectableShape > &xShape, css::drawing::ConnectionType nPos) override
Definition: unoshap2.cxx:412
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
Definition: unoshap2.cxx:788
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void ForceMetricToItemPoolMetric(Pair &rPoint) const
Definition: unoshape.cxx:426
virtual ~SvxCustomShape() override
Definition: unoshap2.cxx:1571
virtual css::uno::Reference< css::uno::XInterface > getUnoShape()
Definition: svdobj.cxx:2771
virtual void SAL_CALL add(const css::uno::Reference< css::drawing::XShape > &xShape) override
Definition: unoshap2.cxx:214
virtual void Create(SdrObject *pNewOpj, SvxDrawPage *pNewPage)
Definition: unoshape.cxx:369
continuously activated OLE (PlugIn-Frame or similar)
Definition: svdobj.hxx:145
The transformation of a rectangle into a polygon, by using angle parameters from GeoStat.
Definition: svdtrans.hxx:214
int nCount
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoshape.cxx:788
#define SVXMAP_GRAPHICOBJECT
Definition: unoprov.hxx:58
std::enable_if< !(detail::IsDerivedReference< T >::value||detail::IsUnoSequenceType< T >::value||std::is_base_of< css::uno::XInterface, T >::value), typename detail::Optional< T >::type >::type tryAccess(css::uno::Any const &any)
const GDIMetaFile & GetGDIMetaFile() const
PolyLine.
Definition: svdobj.hxx:127
virtual OUString SAL_CALL getShapeType() override
Definition: unoshap2.cxx:381
#define OWN_ATTR_VALUE_POLYPOLYGONBEZIER
Definition: unoshprp.hxx:80
constexpr TypedWhichId< SdrAngleItem > SDRATTR_ROTATEANGLE(SDRATTR_NOTPERSIST_FIRST+16)
virtual void SAL_CALL addTop(const css::uno::Reference< css::drawing::XShape > &xShape) override
Definition: unoshap2.cxx:273
virtual void SetChanged(bool bFlg=true)
Definition: svdmodel.cxx:1261
#define OWN_ATTR_SIGNATURELINE_IS_SIGNED
Definition: unoshprp.hxx:193
B2IRange fround(const B2DRange &rRange)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoshap2.cxx:1588
#define UNO_NAME_EDIT_CHAR_POSTURE
bool HasSdrObject() const
Definition: unoshape.hxx:211
SvxShapeDimensioning(SdrObject *pObj)
Definition: unoshap2.cxx:871
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertySimpleEntry *pProperty, css::uno::Any &rValue) override
Definition: unoshap2.cxx:1409
virtual void SAL_CALL addBottom(const css::uno::Reference< css::drawing::XShape > &xShape) override
Definition: unoshap2.cxx:281
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertySimpleEntry *pProperty, css::uno::Any &rValue) override
Definition: unoshape.cxx:3874
#define OWN_ATTR_SIGNATURELINE_ID
Definition: unoshprp.hxx:185
SvxShapeGroup(SdrObject *pObj, SvxDrawPage *pDrawPage)
Definition: unoshap2.cxx:81
virtual const SdrGluePointList * GetGluePointList() const
Definition: svdobj.cxx:2203
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
Definition: unoshap2.cxx:836
void checkClosed(B2DPolygon &rCandidate)
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unoshap2.cxx:103
int i
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: unoshap2.cxx:304
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
Definition: unoshape.cxx:1151
virtual css::awt::Size SAL_CALL getSize() override
Definition: unoshap2.cxx:398
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unoshap2.cxx:1601
#define QUERYINT(xint)
Definition: unoshap2.cxx:77
GraphicType GetType() const
bool IsWriter() const
Definition: svdmodel.hxx:576
virtual ~SvxShapeGroup() override
Definition: unoshap2.cxx:87
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertySimpleEntry *pProperty, const css::uno::Any &rValue) override
Definition: unoshap2.cxx:904
#define SVXMAP_CUSTOMSHAPE
Definition: unoprov.hxx:74
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1429
const Graphic & GetGraphic() const
Definition: svdograf.cxx:330
basegfx::B2DPolyPolygon GetPolygon() const
Definition: unoshap2.cxx:1150
rtl::Reference< SvxDrawPage > mxPage
Definition: unoshape.hxx:430
#define OWN_ATTR_IS_SIGNATURELINE
Definition: unoshprp.hxx:184
virtual css::awt::Size SAL_CALL getSize() override
Definition: unoshap2.cxx:143
virtual ~SvxGraphicObject() override
Definition: unoshap2.cxx:1171
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon)
Definition: svdobj.cxx:2914
B2DPolyPolygon UnoPolyPolygonBezierCoordsToB2DPolyPolygon(const css::drawing::PolyPolygonBezierCoords &rPolyPolygonBezierCoordsSource)
void ForceMetricTo100th_mm(Pair &rPoint) const
Definition: unoshape.cxx:509
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unoshap2.cxx:355
SvxGraphicObject(SdrObject *pObj)
Definition: unoshap2.cxx:1166
SvxShapeCaption(SdrObject *pObj)
Definition: unoshap2.cxx:1557
virtual void SAL_CALL setSize(const css::awt::Size &aSize) override
Definition: unoshape.cxx:1197
void MirrorPoint(Point &rPnt, const Point &rRef1, const Point &rRef2)
Definition: svdtrans.cxx:104
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
virtual void SetUnoControlModel(const css::uno::Reference< css::awt::XControlModel > &xModel)
Definition: svdouno.cxx:419
unsigned char sal_Bool
virtual ~SvxShapeCaption() override
Definition: unoshap2.cxx:1562
virtual void SAL_CALL setSize(const css::awt::Size &aSize) override
Definition: unoshap2.cxx:527
virtual void SAL_CALL disconnectBegin(const css::uno::Reference< css::drawing::XConnectableShape > &xShape) override
Definition: unoshap2.cxx:440
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:273
sal_uInt32 GetOrdNum() const
The order number (aka ZOrder, aka z-index) determines whether a SdrObject is located above or below a...
Definition: svdobj.cxx:796
#define SVXMAP_CONTROL
Definition: unoprov.hxx:72
virtual OUString SAL_CALL getShapeType() override
Definition: unoshap2.cxx:504
void addUnoShape(const css::uno::Reference< css::drawing::XShape > &xShape, size_t nPos)
Definition: unoshap2.cxx:170
sal_uInt16 GetSize() const
#define SVXMAP_CAPTION
Definition: unoprov.hxx:67
tools::Polygon Rect2Poly(const tools::Rectangle &rRect, const GeoStat &rGeo)
Definition: svdtrans.cxx:474
css::uno::Type const & get()
virtual ~SvxShapeConnector() override
Definition: unoshap2.cxx:345
#define OWN_ATTR_BASE_GEOMETRY
Definition: unoshprp.hxx:115
virtual SdrObject * NbcRemoveObject(size_t nObjNum)
remove from list without delete
Definition: svdpage.cxx:382
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unoshap2.cxx:386
This class represents an embedded or linked bitmap graphic object.
Definition: svdograf.hxx:79
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoshap2.cxx:368
Abstract DrawObject.
Definition: svdobj.hxx:312
static ErrCode Import(SvStream &rIStm, Graphic &rGraphic, ConvertDataFormat nFormat=ConvertDataFormat::Unknown)
virtual SdrObject * RemoveObject(size_t nObjNum)
Definition: svdpage.cxx:421
virtual void SAL_CALL enterGroup() override
Definition: unoshap2.cxx:157
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoshap2.cxx:1593
virtual void DisconnectFromNode(bool bTail1)
Definition: svdobj.cxx:2263
sal_uInt16 mnAPINameLen
Definition: unoshap2.cxx:563
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unoshap2.cxx:326
virtual void Create(SdrObject *pNewOpj, SvxDrawPage *pNewPage) override
Definition: unoshap2.cxx:91
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
Definition: unoshape.cxx:1970
virtual ~SvxShapeControl() override
Definition: unoshap2.cxx:468
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: unoshap2.cxx:813
SvxCustomShape(SdrObject *pObj)
Definition: unoshap2.cxx:1566
const char * mpAPIName
Definition: unoshap2.cxx:562
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshap2.cxx:98
void SetPolygon(const basegfx::B2DPolyPolygon &rNew)
Definition: unoshap2.cxx:1141
closed Bezier-curve
Definition: svdobj.hxx:129
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoshap2.cxx:118
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unoshape.cxx:3742
virtual ~SvxShapeCircle() override
Definition: unoshap2.cxx:885
sal_uInt32 count() const
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unoshape.cxx:1128
#define OWN_ATTR_GRAPHIC_URL
Definition: unoshprp.hxx:101
void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unoshap2.cxx:1683
const Graphic & GetGraphic() const
#define ERRCODE_NONE
#define OWN_ATTR_VALUE_FILLBITMAP
Definition: unoshprp.hxx:81
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
Definition: unoshap2.cxx:515
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unoshap2.cxx:701
virtual void SAL_CALL setControl(const css::uno::Reference< css::awt::XControlModel > &xControl) override
Definition: unoshap2.cxx:549
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshap2.cxx:350
virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getControl() override
Definition: unoshap2.cxx:535
virtual ~SvxShapePolyPolygon() override
Definition: unoshap2.cxx:900
SvxShapePolyPolygon(SdrObject *pObj)
Definition: unoshap2.cxx:891
#define SVXMAP_GROUP
Definition: unoprov.hxx:66
SdrObject * GetSdrObject() const
Definition: unoshape.hxx:210
const char * mpFormName
Definition: unoshap2.cxx:565
Sequence< sal_Int8 > aSeq
virtual void SAL_CALL remove(const css::uno::Reference< css::drawing::XShape > &xShape) override
Definition: unoshap2.cxx:223
virtual void SAL_CALL createCustomShapeDefaults(const OUString &rShapeType) override
Definition: unoshap2.cxx:1782
#define OWN_ATTR_GRAPHIC_STREAM
Definition: unoshprp.hxx:169
const Point & GetAnchorPos() const
Definition: svdobj.cxx:1588
SdrObject * getParentSdrObjectFromSdrObject() const
Definition: svdobj.cxx:652
#define SVXMAP_POLYPOLYGON
Definition: unoprov.hxx:57
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
Definition: unoshap2.cxx:392
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
Definition: svdouno.hxx:91
virtual void SAL_CALL setSize(const css::awt::Size &aSize) override
Definition: unoshap2.cxx:149
virtual sal_Int32 SAL_CALL getCount() override
Definition: unoshap2.cxx:292
#define OWN_ATTR_SIGNATURELINE_SUGGESTED_SIGNER_EMAIL
Definition: unoshprp.hxx:188
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertySimpleEntry *pProperty, css::uno::Any &rValue) override
Definition: unoshap2.cxx:1766
void B2DPolyPolygonToUnoPolyPolygonBezierCoords(const B2DPolyPolygon &rPolyPolygon, css::drawing::PolyPolygonBezierCoords &rPolyPolygonBezierCoordsRetval)
#define SAL_WARN(area, stream)
Reference< XModel > xModel
SvxShapeConnector(SdrObject *pObj)
Definition: unoshap2.cxx:339
SvxShapeControl(SdrObject *pObj)
Definition: unoshap2.cxx:461
#define OWN_ATTR_SIGNATURELINE_SUGGESTED_SIGNER_TITLE
Definition: unoshprp.hxx:187
tools::Rectangle GetBoundRect() const
css::uno::Reference< css::drawing::XCustomShapeEngine > mxCustomShapeEngine
Definition: svdoashp.hxx:94
virtual OUString SAL_CALL getShapeType() override
Definition: unoshape.cxx:1278
SdrObjList * getParentSdrObjListFromSdrObject() const
Definition: svdobj.cxx:299
void SetBuffer(void *pBuf, std::size_t nSize, std::size_t nEOF)
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoshap2.cxx:373
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const
Definition: svdobj.cxx:2887
bool areControlPointsUsed() const
SvxUnoPropertyMapProvider & getSvxMapProvider()
Definition: unoprov.cxx:888
#define OWN_ATTR_VALUE_POLYPOLYGON
Definition: unoshprp.hxx:79
virtual void SAL_CALL leaveGroup() override
Definition: unoshap2.cxx:164
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unoshape.cxx:1711
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
Definition: unoshap2.cxx:137
void setShapeKind(sal_uInt32 nKind)
Definition: unoshape.cxx:251
SdrView * FirstView()
Definition: svdviter.cxx:158
struct _ADOIndex Index
virtual css::awt::Size SAL_CALL getSize() override
Definition: unoshap2.cxx:521
Reference< XGraphic > xGraphic
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertySimpleEntry *pProperty, css::uno::Any &rValue) override
Definition: unoshap2.cxx:1016
open Bezier-curve
Definition: svdobj.hxx:128
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
closed free-hand line
Definition: svdobj.hxx:131
#define SVXMAP_DIMENSIONING
Definition: unoprov.hxx:55
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoshap2.cxx:491
sal_Int16 nValue
Definition: fmsrccfg.cxx:81
const void * GetData()
sal_uInt32 count() const
#define OWN_ATTR_SIGNATURELINE_SIGNING_INSTRUCTIONS
Definition: unoshprp.hxx:189
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unoshap2.cxx:478