LCOV - code coverage report
Current view: top level - reportdesign/source/core/api - Shape.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 33 238 13.9 %
Date: 2015-06-13 12:38:46 Functions: 15 204 7.4 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.11