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