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