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