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