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 aIter( pSdrShape );
264
265 for ( SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView() )
266 {
267 if(SAL_MAX_SIZE != pView->TryToFindMarkedObject(pSdrShape))
268 {
269 pView->MarkObj(pSdrShape, pView->GetSdrPageView(), true);
270 }
271 }
272
273 rList.NbcRemoveObject( nObjNum );
274 }
275 else
276 {
277 SAL_WARN( "svx", "Fatality! SdrObject is not belonging to its SdrObjList! [CL]" );
278 }
279
281}
282
283void SAL_CALL SvxShapeGroup::addTop( const uno::Reference< drawing::XShape >& xShape )
284{
285 SolarMutexGuard aGuard;
286
287 // Add to the top of the stack (i.e. bottom of the list).
288 addUnoShape(xShape, SAL_MAX_SIZE);
289}
290
291void SAL_CALL SvxShapeGroup::addBottom( const uno::Reference< drawing::XShape >& xShape )
292{
293 SolarMutexGuard aGuard;
294
295 // Add to the bottom of the stack (i.e. top of the list).
296 addUnoShape(xShape, 0);
297}
298
299// XIndexAccess
300
301
302sal_Int32 SAL_CALL SvxShapeGroup::getCount()
303{
304 ::SolarMutexGuard aGuard;
305
306 if(!HasSdrObject() || !GetSdrObject()->GetSubList())
307 throw uno::RuntimeException();
308
309 sal_Int32 nRetval = GetSdrObject()->GetSubList()->GetObjCount();
310 return nRetval;
311}
312
313
315{
316 ::SolarMutexGuard aGuard;
317
318 if( !HasSdrObject() || GetSdrObject()->GetSubList() == nullptr )
319 throw uno::RuntimeException();
320
321 if( Index<0 || GetSdrObject()->GetSubList()->GetObjCount() <= o3tl::make_unsigned(Index) )
322 throw lang::IndexOutOfBoundsException();
323
324 SdrObject* pDestObj = GetSdrObject()->GetSubList()->GetObj( Index );
325
326 if(pDestObj == nullptr)
327 throw lang::IndexOutOfBoundsException();
328
329 Reference< drawing::XShape > xShape( pDestObj->getUnoShape(), uno::UNO_QUERY );
330 return uno::Any( xShape );
331}
332
333// css::container::XElementAccess
334
335
337{
339}
340
341
343{
344 ::SolarMutexGuard aGuard;
345
346 return HasSdrObject() && GetSdrObject()->GetSubList() && (GetSdrObject()->GetSubList()->GetObjCount() > 0);
347}
348
350 : SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_CONNECTOR), getSvxMapProvider().GetPropertySet(SVXMAP_CONNECTOR, SdrObject::GetGlobalDrawObjectItemPool()) )
351{
352}
353
354
356{
357}
358
359
361{
362 return SvxShapeText::queryInterface( rType );
363}
364
366{
367 uno::Any aAny;
368
369 QUERYINT( drawing::XConnectorShape );
370 else
371 return SvxShapeText::queryAggregation( rType );
372
373 return aAny;
374}
375
376// XTypeProvider
377
378uno::Sequence< uno::Type > SAL_CALL SvxShapeConnector::getTypes()
379{
380 return SvxShape::getTypes();
381}
382
383uno::Sequence< sal_Int8 > SAL_CALL SvxShapeConnector::getImplementationId()
384{
385 return css::uno::Sequence<sal_Int8>();
386}
387
388// css::drawing::XShape
389
390
392{
394}
395
397{
399}
400
401
402void SAL_CALL SvxShapeConnector::setPosition( const awt::Point& Position )
403{
405}
406
407
408awt::Size SAL_CALL SvxShapeConnector::getSize()
409{
410 return SvxShapeText::getSize();
411}
412
413
414void SAL_CALL SvxShapeConnector::setSize( const awt::Size& rSize )
415{
416 SvxShapeText::setSize( rSize );
417}
418
419
420// XConnectorShape
421
422void SAL_CALL SvxShapeConnector::connectStart( const uno::Reference< drawing::XConnectableShape >& xShape, drawing::ConnectionType )
423{
424 ::SolarMutexGuard aGuard;
425
426 Reference< drawing::XShape > xRef( xShape, UNO_QUERY );
427 SdrObject* pSdrObject = SdrObject::getSdrObjectFromXShape( xRef );
428
429 if( pSdrObject )
430 GetSdrObject()->ConnectToNode( true, pSdrObject );
431
433}
434
435
436void SAL_CALL SvxShapeConnector::connectEnd( const uno::Reference< drawing::XConnectableShape >& xShape, drawing::ConnectionType )
437{
438 ::SolarMutexGuard aGuard;
439
440 Reference< drawing::XShape > xRef( xShape, UNO_QUERY );
441 SdrObject* pSdrObject = SdrObject::getSdrObjectFromXShape( xRef );
442
443 if( HasSdrObject() && pSdrObject )
444 GetSdrObject()->ConnectToNode( false, pSdrObject );
445
447}
448
449
450void SAL_CALL SvxShapeConnector::disconnectBegin( const uno::Reference< drawing::XConnectableShape >& )
451{
452 ::SolarMutexGuard aGuard;
453
454 if(HasSdrObject())
456
458}
459
460
461void SAL_CALL SvxShapeConnector::disconnectEnd( const uno::Reference< drawing::XConnectableShape >& )
462{
463 ::SolarMutexGuard aGuard;
464
465 if(HasSdrObject())
467
469}
470
472 : SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_CONTROL), getSvxMapProvider().GetPropertySet(SVXMAP_CONTROL, SdrObject::GetGlobalDrawObjectItemPool()) )
473{
475}
476
477
479{
480}
481
482
484{
485 return SvxShapeText::queryInterface( rType );
486}
487
489{
490 uno::Any aAny;
491
492 QUERYINT( drawing::XControlShape );
493 else
494 return SvxShapeText::queryAggregation( rType );
495
496 return aAny;
497}
498
499// XTypeProvider
500
501uno::Sequence< uno::Type > SAL_CALL SvxShapeControl::getTypes()
502{
503 return SvxShape::getTypes();
504}
505
506uno::Sequence< sal_Int8 > SAL_CALL SvxShapeControl::getImplementationId()
507{
508 return css::uno::Sequence<sal_Int8>();
509}
510
511// css::drawing::XShape
512
513
515{
517}
518
519awt::Point SAL_CALL SvxShapeControl::getPosition()
520{
522}
523
524
525void SAL_CALL SvxShapeControl::setPosition( const awt::Point& Position )
526{
528}
529
530
531awt::Size SAL_CALL SvxShapeControl::getSize()
532{
533 return SvxShapeText::getSize();
534}
535
536
537void SAL_CALL SvxShapeControl::setSize( const awt::Size& rSize )
538{
539 SvxShapeText::setSize( rSize );
540}
541
542
543// XControlShape
544
545Reference< awt::XControlModel > SAL_CALL SvxShapeControl::getControl()
546{
547 ::SolarMutexGuard aGuard;
548
549 Reference< awt::XControlModel > xModel;
550
551 SdrUnoObj* pUnoObj = dynamic_cast< SdrUnoObj * >(GetSdrObject());
552 if( pUnoObj )
553 xModel = pUnoObj->GetUnoControlModel();
554
555 return xModel;
556}
557
558
559void SAL_CALL SvxShapeControl::setControl( const Reference< awt::XControlModel >& xControl )
560{
561 ::SolarMutexGuard aGuard;
562
563 SdrUnoObj* pUnoObj = dynamic_cast< SdrUnoObj * >(GetSdrObject());
564 if( pUnoObj )
565 pUnoObj->SetUnoControlModel( xControl );
566
568}
569
570struct
571{
572 OUString msAPIName;
573 OUString msFormName;
574}
576{
577 // Warning: The first entry must be FontSlant because the any needs to be converted
578 { UNO_NAME_EDIT_CHAR_POSTURE, "FontSlant" }, // const sal_Int16 => css::awt::FontSlant
579 { UNO_NAME_EDIT_CHAR_FONTNAME, "FontName" },
580 { UNO_NAME_EDIT_CHAR_FONTSTYLENAME, "FontStyleName" },
581 { UNO_NAME_EDIT_CHAR_FONTFAMILY, "FontFamily" },
582 { UNO_NAME_EDIT_CHAR_FONTCHARSET, "FontCharset" },
583 { UNO_NAME_EDIT_CHAR_HEIGHT, "FontHeight" },
584 { UNO_NAME_EDIT_CHAR_FONTPITCH, "FontPitch" },
585 { UNO_NAME_EDIT_CHAR_WEIGHT, "FontWeight" },
586 { UNO_NAME_EDIT_CHAR_UNDERLINE, "FontUnderline" },
587 { UNO_NAME_EDIT_CHAR_STRIKEOUT, "FontStrikeout" },
588 { "CharKerning", "FontKerning" },
589 { "CharWordMode", "FontWordLineMode" },
590 { UNO_NAME_EDIT_CHAR_COLOR, "TextColor" },
591 { "CharBackColor", "CharBackColor" },
592 { "CharBackTransparent", "CharBackTransparent" },
594 { "CharRelief", "FontRelief" },
595 { "CharUnderlineColor", "TextLineColor" },
596 { UNO_NAME_EDIT_PARA_ADJUST, "Align" },
597 { "TextVerticalAdjust", "VerticalAlign" },
598 { "ControlBackground", "BackgroundColor" },
599 { "ControlSymbolColor", "SymbolColor" },
600 { "ControlBorder", "Border" },
601 { "ControlBorderColor", "BorderColor" },
602 { "ControlTextEmphasis", "FontEmphasisMark" },
603 { "ImageScaleMode", "ScaleMode" },
604 { "ControlWritingMode", "WritingMode" },
605 //added for exporting OCX control
606 { "ControlTypeinMSO", "ControlTypeinMSO" },
607 { "ObjIDinMSO", "ObjIDinMSO" },
608 { "CharCaseMap", "CharCaseMap" },
609 { "CharColorTheme", "CharColorTheme" },
610 { "CharColorTintOrShade", "CharColorTintOrShade" },
611 { UNO_NAME_EDIT_CHAR_COMPLEX_COLOR, "CharComplexColor" },
613
614namespace
615{
616 bool lcl_convertPropertyName( std::u16string_view rApiName, OUString& rInternalName )
617 {
618 for( const auto & rEntry : SvxShapeControlPropertyMapping )
619 {
620 if( rApiName == rEntry.msAPIName )
621 {
622 rInternalName = rEntry.msFormName;
623 }
624 }
625 return !rInternalName.isEmpty();
626 }
627
628 struct EnumConversionMap
629 {
630 style::ParagraphAdjust nAPIValue;
631 sal_Int16 nFormValue;
632 };
633
634 EnumConversionMap const aMapAdjustToAlign[] =
635 {
636 // note that order matters:
637 // lcl_convertTextAlignmentToParaAdjustment and lcl_convertParaAdjustmentToTextAlignment search this map from the _beginning_
638 // and use the first matching entry
639 {style::ParagraphAdjust_LEFT, sal_Int16(awt::TextAlign::LEFT)},
640 {style::ParagraphAdjust_CENTER, sal_Int16(awt::TextAlign::CENTER)},
641 {style::ParagraphAdjust_RIGHT, sal_Int16(awt::TextAlign::RIGHT)},
642 {style::ParagraphAdjust_BLOCK, sal_Int16(awt::TextAlign::RIGHT)},
643 {style::ParagraphAdjust_STRETCH, sal_Int16(awt::TextAlign::LEFT)},
644 {style::ParagraphAdjust(-1),-1}
645 };
646
647 void lcl_convertTextAlignmentToParaAdjustment( Any& _rValue )
648 {
649 sal_Int16 nValue = sal_Int16();
650 OSL_VERIFY( _rValue >>= nValue );
651
652 for ( auto const & rEntry : aMapAdjustToAlign )
653 if ( nValue == rEntry.nFormValue )
654 {
655 _rValue <<= static_cast<sal_uInt16>(rEntry.nAPIValue);
656 return;
657 }
658 }
659
660 void lcl_convertParaAdjustmentToTextAlignment( Any& _rValue )
661 {
662 sal_Int32 nValue = 0;
663 OSL_VERIFY( _rValue >>= nValue );
664
665 for ( auto const & rEntry : aMapAdjustToAlign )
666 if ( static_cast<style::ParagraphAdjust>(nValue) == rEntry.nAPIValue )
667 {
668 _rValue <<= rEntry.nFormValue;
669 return;
670 }
671 }
672
673 void convertVerticalAdjustToVerticalAlign( Any& _rValue )
674 {
675 if ( !_rValue.hasValue() )
676 return;
677
678 drawing::TextVerticalAdjust eAdjust = drawing::TextVerticalAdjust_TOP;
679 style::VerticalAlignment eAlign = style::VerticalAlignment_TOP;
680 if ( !( _rValue >>= eAdjust ) )
681 throw lang::IllegalArgumentException();
682 switch ( eAdjust )
683 {
684 case drawing::TextVerticalAdjust_TOP: eAlign = style::VerticalAlignment_TOP; break;
685 case drawing::TextVerticalAdjust_BOTTOM: eAlign = style::VerticalAlignment_BOTTOM; break;
686 default: eAlign = style::VerticalAlignment_MIDDLE; break;
687 }
688 _rValue <<= eAlign;
689 }
690
691 void convertVerticalAlignToVerticalAdjust( Any& _rValue )
692 {
693 if ( !_rValue.hasValue() )
694 return;
695 style::VerticalAlignment eAlign = style::VerticalAlignment_TOP;
696 drawing::TextVerticalAdjust eAdjust = drawing::TextVerticalAdjust_TOP;
697 OSL_VERIFY( _rValue >>= eAlign );
698 switch ( eAlign )
699 {
700 case style::VerticalAlignment_TOP: eAdjust = drawing::TextVerticalAdjust_TOP; break;
701 case style::VerticalAlignment_BOTTOM: eAdjust = drawing::TextVerticalAdjust_BOTTOM; break;
702 default: eAdjust = drawing::TextVerticalAdjust_CENTER; break;
703 }
704 _rValue <<= eAdjust;
705 }
706}
707
708void SAL_CALL SvxShapeControl::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
709{
710 OUString aFormsName;
711 if ( lcl_convertPropertyName( aPropertyName, aFormsName ) )
712 {
713 uno::Reference< beans::XPropertySet > xControl( getControl(), uno::UNO_QUERY );
714 if( xControl.is() )
715 {
716 uno::Reference< beans::XPropertySetInfo > xInfo( xControl->getPropertySetInfo() );
717 if( xInfo.is() && xInfo->hasPropertyByName( aFormsName ) )
718 {
719 uno::Any aConvertedValue( aValue );
720 if ( aFormsName == "FontSlant" )
721 {
722 awt::FontSlant nSlant;
723 if( !(aValue >>= nSlant ) )
724 throw lang::IllegalArgumentException();
725 aConvertedValue <<= static_cast<sal_Int16>(nSlant);
726 }
727 else if ( aFormsName == "Align" )
728 {
729 lcl_convertParaAdjustmentToTextAlignment( aConvertedValue );
730 }
731 else if ( aFormsName == "VerticalAlign" )
732 {
733 convertVerticalAdjustToVerticalAlign( aConvertedValue );
734 }
735
736 xControl->setPropertyValue( aFormsName, aConvertedValue );
737 }
738 }
739 }
740 else
741 {
742 SvxShape::setPropertyValue( aPropertyName, aValue );
743 }
744}
745
746uno::Any SAL_CALL SvxShapeControl::getPropertyValue( const OUString& aPropertyName )
747{
748 OUString aFormsName;
749 if ( lcl_convertPropertyName( aPropertyName, aFormsName ) )
750 {
751 uno::Reference< beans::XPropertySet > xControl( getControl(), uno::UNO_QUERY );
752
753 uno::Any aValue;
754 if( xControl.is() )
755 {
756 uno::Reference< beans::XPropertySetInfo > xInfo( xControl->getPropertySetInfo() );
757 if( xInfo.is() && xInfo->hasPropertyByName( aFormsName ) )
758 {
759 aValue = xControl->getPropertyValue( aFormsName );
760 if ( aFormsName == "FontSlant" )
761 {
762 awt::FontSlant eSlant = awt::FontSlant_NONE;
763 sal_Int16 nSlant = sal_Int16();
764 if ( aValue >>= nSlant )
765 {
766 eSlant = static_cast<awt::FontSlant>(nSlant);
767 }
768 else
769 {
770 OSL_VERIFY( aValue >>= eSlant );
771 }
772 aValue <<= eSlant;
773 }
774 else if ( aFormsName == "Align" )
775 {
776 lcl_convertTextAlignmentToParaAdjustment( aValue );
777 }
778 else if ( aFormsName == "VerticalAlign" )
779 {
780 convertVerticalAlignToVerticalAdjust( aValue );
781 }
782 }
783 }
784
785 return aValue;
786 }
787 else
788 {
789 return SvxShape::getPropertyValue( aPropertyName );
790 }
791
792}
793
794// XPropertyState
795beans::PropertyState SAL_CALL SvxShapeControl::getPropertyState( const OUString& PropertyName )
796{
797 OUString aFormsName;
798 if ( lcl_convertPropertyName( PropertyName, aFormsName ) )
799 {
800 uno::Reference< beans::XPropertyState > xControl( getControl(), uno::UNO_QUERY );
801 uno::Reference< beans::XPropertySet > xPropSet( getControl(), uno::UNO_QUERY );
802
803 if( xControl.is() && xPropSet.is() )
804 {
805 uno::Reference< beans::XPropertySetInfo > xInfo( xPropSet->getPropertySetInfo() );
806 if( xInfo.is() && xInfo->hasPropertyByName( aFormsName ) )
807 {
808 return xControl->getPropertyState( aFormsName );
809 }
810 }
811
812 return beans::PropertyState_DEFAULT_VALUE;
813 }
814 else
815 {
816 return SvxShape::getPropertyState( PropertyName );
817 }
818}
819
820void SAL_CALL SvxShapeControl::setPropertyToDefault( const OUString& PropertyName )
821{
822 OUString aFormsName;
823 if ( lcl_convertPropertyName( PropertyName, aFormsName ) )
824 {
825 uno::Reference< beans::XPropertyState > xControl( getControl(), uno::UNO_QUERY );
826 uno::Reference< beans::XPropertySet > xPropSet( getControl(), uno::UNO_QUERY );
827
828 if( xControl.is() && xPropSet.is() )
829 {
830 uno::Reference< beans::XPropertySetInfo > xInfo( xPropSet->getPropertySetInfo() );
831 if( xInfo.is() && xInfo->hasPropertyByName( aFormsName ) )
832 {
833 xControl->setPropertyToDefault( aFormsName );
834 }
835 }
836 }
837 else
838 {
839 SvxShape::setPropertyToDefault( PropertyName );
840 }
841}
842
843uno::Any SAL_CALL SvxShapeControl::getPropertyDefault( const OUString& aPropertyName )
844{
845 OUString aFormsName;
846 if ( lcl_convertPropertyName( aPropertyName, aFormsName ) )
847 {
848 uno::Reference< beans::XPropertyState > xControl( getControl(), uno::UNO_QUERY );
849
850 if( xControl.is() )
851 {
852 Any aDefault( xControl->getPropertyDefault( aFormsName ) );
853 if ( aFormsName == "FontSlant" )
854 {
855 sal_Int16 nSlant( 0 );
856 aDefault >>= nSlant;
857 aDefault <<= static_cast<awt::FontSlant>(nSlant);
858 }
859 else if ( aFormsName == "Align" )
860 {
861 lcl_convertTextAlignmentToParaAdjustment( aDefault );
862 }
863 else if ( aFormsName == "VerticalAlign" )
864 {
865 convertVerticalAlignToVerticalAdjust( aDefault );
866 }
867 return aDefault;
868 }
869
870 throw beans::UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(this));
871 }
872 else
873 {
874 return SvxShape::getPropertyDefault( aPropertyName );
875 }
876}
877
879 : SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_DIMENSIONING), getSvxMapProvider().GetPropertySet(SVXMAP_DIMENSIONING, SdrObject::GetGlobalDrawObjectItemPool()) )
880{
881}
882
884{
885}
886
888 : SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_CIRCLE), getSvxMapProvider().GetPropertySet(SVXMAP_CIRCLE, SdrObject::GetGlobalDrawObjectItemPool()) )
889{
890}
891
893{
894}
895
897
899 SdrObject* pObj)
901 pObj,
903 getSvxMapProvider().GetPropertySet(SVXMAP_POLYPOLYGON, SdrObject::GetGlobalDrawObjectItemPool()))
904{
905}
906
908{
909}
910
911bool SvxShapePolyPolygon::setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue )
912{
913 switch( pProperty->nWID )
914 {
916 {
917 if( auto s = o3tl::tryAccess<drawing::PolyPolygonBezierCoords>(rValue) )
918 {
919 basegfx::B2DPolyPolygon aNewPolyPolygon(
921
922 // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
923 ForceMetricToItemPoolMetric(aNewPolyPolygon);
924
925 SetPolygon(aNewPolyPolygon);
926 return true;
927 }
928 break;
929 }
931 {
932 if( auto s = o3tl::tryAccess<drawing::PointSequenceSequence>(rValue) )
933 {
934 basegfx::B2DPolyPolygon aNewPolyPolygon(
936
937 // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
938 ForceMetricToItemPoolMetric(aNewPolyPolygon);
939
940 SetPolygon(aNewPolyPolygon);
941 return true;
942 }
943 break;
944 }
946 {
947 drawing::PointSequenceSequence aPointSequenceSequence;
948 drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords;
949
950 if( rValue >>= aPointSequenceSequence)
951 {
952 if( HasSdrObject() )
953 {
954 basegfx::B2DPolyPolygon aNewPolyPolygon;
955 basegfx::B2DHomMatrix aNewHomogenMatrix;
956
957 GetSdrObject()->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
958 aNewPolyPolygon = basegfx::utils::UnoPointSequenceSequenceToB2DPolyPolygon(aPointSequenceSequence);
959
960 // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
961 // Need to adapt aNewPolyPolygon from 100thmm to app-specific
962 ForceMetricToItemPoolMetric(aNewPolyPolygon);
963
964 GetSdrObject()->TRSetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
965 }
966 return true;
967 }
968 else if( rValue >>= aPolyPolygonBezierCoords)
969 {
970 if( HasSdrObject() )
971 {
972 basegfx::B2DPolyPolygon aNewPolyPolygon;
973 basegfx::B2DHomMatrix aNewHomogenMatrix;
974
975 GetSdrObject()->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
976 aNewPolyPolygon = basegfx::utils::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(aPolyPolygonBezierCoords);
977
978 // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
979 ForceMetricToItemPoolMetric(aNewPolyPolygon);
980
981 GetSdrObject()->TRSetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
982 }
983 return true;
984 }
985 break;
986 }
988 {
989 if( auto pSequence = o3tl::tryAccess<drawing::PointSequence>(rValue) )
990 {
991 // prepare new polygon
992 basegfx::B2DPolygon aNewPolygon;
993
994 // get pointer to arrays
995 const awt::Point* pArray = pSequence->getConstArray();
996 const awt::Point* pArrayEnd = pArray + pSequence->getLength();
997
998 for(;pArray != pArrayEnd;++pArray)
999 {
1000 aNewPolygon.append(basegfx::B2DPoint(pArray->X, pArray->Y));
1001 }
1002
1003 // check for closed state flag
1004 basegfx::utils::checkClosed(aNewPolygon);
1005
1006 // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
1007 basegfx::B2DPolyPolygon aNewPolyPolygon(aNewPolygon);
1008 ForceMetricToItemPoolMetric(aNewPolyPolygon);
1009
1010 // set polygon
1011 SetPolygon(aNewPolyPolygon);
1012 return true;
1013 }
1014 break;
1015 }
1016 default:
1017 return SvxShapeText::setPropertyValueImpl( rName, pProperty, rValue );
1018 }
1019
1020 throw lang::IllegalArgumentException();
1021}
1022
1023bool SvxShapePolyPolygon::getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty,
1024 css::uno::Any& rValue )
1025{
1026 switch( pProperty->nWID )
1027 {
1029 {
1030 // pack a tools::PolyPolygon in a struct tools::PolyPolygon
1032
1033 // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
1034 ForceMetricTo100th_mm(aPolyPoly);
1035
1036 drawing::PolyPolygonBezierCoords aRetval;
1038
1039 rValue <<= aRetval;
1040 break;
1041 }
1043 {
1044 // pack a tools::PolyPolygon in a struct tools::PolyPolygon
1046
1047 // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
1048 ForceMetricTo100th_mm(aPolyPoly);
1049
1050 drawing::PointSequenceSequence aRetval( aPolyPoly.count() );
1052
1053 rValue <<= aRetval;
1054 break;
1055 }
1057 {
1058 // pack a tools::PolyPolygon in struct PolyPolygon
1059 basegfx::B2DPolyPolygon aPolyPoly;
1060 basegfx::B2DHomMatrix aNewHomogenMatrix;
1061
1062 if(HasSdrObject())
1063 {
1064 GetSdrObject()->TRGetBaseGeometry(aNewHomogenMatrix, aPolyPoly);
1065
1066 // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
1067 ForceMetricTo100th_mm(aPolyPoly);
1068 }
1069
1070 if(aPolyPoly.areControlPointsUsed())
1071 {
1072 drawing::PolyPolygonBezierCoords aRetval;
1074 rValue <<= aRetval;
1075 }
1076 else
1077 {
1078 drawing::PointSequenceSequence aRetval(aPolyPoly.count());
1080 rValue <<= aRetval;
1081 }
1082 break;
1083 }
1085 {
1086 // pack a tools::PolyPolygon in a struct tools::PolyPolygon
1088
1089 // tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
1090 ForceMetricTo100th_mm(aPolyPoly);
1091
1092 const sal_Int32 nCount(0 == aPolyPoly.count() ? 0 : aPolyPoly.getB2DPolygon(0).count());
1093 drawing::PointSequence aRetval( nCount );
1094
1095 if( nCount > 0 )
1096 {
1097 // get single polygon
1098 const basegfx::B2DPolygon& aPoly(aPolyPoly.getB2DPolygon(0));
1099
1100 // get pointer to arrays
1101 awt::Point* pSequence = aRetval.getArray();
1102
1103 for(sal_Int32 b=0;b<nCount;b++)
1104 {
1105 const basegfx::B2DPoint aPoint(aPoly.getB2DPoint(b));
1106 *pSequence++ = awt::Point( basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY()) );
1107 }
1108 }
1109
1110 rValue <<= aRetval;
1111 break;
1112 }
1114 {
1115 rValue <<= GetPolygonKind();
1116 break;
1117 }
1118 default:
1119 return SvxShapeText::getPropertyValueImpl( rName, pProperty, rValue );
1120 }
1121
1122 return true;
1123}
1124
1125drawing::PolygonKind SvxShapePolyPolygon::GetPolygonKind() const
1126{
1127 ::SolarMutexGuard aGuard;
1128 drawing::PolygonKind aRetval(drawing::PolygonKind_LINE);
1129
1130 if(HasSdrObject())
1131 {
1132 switch(GetSdrObject()->GetObjIdentifier())
1133 {
1134 case SdrObjKind::Polygon: aRetval = drawing::PolygonKind_POLY; break;
1135 case SdrObjKind::PolyLine: aRetval = drawing::PolygonKind_PLIN; break;
1136 case SdrObjKind::PathLine: aRetval = drawing::PolygonKind_PATHLINE; break;
1137 case SdrObjKind::PathFill: aRetval = drawing::PolygonKind_PATHFILL; break;
1138 case SdrObjKind::FreehandLine: aRetval = drawing::PolygonKind_FREELINE; break;
1139 case SdrObjKind::FreehandFill: aRetval = drawing::PolygonKind_FREEFILL; break;
1140 default: break;
1141 }
1142 }
1143
1144 return aRetval;
1145}
1146
1148{
1149 ::SolarMutexGuard aGuard;
1150
1151 if(HasSdrObject())
1152 static_cast<SdrPathObj*>(GetSdrObject())->SetPathPoly(rNew);
1153}
1154
1155
1157{
1158 ::SolarMutexGuard aGuard;
1159
1160 if(HasSdrObject())
1161 {
1162 return static_cast<SdrPathObj*>(GetSdrObject())->GetPathPoly();
1163 }
1164 else
1165 {
1166 return basegfx::B2DPolyPolygon();
1167 }
1168}
1169
1171
1173 : SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_GRAPHICOBJECT), getSvxMapProvider().GetPropertySet(SVXMAP_GRAPHICOBJECT, SdrObject::GetGlobalDrawObjectItemPool()) )
1174{
1175}
1176
1178{
1179}
1180
1181bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue )
1182{
1183 bool bOk = false;
1184 switch( pProperty->nWID )
1185 {
1187 {
1188 if( auto pSeq = o3tl::tryAccess<uno::Sequence<sal_Int8>>(rValue) )
1189 {
1190 SvMemoryStream aMemStm;
1191 Graphic aGraphic;
1192
1193 aMemStm.SetBuffer( const_cast<css::uno::Sequence<sal_Int8> *>(pSeq)->getArray(), pSeq->getLength(), pSeq->getLength() );
1194
1195 if( GraphicConverter::Import( aMemStm, aGraphic ) == ERRCODE_NONE )
1196 {
1197 static_cast<SdrGrafObj*>(GetSdrObject())->SetGraphic(aGraphic);
1198 bOk = true;
1199 }
1200 }
1201 else if (rValue.getValueType() == cppu::UnoType<graphic::XGraphic>::get())
1202 {
1203 auto xGraphic = rValue.get<uno::Reference<graphic::XGraphic>>();
1204 if (xGraphic.is())
1205 {
1206 static_cast<SdrGrafObj*>(GetSdrObject())->SetGraphic(Graphic(xGraphic));
1207 bOk = true;
1208 }
1209 }
1210 else if (rValue.getValueType() == cppu::UnoType<awt::XBitmap>::get())
1211 {
1212 auto xBitmap = rValue.get<uno::Reference<awt::XBitmap>>();
1213 if (xBitmap.is())
1214 {
1215 uno::Reference<graphic::XGraphic> xGraphic(xBitmap, uno::UNO_QUERY);
1216 Graphic aGraphic(xGraphic);
1217 static_cast<SdrGrafObj*>(GetSdrObject())->SetGraphic(aGraphic);
1218 bOk = true;
1219 }
1220 }
1221 break;
1222 }
1223
1225 {
1226 OUString aStreamURL;
1227
1228 if( rValue >>= aStreamURL )
1229 {
1230 if( !aStreamURL.startsWith( UNO_NAME_GRAPHOBJ_URLPKGPREFIX ) )
1231 aStreamURL.clear();
1232
1233 if( HasSdrObject() )
1234 {
1235 static_cast<SdrGrafObj*>(GetSdrObject())->SetGrafStreamURL( aStreamURL );
1236 }
1237 bOk = true;
1238 }
1239 break;
1240 }
1241
1243 {
1244 OUString aURL;
1245 uno::Reference<awt::XBitmap> xBitmap;
1246 if (rValue >>= aURL)
1247 {
1249 if (!aGraphic.IsNone())
1250 {
1251 static_cast<SdrGrafObj*>(GetSdrObject())->SetGraphic(aGraphic);
1252 bOk = true;
1253 }
1254 }
1255 else if (rValue >>= xBitmap)
1256 {
1257 uno::Reference<graphic::XGraphic> xGraphic(xBitmap, uno::UNO_QUERY);
1258 if (xGraphic.is())
1259 {
1260 Graphic aGraphic = xGraphic;
1261 if (!aGraphic.IsNone())
1262 {
1263 static_cast<SdrGrafObj*>(GetSdrObject())->SetGraphic(aGraphic);
1264 bOk = true;
1265 }
1266 }
1267 }
1268 break;
1269 }
1270
1272 {
1273 Reference< graphic::XGraphic > xGraphic( rValue, uno::UNO_QUERY );
1274 if( xGraphic.is() )
1275 {
1276 static_cast< SdrGrafObj*>( GetSdrObject() )->SetGraphic( xGraphic );
1277 bOk = true;
1278 }
1279 break;
1280 }
1281
1283 {
1284 bool bIsSignatureLine;
1285 if (rValue >>= bIsSignatureLine)
1286 {
1287 static_cast<SdrGrafObj*>(GetSdrObject())->setIsSignatureLine(bIsSignatureLine);
1288 bOk = true;
1289 }
1290 break;
1291 }
1292
1294 {
1295 OUString aSignatureLineId;
1296 if (rValue >>= aSignatureLineId)
1297 {
1298 static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineId(aSignatureLineId);
1299 bOk = true;
1300 }
1301 break;
1302 }
1303
1305 {
1306 OUString aSuggestedSignerName;
1307 if (rValue >>= aSuggestedSignerName)
1308 {
1309 static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineSuggestedSignerName(aSuggestedSignerName);
1310 bOk = true;
1311 }
1312 break;
1313 }
1314
1316 {
1317 OUString aSuggestedSignerTitle;
1318 if (rValue >>= aSuggestedSignerTitle)
1319 {
1320 static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineSuggestedSignerTitle(aSuggestedSignerTitle);
1321 bOk = true;
1322 }
1323 break;
1324 }
1325
1327 {
1328 OUString aSuggestedSignerEmail;
1329 if (rValue >>= aSuggestedSignerEmail)
1330 {
1331 static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineSuggestedSignerEmail(aSuggestedSignerEmail);
1332 bOk = true;
1333 }
1334 break;
1335 }
1336
1338 {
1339 OUString aSigningInstructions;
1340 if (rValue >>= aSigningInstructions)
1341 {
1342 static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineSigningInstructions(aSigningInstructions);
1343 bOk = true;
1344 }
1345 break;
1346 }
1347
1349 {
1350 bool bShowSignDate;
1351 if (rValue >>= bShowSignDate)
1352 {
1353 static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineShowSignDate(bShowSignDate);
1354 bOk = true;
1355 }
1356 break;
1357 }
1358
1360 {
1361 bool bCanAddComment;
1362 if (rValue >>= bCanAddComment)
1363 {
1364 static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineCanAddComment(bCanAddComment);
1365 bOk = true;
1366 }
1367 break;
1368 }
1369
1371 {
1372 Reference<graphic::XGraphic> xGraphic(rValue, uno::UNO_QUERY);
1373 if (xGraphic.is())
1374 {
1375 static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineUnsignedGraphic(xGraphic);
1376 bOk = true;
1377 }
1378 break;
1379 }
1380
1382 {
1383 bool bIsSigned;
1384 if (rValue >>= bIsSigned)
1385 {
1386 static_cast<SdrGrafObj*>(GetSdrObject())->setSignatureLineIsSigned(bIsSigned);
1387 bOk = true;
1388 }
1389 break;
1390 }
1391
1392 case OWN_ATTR_QRCODE:
1393 {
1394 css::drawing::BarCode aBarCode;
1395 if (rValue >>= aBarCode)
1396 {
1397 static_cast<SdrGrafObj*>(GetSdrObject())->setQrCode(aBarCode);
1398 bOk = true;
1399 }
1400 break;
1401 }
1402
1403 default:
1404 return SvxShapeText::setPropertyValueImpl( rName, pProperty, rValue );
1405 }
1406
1407 if( !bOk )
1408 throw lang::IllegalArgumentException();
1409
1411
1412 return true;
1413}
1414
1415bool SvxGraphicObject::getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue )
1416{
1417 switch( pProperty->nWID )
1418 {
1420 {
1421 const Graphic& rGraphic = static_cast<SdrGrafObj*>(GetSdrObject())->GetGraphic();
1422
1423 if (rGraphic.GetType() != GraphicType::GdiMetafile)
1424 {
1425 uno::Reference<awt::XBitmap> xBitmap(rGraphic.GetXGraphic(), uno::UNO_QUERY);
1426 rValue <<= xBitmap;
1427 }
1428 else
1429 {
1430 SvMemoryStream aDestStrm( 65535, 65535 );
1431
1432 ConvertGDIMetaFileToWMF( rGraphic.GetGDIMetaFile(), aDestStrm, nullptr, false );
1433 const uno::Sequence<sal_Int8> aSeq(
1434 static_cast< const sal_Int8* >(aDestStrm.GetData()),
1435 aDestStrm.GetEndOfData());
1436 rValue <<= aSeq;
1437 }
1438 break;
1439 }
1440
1442 {
1443 const GraphicObject* pGrafObj = static_cast< SdrGrafObj* >(GetSdrObject())->GetReplacementGraphicObject();
1444
1445 if (pGrafObj)
1446 {
1447 rValue <<= pGrafObj->GetGraphic().GetXGraphic();
1448 }
1449
1450 break;
1451 }
1452
1454 {
1455 const OUString aStreamURL( static_cast<SdrGrafObj*>( GetSdrObject() )->GetGrafStreamURL() );
1456 if( !aStreamURL.isEmpty() )
1457 rValue <<= aStreamURL;
1458 break;
1459 }
1460
1463 {
1464 if (pProperty->nWID == OWN_ATTR_GRAPHIC_URL)
1465 {
1466 SAL_WARN("svx", "Getting Graphic by URL is not supported, getting it by value");
1467 }
1468
1469 Reference<graphic::XGraphic> xGraphic;
1470 auto pSdrGraphicObject = static_cast<SdrGrafObj*>(GetSdrObject());
1471 if (pSdrGraphicObject
1472 && pSdrGraphicObject->GetGraphicObject().GetType() != GraphicType::NONE)
1473 xGraphic = pSdrGraphicObject->GetGraphic().GetXGraphic();
1474 rValue <<= xGraphic;
1475 break;
1476 }
1477
1479 {
1480 rValue <<= static_cast< SdrGrafObj* >( GetSdrObject() )->getInputStream();
1481 break;
1482 }
1483
1485 {
1486 rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->isSignatureLine();
1487 break;
1488 }
1489
1491 {
1492 rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->getSignatureLineId();
1493 break;
1494 }
1495
1497 {
1498 rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->getSignatureLineSuggestedSignerName();
1499 break;
1500 }
1501
1503 {
1504 rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->getSignatureLineSuggestedSignerTitle();
1505 break;
1506 }
1507
1509 {
1510 rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->getSignatureLineSuggestedSignerEmail();
1511 break;
1512 }
1513
1515 {
1516 rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->getSignatureLineSigningInstructions();
1517 break;
1518 }
1519
1521 {
1522 rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->isSignatureLineShowSignDate();
1523 break;
1524 }
1525
1527 {
1528 rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->isSignatureLineCanAddComment();
1529 break;
1530 }
1531
1533 {
1534 Reference<graphic::XGraphic> xGraphic(
1535 static_cast<SdrGrafObj*>(GetSdrObject())->getSignatureLineUnsignedGraphic());
1536 rValue <<= xGraphic;
1537 break;
1538 }
1539
1541 {
1542 rValue <<= static_cast<SdrGrafObj*>(GetSdrObject())->isSignatureLineSigned();
1543 break;
1544 }
1545
1546 case OWN_ATTR_QRCODE:
1547 {
1548 css::drawing::BarCode* ptr = static_cast<SdrGrafObj*>(GetSdrObject())->getQrCode();
1549 if(ptr)
1550 {
1551 rValue <<= *ptr;
1552 }
1553 break;
1554 }
1555
1556 default:
1557 return SvxShapeText::getPropertyValueImpl(rName, pProperty,rValue);
1558 }
1559
1560 return true;
1561}
1562
1563
1565: SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_CAPTION), getSvxMapProvider().GetPropertySet(SVXMAP_CAPTION, SdrObject::GetGlobalDrawObjectItemPool()) )
1566{
1567}
1568
1570{
1571}
1572
1574 : SvxShapeText( pObj, getSvxMapProvider().GetMap( SVXMAP_CUSTOMSHAPE ), getSvxMapProvider().GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool()) )
1575{
1576}
1577
1579{
1580}
1581
1583{
1584 return SvxShapeText::queryInterface( rType );
1585}
1586
1588{
1589 css::uno::Any aReturn = SvxShapeText::queryAggregation( rType );
1590 if ( !aReturn.hasValue() )
1591 aReturn = ::cppu::queryInterface(rType, static_cast<drawing::XEnhancedCustomShapeDefaulter*>(this) );
1592 return aReturn;
1593}
1594
1595uno::Sequence< sal_Int8 > SAL_CALL SvxCustomShape::getImplementationId()
1596{
1597 return css::uno::Sequence<sal_Int8>();
1598}
1599
1600// css::drawing::XShape
1601
1602
1603awt::Point SAL_CALL SvxCustomShape::getPosition()
1604{
1605 ::SolarMutexGuard aGuard;
1606 if ( HasSdrObject() )
1607 {
1608 SdrAShapeObjGeoData aCustomShapeGeoData;
1609 static_cast<SdrObjCustomShape*>(GetSdrObject())->SaveGeoData( aCustomShapeGeoData );
1610
1611 bool bMirroredX = false;
1612 bool bMirroredY = false;
1613
1614 if ( HasSdrObject() )
1615 {
1616 bMirroredX = static_cast<SdrObjCustomShape*>(GetSdrObject())->IsMirroredX();
1617 bMirroredY = static_cast<SdrObjCustomShape*>(GetSdrObject())->IsMirroredY();
1618 }
1619 // get aRect, this is the unrotated snaprect
1620 tools::Rectangle aRect(static_cast<SdrObjCustomShape*>(GetSdrObject())->GetLogicRect());
1621 tools::Rectangle aRectangle( aRect );
1622
1623 if ( bMirroredX || bMirroredY )
1624 { // we have to retrieve the unmirrored rect
1625
1626 GeoStat aNewGeo(aCustomShapeGeoData.maGeo);
1627 if ( bMirroredX )
1628 {
1629 tools::Polygon aPol( Rect2Poly( aRect, aNewGeo ) );
1630 tools::Rectangle aBoundRect( aPol.GetBoundRect() );
1631
1632 Point aRef1( ( aBoundRect.Left() + aBoundRect.Right() ) >> 1, aBoundRect.Top() );
1633 Point aRef2( aRef1.X(), aRef1.Y() + 1000 );
1634 sal_uInt16 i;
1635 sal_uInt16 nPointCount=aPol.GetSize();
1636 for (i=0; i<nPointCount; i++)
1637 {
1638 MirrorPoint(aPol[i],aRef1,aRef2);
1639 }
1640 // turn and move polygon
1641 tools::Polygon aPol0(aPol);
1642 aPol[0]=aPol0[1];
1643 aPol[1]=aPol0[0];
1644 aPol[2]=aPol0[3];
1645 aPol[3]=aPol0[2];
1646 aPol[4]=aPol0[1];
1647 aRectangle = svx::polygonToRectangle(aPol, aNewGeo);
1648 }
1649 if ( bMirroredY )
1650 {
1651 tools::Polygon aPol( Rect2Poly( aRectangle, aNewGeo ) );
1652 tools::Rectangle aBoundRect( aPol.GetBoundRect() );
1653
1654 Point aRef1( aBoundRect.Left(), ( aBoundRect.Top() + aBoundRect.Bottom() ) >> 1 );
1655 Point aRef2( aRef1.X() + 1000, aRef1.Y() );
1656 sal_uInt16 i;
1657 sal_uInt16 nPointCount=aPol.GetSize();
1658 for (i=0; i<nPointCount; i++)
1659 {
1660 MirrorPoint(aPol[i],aRef1,aRef2);
1661 }
1662 // turn and move polygon
1663 tools::Polygon aPol0(aPol);
1664 aPol[0]=aPol0[1];
1665 aPol[1]=aPol0[0];
1666 aPol[2]=aPol0[3];
1667 aPol[3]=aPol0[2];
1668 aPol[4]=aPol0[1];
1669 aRectangle = svx::polygonToRectangle(aPol, aNewGeo);
1670 }
1671 }
1672 Point aPt( aRectangle.TopLeft() );
1673
1674 if( GetSdrObject()->getSdrModelFromSdrObject().IsWriter() )
1675 aPt -= GetSdrObject()->GetAnchorPos();
1676
1678 return css::awt::Point( aPt.X(), aPt.Y() );
1679 }
1680 else
1681 return SvxShape::getPosition();
1682}
1683
1684
1685void SAL_CALL SvxCustomShape::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
1686{
1687 ::SolarMutexGuard aGuard;
1688
1690
1691 // tdf#98163 Use a custom slot to have filter code flush the UNO
1692 // API implementations of SdrObjCustomShape. Used e.g. by
1693 // ~SdXMLCustomShapeContext, see there for more information
1694 if("FlushCustomShapeUnoApiObjects" == aPropertyName)
1695 {
1696 SdrObjCustomShape* pTarget = dynamic_cast< SdrObjCustomShape* >(pObject);
1697 if(pTarget)
1698 {
1699 // Luckily, the object causing problems in tdf#93994 is not the
1700 // UNO API object, but the XCustomShapeEngine involved. This
1701 // object is on-demand replaceable and can be reset here. This
1702 // will free the involved EditEngine and VirtualDevice.
1703 pTarget->mxCustomShapeEngine.set(nullptr);
1704 }
1705 // since this case is only for the application cores
1706 // we should return from this function now
1707 return;
1708 }
1709
1710 bool bCustomShapeGeometry = pObject && aPropertyName == "CustomShapeGeometry";
1711
1712 bool bMirroredX = false;
1713 bool bMirroredY = false;
1714
1715 if ( bCustomShapeGeometry )
1716 {
1717 bMirroredX = static_cast<SdrObjCustomShape*>(pObject)->IsMirroredX();
1718 bMirroredY = static_cast<SdrObjCustomShape*>(pObject)->IsMirroredY();
1719 }
1720
1721 SvxShape::setPropertyValue( aPropertyName, aValue );
1722
1723 if ( !bCustomShapeGeometry )
1724 return;
1725
1726 static_cast<SdrObjCustomShape*>(pObject)->MergeDefaultAttributes();
1727 tools::Rectangle aRect( pObject->GetSnapRect() );
1728
1729 // #i38892#
1730 bool bNeedsMirrorX = static_cast<SdrObjCustomShape*>(pObject)->IsMirroredX() != bMirroredX;
1731 bool bNeedsMirrorY = static_cast<SdrObjCustomShape*>(pObject)->IsMirroredY() != bMirroredY;
1732
1733 std::unique_ptr< SdrGluePointList > pListCopy;
1734 if( bNeedsMirrorX || bNeedsMirrorY )
1735 {
1736 const SdrGluePointList* pList = pObject->GetGluePointList();
1737 if( pList )
1738 pListCopy.reset( new SdrGluePointList(*pList) );
1739 }
1740
1741 if ( bNeedsMirrorX )
1742 {
1743 Point aTop( ( aRect.Left() + aRect.Right() ) >> 1, aRect.Top() );
1744 Point aBottom( aTop.X(), aTop.Y() + 1000 );
1745 pObject->NbcMirror( aTop, aBottom );
1746 // NbcMirroring is flipping the current mirror state,
1747 // so we have to set the correct state again
1748 static_cast<SdrObjCustomShape*>(pObject)->SetMirroredX( !bMirroredX );
1749 }
1750 if ( bNeedsMirrorY )
1751 {
1752 Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 );
1753 Point aRight( aLeft.X() + 1000, aLeft.Y() );
1754 pObject->NbcMirror( aLeft, aRight );
1755 // NbcMirroring is flipping the current mirror state,
1756 // so we have to set the correct state again
1757 static_cast<SdrObjCustomShape*>(pObject)->SetMirroredY( !bMirroredY );
1758 }
1759
1760 if( pListCopy )
1761 {
1762 SdrGluePointList* pNewList = const_cast< SdrGluePointList* >( pObject->GetGluePointList() );
1763 if(pNewList)
1764 *pNewList = *pListCopy;
1765 }
1766}
1767
1768bool SvxCustomShape::getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue )
1769{
1770 switch( pProperty->nWID )
1771 {
1773 {
1774 double fAngle = static_cast<SdrObjCustomShape*>(GetSdrObject())->GetObjectRotation();
1775 fAngle *= 100;
1776 rValue <<= static_cast<sal_Int32>(fAngle);
1777 return true;
1778 }
1779 default:
1780 return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
1781 }
1782}
1783
1784void SvxCustomShape::createCustomShapeDefaults( const OUString& rValueType )
1785{
1786 if (!HasSdrObject())
1787 {
1788 OSL_FAIL("could not create Custom Shape Defaults!");
1789 return;
1790 }
1791
1792 static_cast<SdrObjCustomShape*>(GetSdrObject())->MergeDefaultAttributes( &rValueType );
1793}
1794
1796 : SvxShape(pObject, pEntries, pPropertySet)
1797{}
1798
1800{}
1801
1802/* 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
This class represents an embedded or linked bitmap graphic object.
Definition: svdograf.hxx:68
const Graphic & GetGraphic() const
Definition: svdograf.cxx:381
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:294
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:784
size_t GetObjCount() const
Definition: svdpage.cxx:778
virtual rtl::Reference< SdrObject > NbcRemoveObject(size_t nObjNum)
remove from list without delete
Definition: svdpage.cxx:333
Abstract DrawObject.
Definition: svdobj.hxx:260
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
Definition: unoshape.cxx:4005
const Point & GetAnchorPos() const
Definition: svdobj.cxx:1619
virtual css::uno::Reference< css::drawing::XShape > getUnoShape()
Definition: svdobj.cxx:2832
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:2974
virtual void ConnectToNode(bool bTail1, SdrObject *pObj)
Definition: svdobj.cxx:2334
virtual void DisconnectFromNode(bool bTail1)
Definition: svdobj.cxx:2338
SdrObject * getParentSdrObjectFromSdrObject() const
Definition: svdobj.cxx:722
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const
Definition: svdobj.cxx:2947
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:413
SdrView * NextView()
Definition: svdviter.cxx:153
SdrView * FirstView()
Definition: svdviter.cxx:147
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:1578
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unoshap2.cxx:1587
virtual void SAL_CALL createCustomShapeDefaults(const OUString &rShapeType) override
Definition: unoshap2.cxx:1784
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unoshap2.cxx:1603
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoshap2.cxx:1595
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, css::uno::Any &rValue) override
Definition: unoshap2.cxx:1768
void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unoshap2.cxx:1685
SvxCustomShape(SdrObject *pObj)
Definition: unoshap2.cxx:1573
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshap2.cxx:1582
virtual ~SvxGraphicObject() noexcept override
Definition: unoshap2.cxx:1177
SVXCORE_DLLPUBLIC SvxGraphicObject(SdrObject *pObj)
Definition: unoshap2.cxx:1172
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, css::uno::Any &rValue) override
Definition: unoshap2.cxx:1415
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, const css::uno::Any &rValue) override
Definition: unoshap2.cxx:1181
virtual ~SvxShapeCaption() noexcept override
Definition: unoshap2.cxx:1569
SvxShapeCaption(SdrObject *pObj)
Definition: unoshap2.cxx:1564
virtual ~SvxShapeCircle() noexcept override
Definition: unoshap2.cxx:892
SVXCORE_DLLPUBLIC SvxShapeCircle(SdrObject *pObj)
Definition: unoshap2.cxx:887
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshap2.cxx:360
virtual ~SvxShapeConnector() noexcept override
Definition: unoshap2.cxx:355
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unoshap2.cxx:396
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
Definition: unoshap2.cxx:402
virtual void SAL_CALL disconnectEnd(const css::uno::Reference< css::drawing::XConnectableShape > &xShape) override
Definition: unoshap2.cxx:461
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoshap2.cxx:378
virtual OUString SAL_CALL getShapeType() override
Definition: unoshap2.cxx:391
virtual css::awt::Size SAL_CALL getSize() override
Definition: unoshap2.cxx:408
virtual void SAL_CALL disconnectBegin(const css::uno::Reference< css::drawing::XConnectableShape > &xShape) override
Definition: unoshap2.cxx:450
virtual void SAL_CALL connectStart(const css::uno::Reference< css::drawing::XConnectableShape > &xShape, css::drawing::ConnectionType nPos) override
Definition: unoshap2.cxx:422
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoshap2.cxx:383
virtual void SAL_CALL connectEnd(const css::uno::Reference< css::drawing::XConnectableShape > &xShape, css::drawing::ConnectionType nPos) override
Definition: unoshap2.cxx:436
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unoshap2.cxx:365
virtual void SAL_CALL setSize(const css::awt::Size &aSize) override
Definition: unoshap2.cxx:414
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
Definition: unoshap2.cxx:843
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unoshap2.cxx:488
virtual ~SvxShapeControl() noexcept override
Definition: unoshap2.cxx:478
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoshap2.cxx:501
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshap2.cxx:483
SvxShapeControl(SdrObject *pObj)
Definition: unoshap2.cxx:471
virtual void SAL_CALL setControl(const css::uno::Reference< css::awt::XControlModel > &xControl) override
Definition: unoshap2.cxx:559
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unoshap2.cxx:746
virtual void SAL_CALL setSize(const css::awt::Size &aSize) override
Definition: unoshap2.cxx:537
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unoshap2.cxx:708
virtual css::awt::Size SAL_CALL getSize() override
Definition: unoshap2.cxx:531
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unoshap2.cxx:519
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoshap2.cxx:506
virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getControl() override
Definition: unoshap2.cxx:545
virtual OUString SAL_CALL getShapeType() override
Definition: unoshap2.cxx:514
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: unoshap2.cxx:820
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
Definition: unoshap2.cxx:525
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
Definition: unoshap2.cxx:795
SvxShapeDimensioning(SdrObject *pObj)
Definition: unoshap2.cxx:878
virtual ~SvxShapeDimensioning() noexcept override
Definition: unoshap2.cxx:883
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:1799
SvxShapeGroupAnyD(SdrObject *pObject, o3tl::span< const SfxItemPropertyMapEntry > pEntries, const SvxItemPropertySet *pPropertySet)
Definition: unoshap2.cxx:1795
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:283
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: unoshap2.cxx:314
virtual sal_Int32 SAL_CALL getCount() override
Definition: unoshap2.cxx:302
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:291
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:342
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:336
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:1147
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, css::uno::Any &rValue) override
Definition: unoshap2.cxx:1023
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, const css::uno::Any &rValue) override
Definition: unoshap2.cxx:911
virtual ~SvxShapePolyPolygon() noexcept override
Definition: unoshap2.cxx:907
css::drawing::PolygonKind GetPolygonKind() const
Definition: unoshap2.cxx:1125
basegfx::B2DPolyPolygon GetPolygon() const noexcept
Definition: unoshap2.cxx:1156
SVXCORE_DLLPUBLIC SvxShapePolyPolygon(SdrObject *pObj)
Definition: unoshap2.cxx:898
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, css::uno::Any &rValue) override
Definition: unoshape.cxx:3946
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unoshape.cxx:3814
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshape.cxx:3808
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, const css::uno::Any &rValue) override
Definition: unoshape.cxx:3923
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:3048
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:2534
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:3018
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 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:861
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:573
struct @1 SvxShapeControlPropertyMapping[]
#define QUERYINT(xint)
Definition: unoshap2.cxx:77
OUString msAPIName
Definition: unoshap2.cxx:572
#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)