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