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