1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23 #include "Shape.hxx"
24
25 #include <com/sun/star/beans/NamedValue.hpp>
26 #include <com/sun/star/beans/PropertyAttribute.hpp>
27 #include <com/sun/star/beans/XPropertyState.hpp>
28 #include <com/sun/star/text/ParagraphVertAlign.hpp>
29 #include <comphelper/property.hxx>
30 #include <comphelper/sequence.hxx>
31 #include <tools/debug.hxx>
32 #include <tools/diagnose_ex.h>
33 #include <boost/bind.hpp>
34 #include <svx/unoshape.hxx>
35
36 #include "corestrings.hrc"
37 #include "core_resource.hrc"
38 #include "core_resource.hxx"
39 #include "Tools.hxx"
40 #include "RptObject.hxx"
41 #include "FormatCondition.hxx"
42 #include "ReportHelperImpl.hxx"
43 // =============================================================================
44 namespace reportdesign
45 {
46 // =============================================================================
47 using namespace com::sun::star;
48 using namespace comphelper;
lcl_getShapeOptionals()49 uno::Sequence< ::rtl::OUString > lcl_getShapeOptionals()
50 {
51 ::rtl::OUString pProps[] = {
52 PROPERTY_DATAFIELD
53 ,PROPERTY_CONTROLBACKGROUND
54 ,PROPERTY_CONTROLBACKGROUNDTRANSPARENT
55 };
56 return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
57 }
58
DBG_NAME(rpt_OShape)59 DBG_NAME( rpt_OShape )
60 // -----------------------------------------------------------------------------
61 OShape::OShape(uno::Reference< uno::XComponentContext > const & _xContext)
62 :ShapeBase(m_aMutex)
63 ,ShapePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getShapeOptionals())
64 ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
65 ,m_nZOrder(0)
66 ,m_bOpaque(sal_False)
67 {
68 DBG_CTOR( rpt_OShape,NULL);
69 m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_SHAPE,m_aProps.aComponent.m_xContext->getServiceManager());
70 }
71 // -----------------------------------------------------------------------------
OShape(uno::Reference<uno::XComponentContext> const & _xContext,const uno::Reference<lang::XMultiServiceFactory> & _xFactory,uno::Reference<drawing::XShape> & _xShape,const::rtl::OUString & _sServiceName)72 OShape::OShape(uno::Reference< uno::XComponentContext > const & _xContext
73 ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
74 ,uno::Reference< drawing::XShape >& _xShape
75 ,const ::rtl::OUString& _sServiceName)
76 :ShapeBase(m_aMutex)
77 ,ShapePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getShapeOptionals())
78 ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
79 ,m_nZOrder(0)
80 ,m_bOpaque(sal_False)
81 ,m_sServiceName(_sServiceName)
82 {
83 DBG_CTOR( rpt_OShape,NULL);
84 m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_SHAPE,m_aProps.aComponent.m_xContext->getServiceManager());
85 m_aProps.aComponent.m_xFactory = _xFactory;
86 osl_incrementInterlockedCount( &m_refCount );
87 {
88 uno::Reference<beans::XPropertySet> xProp(_xShape,uno::UNO_QUERY);
89 if ( xProp.is() )
90 {
91 xProp->getPropertyValue(PROPERTY_ZORDER) >>= m_nZOrder;
92 xProp.clear();
93 }
94 m_aProps.aComponent.setShape(_xShape,this,m_refCount);
95 }
96 osl_decrementInterlockedCount( &m_refCount );
97 }
98 // -----------------------------------------------------------------------------
~OShape()99 OShape::~OShape()
100 {
101 DBG_DTOR( rpt_OShape,NULL);
102 }
103 // -----------------------------------------------------------------------------
104 //IMPLEMENT_FORWARD_XINTERFACE2(OShape,ShapeBase,ShapePropertySet)
IMPLEMENT_FORWARD_REFCOUNT(OShape,ShapeBase)105 IMPLEMENT_FORWARD_REFCOUNT( OShape, ShapeBase )
106 // --------------------------------------------------------------------------------
107 uno::Any SAL_CALL OShape::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
108 {
109 uno::Any aReturn = ShapeBase::queryInterface(_rType);
110 if ( !aReturn.hasValue() )
111 aReturn = ShapePropertySet::queryInterface(_rType);
112
113 if ( !aReturn.hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
114 return aReturn;
115
116 return aReturn.hasValue() ? aReturn : (m_aProps.aComponent.m_xProxy.is() ? m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn);
117 }
118
119 // -----------------------------------------------------------------------------
dispose()120 void SAL_CALL OShape::dispose() throw(uno::RuntimeException)
121 {
122 ShapePropertySet::dispose();
123 cppu::WeakComponentImplHelperBase::dispose();
124 }
125 // -----------------------------------------------------------------------------
getImplementationName_Static()126 ::rtl::OUString OShape::getImplementationName_Static( ) throw(uno::RuntimeException)
127 {
128 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.Shape"));
129 }
130
131 //--------------------------------------------------------------------------
getImplementationName()132 ::rtl::OUString SAL_CALL OShape::getImplementationName( ) throw(uno::RuntimeException)
133 {
134 return getImplementationName_Static();
135 }
136 //--------------------------------------------------------------------------
getSupportedServiceNames_Static()137 uno::Sequence< ::rtl::OUString > OShape::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
138 {
139 uno::Sequence< ::rtl::OUString > aServices(1);
140 aServices.getArray()[0] = SERVICE_SHAPE;
141
142 return aServices;
143 }
144 //------------------------------------------------------------------------------
create(uno::Reference<uno::XComponentContext> const & xContext)145 uno::Reference< uno::XInterface > OShape::create(uno::Reference< uno::XComponentContext > const & xContext)
146 {
147 return *(new OShape(xContext));
148 }
149
150 //--------------------------------------------------------------------------
getSupportedServiceNames()151 uno::Sequence< ::rtl::OUString > SAL_CALL OShape::getSupportedServiceNames( ) throw(uno::RuntimeException)
152 {
153 return getSupportedServiceNames_Static();
154 }
155 //------------------------------------------------------------------------------
supportsService(const::rtl::OUString & ServiceName)156 sal_Bool SAL_CALL OShape::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
157 {
158
159 return m_sServiceName == ServiceName || ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
160 }
161 // -----------------------------------------------------------------------------
162 // XReportComponent
163 REPORTCOMPONENT_IMPL(OShape,m_aProps.aComponent)
164 REPORTCOMPONENT_IMPL2(OShape,m_aProps.aComponent)
165 REPORTCOMPONENT_MASTERDETAIL(OShape,m_aProps.aComponent)
166 REPORTCONTROLFORMAT_IMPL2(OShape,m_aProps.aFormatProperties)
167 // -----------------------------------------------------------------------------
getControlBackground()168 ::sal_Int32 SAL_CALL OShape::getControlBackground() throw (beans::UnknownPropertyException, uno::RuntimeException)
169 {
170 throw beans::UnknownPropertyException();
171 }
172 // -----------------------------------------------------------------------------
setControlBackground(::sal_Int32)173 void SAL_CALL OShape::setControlBackground( ::sal_Int32 /*_backgroundcolor*/ ) throw (uno::RuntimeException,beans::UnknownPropertyException)
174 {
175 throw beans::UnknownPropertyException();
176 }
177 // -----------------------------------------------------------------------------
getControlBackgroundTransparent()178 ::sal_Bool SAL_CALL OShape::getControlBackgroundTransparent() throw (beans::UnknownPropertyException, uno::RuntimeException)
179 {
180 throw beans::UnknownPropertyException();
181 }
182 // -----------------------------------------------------------------------------
setControlBackgroundTransparent(::sal_Bool)183 void SAL_CALL OShape::setControlBackgroundTransparent( ::sal_Bool /*_controlbackgroundtransparent*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)
184 {
185 throw beans::UnknownPropertyException();
186 }
187 // -----------------------------------------------------------------------------
getPropertySetInfo()188 uno::Reference< beans::XPropertySetInfo > SAL_CALL OShape::getPropertySetInfo( ) throw(uno::RuntimeException)
189 {
190
191 //return ShapePropertySet::getPropertySetInfo();
192 return cppu::OPropertySetHelper::createPropertySetInfo( getInfoHelper() );
193 }
194 // -----------------------------------------------------------------------------
getInfoHelper()195 cppu::IPropertyArrayHelper& OShape::getInfoHelper()
196 {
197 if ( !m_pAggHelper.get() )
198 {
199 uno::Sequence<beans::Property> aAggSeq;
200 if ( m_aProps.aComponent.m_xProperty.is() )
201 aAggSeq = m_aProps.aComponent.m_xProperty->getPropertySetInfo()->getProperties();
202 m_pAggHelper.reset(new OPropertyArrayAggregationHelper(ShapePropertySet::getPropertySetInfo()->getProperties(),aAggSeq));
203 }
204 return *(m_pAggHelper.get());
205 }
206
207 // -----------------------------------------------------------------------------
setPropertyValue(const::rtl::OUString & aPropertyName,const uno::Any & aValue)208 void SAL_CALL OShape::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
209 {
210 getInfoHelper();
211 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY )
212 m_aProps.aComponent.m_xProperty->setPropertyValue( aPropertyName,aValue);
213 // can be in both
214 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY )
215 ShapePropertySet::setPropertyValue( aPropertyName, aValue );
216 }
217 // -----------------------------------------------------------------------------
getPropertyValue(const::rtl::OUString & PropertyName)218 uno::Any SAL_CALL OShape::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
219 {
220 getInfoHelper();
221 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY )
222 return m_aProps.aComponent.m_xProperty->getPropertyValue( PropertyName);
223 // can be in both
224 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY )
225 return ShapePropertySet::getPropertyValue( PropertyName);
226 return uno::Any();
227 }
228 // -----------------------------------------------------------------------------
addPropertyChangeListener(const::rtl::OUString & aPropertyName,const uno::Reference<beans::XPropertyChangeListener> & xListener)229 void SAL_CALL OShape::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
230 {
231 getInfoHelper();
232 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || !aPropertyName.getLength() )
233 m_aProps.aComponent.m_xProperty->addPropertyChangeListener( aPropertyName, xListener);
234 // can be in both
235 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || !aPropertyName.getLength() )
236 ShapePropertySet::addPropertyChangeListener( aPropertyName, xListener );
237 }
238 // -----------------------------------------------------------------------------
removePropertyChangeListener(const::rtl::OUString & aPropertyName,const uno::Reference<beans::XPropertyChangeListener> & aListener)239 void SAL_CALL OShape::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
240 {
241 getInfoHelper();
242 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || !aPropertyName.getLength() )
243 m_aProps.aComponent.m_xProperty->removePropertyChangeListener( aPropertyName, aListener );
244 // can be in both
245 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || !aPropertyName.getLength() )
246 ShapePropertySet::removePropertyChangeListener( aPropertyName, aListener );
247 }
248 // -----------------------------------------------------------------------------
addVetoableChangeListener(const::rtl::OUString & PropertyName,const uno::Reference<beans::XVetoableChangeListener> & aListener)249 void SAL_CALL OShape::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
250 {
251 getInfoHelper();
252 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || !PropertyName.getLength() )
253 m_aProps.aComponent.m_xProperty->addVetoableChangeListener( PropertyName, aListener );
254 // can be in both
255 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || !PropertyName.getLength() )
256 ShapePropertySet::addVetoableChangeListener( PropertyName, aListener );
257 }
258 // -----------------------------------------------------------------------------
removeVetoableChangeListener(const::rtl::OUString & PropertyName,const uno::Reference<beans::XVetoableChangeListener> & aListener)259 void SAL_CALL OShape::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
260 {
261 getInfoHelper();
262 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || !PropertyName.getLength() )
263 m_aProps.aComponent.m_xProperty->removeVetoableChangeListener( PropertyName, aListener );
264 // can be in both
265 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || !PropertyName.getLength() )
266 ShapePropertySet::removeVetoableChangeListener( PropertyName, aListener );
267 }
268 // -----------------------------------------------------------------------------
269 // XReportControlModel
getDataField()270 ::rtl::OUString SAL_CALL OShape::getDataField() throw ( beans::UnknownPropertyException, uno::RuntimeException)
271 {
272 throw beans::UnknownPropertyException();
273 }
274 // -----------------------------------------------------------------------------
setDataField(const::rtl::OUString &)275 void SAL_CALL OShape::setDataField( const ::rtl::OUString& /*_datafield*/ ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
276 {
277 throw beans::UnknownPropertyException();
278 }
279 // -----------------------------------------------------------------------------
getPrintWhenGroupChange()280 ::sal_Bool SAL_CALL OShape::getPrintWhenGroupChange() throw (beans::UnknownPropertyException, uno::RuntimeException)
281 {
282 ::osl::MutexGuard aGuard(m_aMutex);
283 return m_aProps.bPrintWhenGroupChange;
284 }
285 // -----------------------------------------------------------------------------
setPrintWhenGroupChange(::sal_Bool _printwhengroupchange)286 void SAL_CALL OShape::setPrintWhenGroupChange( ::sal_Bool _printwhengroupchange ) throw (beans::UnknownPropertyException, uno::RuntimeException)
287 {
288 set(PROPERTY_PRINTWHENGROUPCHANGE,_printwhengroupchange,m_aProps.bPrintWhenGroupChange);
289 }
290 // -----------------------------------------------------------------------------
getConditionalPrintExpression()291 ::rtl::OUString SAL_CALL OShape::getConditionalPrintExpression() throw (beans::UnknownPropertyException, uno::RuntimeException)
292 {
293 ::osl::MutexGuard aGuard(m_aMutex);
294 return m_aProps.aConditionalPrintExpression;
295 }
296 // -----------------------------------------------------------------------------
setConditionalPrintExpression(const::rtl::OUString & _conditionalprintexpression)297 void SAL_CALL OShape::setConditionalPrintExpression( const ::rtl::OUString& _conditionalprintexpression ) throw (beans::UnknownPropertyException, uno::RuntimeException)
298 {
299 set(PROPERTY_CONDITIONALPRINTEXPRESSION,_conditionalprintexpression,m_aProps.aConditionalPrintExpression);
300 }
301 // -----------------------------------------------------------------------------
302
303 // XCloneable
createClone()304 uno::Reference< util::XCloneable > SAL_CALL OShape::createClone( ) throw (uno::RuntimeException)
305 {
306 uno::Reference< report::XReportComponent> xSource = this;
307 uno::Reference< report::XReportComponent> xSet;
308 try
309 {
310 SvxShape* pShape = SvxShape::getImplementation( xSource );
311 if ( pShape )
312 {
313 SdrObject* pObject = pShape->GetSdrObject();
314 if ( pObject )
315 {
316 SdrObject* pClone = pObject->Clone();
317 if ( pClone )
318 {
319 xSet.set(pClone->getUnoShape(),uno::UNO_QUERY_THROW );
320
321 // ::comphelper::copyProperties(xSource.get(),xSet.get());
322 }
323 }
324 } // if ( pShape )
325 }
326 catch(const uno::Exception&)
327 {
328 DBG_UNHANDLED_EXCEPTION();
329 }
330 return xSet.get();
331 }
332 // -----------------------------------------------------------------------------
333 // XChild
getParent()334 uno::Reference< uno::XInterface > SAL_CALL OShape::getParent( ) throw (uno::RuntimeException)
335 {
336 return OShapeHelper::getParent(this);
337 }
338 // -----------------------------------------------------------------------------
setParent(const uno::Reference<uno::XInterface> & Parent)339 void SAL_CALL OShape::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException)
340 {
341 ::osl::MutexGuard aGuard(m_aMutex);
342 m_aProps.aComponent.m_xParent = uno::Reference< container::XChild >(Parent,uno::UNO_QUERY);
343 // not supported by the shape
344 //uno::Reference< container::XChild > xChild;
345 //comphelper::query_aggregation(m_aProps.aComponent.m_xProxy,xChild);
346 //if ( xChild.is() )
347 // xChild->setParent(Parent);
348 }
createFormatCondition()349 uno::Reference< report::XFormatCondition > SAL_CALL OShape::createFormatCondition( ) throw (uno::Exception, uno::RuntimeException)
350 {
351 return new OFormatCondition(m_aProps.aComponent.m_xContext);
352 }
353 // -----------------------------------------------------------------------------
354 // XContainer
addContainerListener(const uno::Reference<container::XContainerListener> & xListener)355 void SAL_CALL OShape::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
356 {
357 m_aProps.addContainerListener(xListener);
358 }
359 // -----------------------------------------------------------------------------
removeContainerListener(const uno::Reference<container::XContainerListener> & xListener)360 void SAL_CALL OShape::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
361 {
362 m_aProps.removeContainerListener(xListener);
363 }
364 // -----------------------------------------------------------------------------
365 // XElementAccess
getElementType()366 uno::Type SAL_CALL OShape::getElementType( ) throw (uno::RuntimeException)
367 {
368 return ::getCppuType(static_cast< uno::Reference<report::XFormatCondition>*>(NULL));
369 }
370 // -----------------------------------------------------------------------------
hasElements()371 ::sal_Bool SAL_CALL OShape::hasElements( ) throw (uno::RuntimeException)
372 {
373 return m_aProps.hasElements();
374 }
375 // -----------------------------------------------------------------------------
376 // XIndexContainer
insertByIndex(::sal_Int32 Index,const uno::Any & Element)377 void SAL_CALL OShape::insertByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
378 {
379 m_aProps.insertByIndex(Index,Element);
380 }
381 // -----------------------------------------------------------------------------
removeByIndex(::sal_Int32 Index)382 void SAL_CALL OShape::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
383 {
384 m_aProps.removeByIndex(Index);
385 }
386 // -----------------------------------------------------------------------------
387 // XIndexReplace
replaceByIndex(::sal_Int32 Index,const uno::Any & Element)388 void SAL_CALL OShape::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
389 {
390 m_aProps.replaceByIndex(Index,Element);
391 }
392 // -----------------------------------------------------------------------------
393 // XIndexAccess
getCount()394 ::sal_Int32 SAL_CALL OShape::getCount( ) throw (uno::RuntimeException)
395 {
396 return m_aProps.getCount();
397 }
398 // -----------------------------------------------------------------------------
getByIndex(::sal_Int32 Index)399 uno::Any SAL_CALL OShape::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
400 {
401 return m_aProps.getByIndex( Index );
402 }
403 // -----------------------------------------------------------------------------
404 // XShape
getPosition()405 awt::Point SAL_CALL OShape::getPosition( ) throw (uno::RuntimeException)
406 {
407 return OShapeHelper::getPosition(this);
408 }
409 // -----------------------------------------------------------------------------
setPosition(const awt::Point & aPosition)410 void SAL_CALL OShape::setPosition( const awt::Point& aPosition ) throw (uno::RuntimeException)
411 {
412 OShapeHelper::setPosition(aPosition,this);
413 }
414 // -----------------------------------------------------------------------------
getSize()415 awt::Size SAL_CALL OShape::getSize( ) throw (uno::RuntimeException)
416 {
417 return OShapeHelper::getSize(this);
418 }
419 // -----------------------------------------------------------------------------
setSize(const awt::Size & aSize)420 void SAL_CALL OShape::setSize( const awt::Size& aSize ) throw (beans::PropertyVetoException, uno::RuntimeException)
421 {
422 OShapeHelper::setSize(aSize,this);
423 }
424 // -----------------------------------------------------------------------------
425
426 // XShapeDescriptor
getShapeType()427 ::rtl::OUString SAL_CALL OShape::getShapeType( ) throw (uno::RuntimeException)
428 {
429 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape"));
430 }
431 // -----------------------------------------------------------------------------
getZOrder()432 ::sal_Int32 SAL_CALL OShape::getZOrder() throw (uno::RuntimeException)
433 {
434 ::osl::MutexGuard aGuard(m_aMutex);
435 m_aProps.aComponent.m_xProperty->getPropertyValue(PROPERTY_ZORDER) >>= m_nZOrder;
436 return m_nZOrder;
437 }
438 // -----------------------------------------------------------------------------
setZOrder(::sal_Int32 _zorder)439 void SAL_CALL OShape::setZOrder( ::sal_Int32 _zorder ) throw (uno::RuntimeException)
440 {
441 ::osl::MutexGuard aGuard(m_aMutex);
442 m_aProps.aComponent.m_xProperty->setPropertyValue(PROPERTY_ZORDER,uno::makeAny(_zorder));
443 set(PROPERTY_ZORDER,_zorder,m_nZOrder);
444 }
445 // -----------------------------------------------------------------------------
getOpaque()446 ::sal_Bool SAL_CALL OShape::getOpaque() throw (::com::sun::star::uno::RuntimeException)
447 {
448 ::osl::MutexGuard aGuard(m_aMutex);
449 return m_bOpaque;
450 }
451 // -----------------------------------------------------------------------------
setOpaque(::sal_Bool _opaque)452 void SAL_CALL OShape::setOpaque( ::sal_Bool _opaque ) throw (::com::sun::star::uno::RuntimeException)
453 {
454 ::osl::MutexGuard aGuard(m_aMutex);
455 set(PROPERTY_OPAQUE,_opaque,m_bOpaque);
456 }
457 // -----------------------------------------------------------------------------
getTransformation()458 drawing::HomogenMatrix3 SAL_CALL OShape::getTransformation() throw (uno::RuntimeException)
459 {
460 ::osl::MutexGuard aGuard(m_aMutex);
461 m_aProps.aComponent.m_xProperty->getPropertyValue(PROPERTY_TRANSFORMATION) >>= m_Transformation;
462 return m_Transformation;
463 }
464 // -----------------------------------------------------------------------------
setTransformation(const drawing::HomogenMatrix3 & _transformation)465 void SAL_CALL OShape::setTransformation( const drawing::HomogenMatrix3& _transformation ) throw (uno::RuntimeException)
466 {
467 m_aProps.aComponent.m_xProperty->setPropertyValue(PROPERTY_TRANSFORMATION,uno::makeAny(_transformation));
468 set(PROPERTY_TRANSFORMATION,_transformation,m_Transformation);
469 }
470 // -----------------------------------------------------------------------------
getCustomShapeEngine()471 ::rtl::OUString SAL_CALL OShape::getCustomShapeEngine() throw (uno::RuntimeException)
472 {
473 ::osl::MutexGuard aGuard(m_aMutex);
474 m_aProps.aComponent.m_xProperty->getPropertyValue(PROPERTY_CUSTOMSHAPEENGINE) >>= m_CustomShapeEngine;
475
476 return m_CustomShapeEngine;
477 }
478 // -----------------------------------------------------------------------------
setCustomShapeEngine(const::rtl::OUString & _customshapeengine)479 void SAL_CALL OShape::setCustomShapeEngine( const ::rtl::OUString& _customshapeengine ) throw (uno::RuntimeException)
480 {
481 m_aProps.aComponent.m_xProperty->setPropertyValue(PROPERTY_CUSTOMSHAPEENGINE,uno::makeAny(_customshapeengine));
482 set(PROPERTY_CUSTOMSHAPEENGINE,_customshapeengine,m_CustomShapeEngine);
483 }
484 // -----------------------------------------------------------------------------
getCustomShapeData()485 ::rtl::OUString SAL_CALL OShape::getCustomShapeData() throw (uno::RuntimeException)
486 {
487 ::osl::MutexGuard aGuard(m_aMutex);
488 m_aProps.aComponent.m_xProperty->getPropertyValue(PROPERTY_CUSTOMSHAPEDATA) >>= m_CustomShapeData;
489 return m_CustomShapeData;
490 }
491 // -----------------------------------------------------------------------------
setCustomShapeData(const::rtl::OUString & _customshapedata)492 void SAL_CALL OShape::setCustomShapeData( const ::rtl::OUString& _customshapedata ) throw (uno::RuntimeException)
493 {
494 m_aProps.aComponent.m_xProperty->setPropertyValue(PROPERTY_CUSTOMSHAPEDATA,uno::makeAny(_customshapedata));
495 set(PROPERTY_CUSTOMSHAPEDATA,_customshapedata,m_CustomShapeData);
496 }
497 // -----------------------------------------------------------------------------
getCustomShapeGeometry()498 uno::Sequence< beans::PropertyValue > SAL_CALL OShape::getCustomShapeGeometry() throw (uno::RuntimeException)
499 {
500 ::osl::MutexGuard aGuard(m_aMutex);
501 m_aProps.aComponent.m_xProperty->getPropertyValue(PROPERTY_CUSTOMSHAPEGEOMETRY) >>= m_CustomShapeGeometry;
502 return m_CustomShapeGeometry;
503 }
504 // -----------------------------------------------------------------------------
setCustomShapeGeometry(const uno::Sequence<beans::PropertyValue> & _customshapegeometry)505 void SAL_CALL OShape::setCustomShapeGeometry( const uno::Sequence< beans::PropertyValue >& _customshapegeometry ) throw (uno::RuntimeException)
506 {
507 m_aProps.aComponent.m_xProperty->setPropertyValue(PROPERTY_CUSTOMSHAPEGEOMETRY,uno::makeAny(_customshapegeometry));
508 set(PROPERTY_CUSTOMSHAPEGEOMETRY,_customshapegeometry,m_CustomShapeGeometry);
509 }
510 // -----------------------------------------------------------------------------
511 // -----------------------------------------------------------------------------
512
513 // =============================================================================
514 }// namespace reportdesign
515 // =============================================================================
516