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