Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #include "Shape.hxx"
29 : :
30 : : #include <com/sun/star/beans/NamedValue.hpp>
31 : : #include <com/sun/star/beans/PropertyAttribute.hpp>
32 : : #include <com/sun/star/beans/XPropertyState.hpp>
33 : : #include <com/sun/star/text/ParagraphVertAlign.hpp>
34 : : #include <comphelper/property.hxx>
35 : : #include <comphelper/sequence.hxx>
36 : : #include <tools/debug.hxx>
37 : : #include <tools/diagnose_ex.h>
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 : 0 : uno::Sequence< ::rtl::OUString > lcl_getShapeOptionals()
54 : : {
55 : : ::rtl::OUString pProps[] = {
56 : : PROPERTY_DATAFIELD
57 : : ,PROPERTY_CONTROLBACKGROUND
58 : : ,PROPERTY_CONTROLBACKGROUNDTRANSPARENT
59 [ # # ][ # # ]: 0 : };
[ # # ]
[ # # # # ]
60 [ # # ][ # # ]: 0 : return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
[ # # ]
61 : : }
62 : :
63 : : DBG_NAME( rpt_OShape )
64 : : // -----------------------------------------------------------------------------
65 : 0 : 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 [ # # ][ # # ]: 0 : ,m_bOpaque(sal_False)
[ # # ][ # # ]
[ # # ]
71 : : {
72 : : DBG_CTOR( rpt_OShape,NULL);
73 [ # # ][ # # ]: 0 : m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_SHAPE,m_aProps.aComponent.m_xContext->getServiceManager());
[ # # ]
74 : 0 : }
75 : : // -----------------------------------------------------------------------------
76 : 0 : 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 [ # # ][ # # ]: 0 : ,m_sServiceName(_sServiceName)
[ # # ][ # # ]
[ # # ]
86 : : {
87 : : DBG_CTOR( rpt_OShape,NULL);
88 [ # # ][ # # ]: 0 : m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_SHAPE,m_aProps.aComponent.m_xContext->getServiceManager());
[ # # ]
89 [ # # ]: 0 : m_aProps.aComponent.m_xFactory = _xFactory;
90 [ # # ]: 0 : osl_incrementInterlockedCount( &m_refCount );
91 : : {
92 [ # # ]: 0 : uno::Reference<beans::XPropertySet> xProp(_xShape,uno::UNO_QUERY);
93 [ # # ]: 0 : if ( xProp.is() )
94 : : {
95 [ # # ][ # # ]: 0 : xProp->getPropertyValue(PROPERTY_ZORDER) >>= m_nZOrder;
[ # # ]
96 : 0 : xProp.clear();
97 : : }
98 [ # # ][ # # ]: 0 : m_aProps.aComponent.setShape(_xShape,this,m_refCount);
99 : : }
100 [ # # ]: 0 : osl_decrementInterlockedCount( &m_refCount );
101 : 0 : }
102 : : // -----------------------------------------------------------------------------
103 [ # # ][ # # ]: 0 : OShape::~OShape()
[ # # ][ # # ]
[ # # ]
104 : : {
105 : : DBG_DTOR( rpt_OShape,NULL);
106 [ # # ]: 0 : }
107 : : // -----------------------------------------------------------------------------
108 : : //IMPLEMENT_FORWARD_XINTERFACE2(OShape,ShapeBase,ShapePropertySet)
109 : 0 : IMPLEMENT_FORWARD_REFCOUNT( OShape, ShapeBase )
110 : : // --------------------------------------------------------------------------------
111 : 0 : uno::Any SAL_CALL OShape::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
112 : : {
113 [ # # ]: 0 : uno::Any aReturn = ShapeBase::queryInterface(_rType);
114 [ # # ]: 0 : if ( !aReturn.hasValue() )
115 [ # # ]: 0 : aReturn = ShapePropertySet::queryInterface(_rType);
116 : :
117 [ # # ][ # # ]: 0 : if ( !aReturn.hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
[ # # ][ # # ]
118 : 0 : return aReturn;
119 : :
120 [ # # ][ # # ]: 0 : return aReturn.hasValue() ? aReturn : (m_aProps.aComponent.m_xProxy.is() ? m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn);
[ # # ][ # # ]
121 : : }
122 : :
123 : : // -----------------------------------------------------------------------------
124 : 0 : void SAL_CALL OShape::dispose() throw(uno::RuntimeException)
125 : : {
126 : 0 : ShapePropertySet::dispose();
127 : 0 : cppu::WeakComponentImplHelperBase::dispose();
128 : 0 : }
129 : : // -----------------------------------------------------------------------------
130 : 0 : ::rtl::OUString OShape::getImplementationName_Static( ) throw(uno::RuntimeException)
131 : : {
132 : 0 : return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.Shape"));
133 : : }
134 : :
135 : : //--------------------------------------------------------------------------
136 : 0 : ::rtl::OUString SAL_CALL OShape::getImplementationName( ) throw(uno::RuntimeException)
137 : : {
138 : 0 : return getImplementationName_Static();
139 : : }
140 : : //--------------------------------------------------------------------------
141 : 0 : uno::Sequence< ::rtl::OUString > OShape::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
142 : : {
143 : 0 : uno::Sequence< ::rtl::OUString > aServices(1);
144 [ # # ][ # # ]: 0 : aServices.getArray()[0] = SERVICE_SHAPE;
145 : :
146 : 0 : return aServices;
147 : : }
148 : : //------------------------------------------------------------------------------
149 : 0 : uno::Reference< uno::XInterface > OShape::create(uno::Reference< uno::XComponentContext > const & xContext)
150 : : {
151 [ # # ]: 0 : return *(new OShape(xContext));
152 : : }
153 : :
154 : : //--------------------------------------------------------------------------
155 : 0 : uno::Sequence< ::rtl::OUString > SAL_CALL OShape::getSupportedServiceNames( ) throw(uno::RuntimeException)
156 : : {
157 : 0 : return getSupportedServiceNames_Static();
158 : : }
159 : : //------------------------------------------------------------------------------
160 : 0 : sal_Bool SAL_CALL OShape::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
161 : : {
162 : :
163 [ # # ][ # # ]: 0 : return m_sServiceName == ServiceName || ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
[ # # ][ # # ]
[ # # ][ # # ]
164 : : }
165 : : // -----------------------------------------------------------------------------
166 : : // XReportComponent
167 [ # # ][ # # ]: 0 : REPORTCOMPONENT_IMPL(OShape,m_aProps.aComponent)
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
168 [ # # ][ # # ]: 0 : REPORTCOMPONENT_IMPL2(OShape,m_aProps.aComponent)
[ # # ][ # # ]
[ # # ][ # # ]
169 [ # # ][ # # ]: 0 : REPORTCOMPONENT_MASTERDETAIL(OShape,m_aProps.aComponent)
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
170 [ # # ][ # # ]: 0 : REPORTCONTROLFORMAT_IMPL2(OShape,m_aProps.aFormatProperties)
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
171 : : // -----------------------------------------------------------------------------
172 : 0 : ::sal_Int32 SAL_CALL OShape::getControlBackground() throw (beans::UnknownPropertyException, uno::RuntimeException)
173 : : {
174 [ # # ]: 0 : throw beans::UnknownPropertyException();
175 : : }
176 : : // -----------------------------------------------------------------------------
177 : 0 : void SAL_CALL OShape::setControlBackground( ::sal_Int32 /*_backgroundcolor*/ ) throw (uno::RuntimeException,beans::UnknownPropertyException)
178 : : {
179 [ # # ]: 0 : throw beans::UnknownPropertyException();
180 : : }
181 : : // -----------------------------------------------------------------------------
182 : 0 : ::sal_Bool SAL_CALL OShape::getControlBackgroundTransparent() throw (beans::UnknownPropertyException, uno::RuntimeException)
183 : : {
184 [ # # ]: 0 : throw beans::UnknownPropertyException();
185 : : }
186 : : // -----------------------------------------------------------------------------
187 : 0 : void SAL_CALL OShape::setControlBackgroundTransparent( ::sal_Bool /*_controlbackgroundtransparent*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)
188 : : {
189 [ # # ]: 0 : throw beans::UnknownPropertyException();
190 : : }
191 : : // -----------------------------------------------------------------------------
192 : 0 : uno::Reference< beans::XPropertySetInfo > SAL_CALL OShape::getPropertySetInfo( ) throw(uno::RuntimeException)
193 : : {
194 : :
195 : : //return ShapePropertySet::getPropertySetInfo();
196 : 0 : return cppu::OPropertySetHelper::createPropertySetInfo( getInfoHelper() );
197 : : }
198 : : // -----------------------------------------------------------------------------
199 : 0 : cppu::IPropertyArrayHelper& OShape::getInfoHelper()
200 : : {
201 [ # # ]: 0 : if ( !m_pAggHelper.get() )
202 : : {
203 [ # # ]: 0 : uno::Sequence<beans::Property> aAggSeq;
204 [ # # ]: 0 : if ( m_aProps.aComponent.m_xProperty.is() )
205 [ # # ][ # # ]: 0 : aAggSeq = m_aProps.aComponent.m_xProperty->getPropertySetInfo()->getProperties();
[ # # ][ # # ]
[ # # ][ # # ]
206 [ # # ][ # # ]: 0 : m_pAggHelper.reset(new OPropertyArrayAggregationHelper(ShapePropertySet::getPropertySetInfo()->getProperties(),aAggSeq));
[ # # ][ # # ]
[ # # ][ # # ]
207 : : }
208 : 0 : return *(m_pAggHelper.get());
209 : : }
210 : :
211 : : // -----------------------------------------------------------------------------
212 : 0 : 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 : 0 : getInfoHelper();
215 [ # # ]: 0 : if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY )
216 : 0 : m_aProps.aComponent.m_xProperty->setPropertyValue( aPropertyName,aValue);
217 : : // can be in both
218 [ # # ]: 0 : if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY )
219 : 0 : ShapePropertySet::setPropertyValue( aPropertyName, aValue );
220 : 0 : }
221 : : // -----------------------------------------------------------------------------
222 : 0 : uno::Any SAL_CALL OShape::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
223 : : {
224 : 0 : getInfoHelper();
225 [ # # ]: 0 : if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY )
226 : 0 : return m_aProps.aComponent.m_xProperty->getPropertyValue( PropertyName);
227 : : // can be in both
228 [ # # ]: 0 : if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY )
229 : 0 : return ShapePropertySet::getPropertyValue( PropertyName);
230 : 0 : return uno::Any();
231 : : }
232 : : // -----------------------------------------------------------------------------
233 : 0 : void SAL_CALL OShape::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
234 : : {
235 : 0 : getInfoHelper();
236 [ # # ][ # # ]: 0 : if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || aPropertyName.isEmpty() )
[ # # ]
237 : 0 : m_aProps.aComponent.m_xProperty->addPropertyChangeListener( aPropertyName, xListener);
238 : : // can be in both
239 [ # # ][ # # ]: 0 : if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || aPropertyName.isEmpty() )
[ # # ]
240 : 0 : ShapePropertySet::addPropertyChangeListener( aPropertyName, xListener );
241 : 0 : }
242 : : // -----------------------------------------------------------------------------
243 : 0 : void SAL_CALL OShape::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
244 : : {
245 : 0 : getInfoHelper();
246 [ # # ][ # # ]: 0 : if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || aPropertyName.isEmpty() )
[ # # ]
247 : 0 : m_aProps.aComponent.m_xProperty->removePropertyChangeListener( aPropertyName, aListener );
248 : : // can be in both
249 [ # # ][ # # ]: 0 : if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || aPropertyName.isEmpty() )
[ # # ]
250 : 0 : ShapePropertySet::removePropertyChangeListener( aPropertyName, aListener );
251 : 0 : }
252 : : // -----------------------------------------------------------------------------
253 : 0 : void SAL_CALL OShape::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
254 : : {
255 : 0 : getInfoHelper();
256 [ # # ][ # # ]: 0 : if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || PropertyName.isEmpty() )
[ # # ]
257 : 0 : m_aProps.aComponent.m_xProperty->addVetoableChangeListener( PropertyName, aListener );
258 : : // can be in both
259 [ # # ][ # # ]: 0 : if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || PropertyName.isEmpty() )
[ # # ]
260 : 0 : ShapePropertySet::addVetoableChangeListener( PropertyName, aListener );
261 : 0 : }
262 : : // -----------------------------------------------------------------------------
263 : 0 : void SAL_CALL OShape::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
264 : : {
265 : 0 : getInfoHelper();
266 [ # # ][ # # ]: 0 : if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || PropertyName.isEmpty() )
[ # # ]
267 : 0 : m_aProps.aComponent.m_xProperty->removeVetoableChangeListener( PropertyName, aListener );
268 : : // can be in both
269 [ # # ][ # # ]: 0 : if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || PropertyName.isEmpty() )
[ # # ]
270 : 0 : ShapePropertySet::removeVetoableChangeListener( PropertyName, aListener );
271 : 0 : }
272 : : // -----------------------------------------------------------------------------
273 : : // XReportControlModel
274 : 0 : ::rtl::OUString SAL_CALL OShape::getDataField() throw ( beans::UnknownPropertyException, uno::RuntimeException)
275 : : {
276 [ # # ]: 0 : throw beans::UnknownPropertyException();
277 : : }
278 : : // -----------------------------------------------------------------------------
279 : 0 : void SAL_CALL OShape::setDataField( const ::rtl::OUString& /*_datafield*/ ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
280 : : {
281 [ # # ]: 0 : throw beans::UnknownPropertyException();
282 : : }
283 : : // -----------------------------------------------------------------------------
284 : 0 : ::sal_Bool SAL_CALL OShape::getPrintWhenGroupChange() throw (beans::UnknownPropertyException, uno::RuntimeException)
285 : : {
286 [ # # ]: 0 : ::osl::MutexGuard aGuard(m_aMutex);
287 [ # # ]: 0 : return m_aProps.bPrintWhenGroupChange;
288 : : }
289 : : // -----------------------------------------------------------------------------
290 : 0 : void SAL_CALL OShape::setPrintWhenGroupChange( ::sal_Bool _printwhengroupchange ) throw (beans::UnknownPropertyException, uno::RuntimeException)
291 : : {
292 [ # # ]: 0 : set(PROPERTY_PRINTWHENGROUPCHANGE,_printwhengroupchange,m_aProps.bPrintWhenGroupChange);
293 : 0 : }
294 : : // -----------------------------------------------------------------------------
295 : 0 : ::rtl::OUString SAL_CALL OShape::getConditionalPrintExpression() throw (beans::UnknownPropertyException, uno::RuntimeException)
296 : : {
297 [ # # ]: 0 : ::osl::MutexGuard aGuard(m_aMutex);
298 [ # # ]: 0 : return m_aProps.aConditionalPrintExpression;
299 : : }
300 : : // -----------------------------------------------------------------------------
301 : 0 : void SAL_CALL OShape::setConditionalPrintExpression( const ::rtl::OUString& _conditionalprintexpression ) throw (beans::UnknownPropertyException, uno::RuntimeException)
302 : : {
303 [ # # ]: 0 : set(PROPERTY_CONDITIONALPRINTEXPRESSION,_conditionalprintexpression,m_aProps.aConditionalPrintExpression);
304 : 0 : }
305 : : // -----------------------------------------------------------------------------
306 : :
307 : : // XCloneable
308 : 0 : uno::Reference< util::XCloneable > SAL_CALL OShape::createClone( ) throw (uno::RuntimeException)
309 : : {
310 [ # # ]: 0 : uno::Reference< report::XReportComponent> xSource = this;
311 : 0 : uno::Reference< report::XReportComponent> xSet;
312 : : try
313 : : {
314 [ # # ]: 0 : SvxShape* pShape = SvxShape::getImplementation( xSource );
315 [ # # ]: 0 : if ( pShape )
316 : : {
317 [ # # ]: 0 : SdrObject* pObject = pShape->GetSdrObject();
318 [ # # ]: 0 : if ( pObject )
319 : : {
320 [ # # ]: 0 : SdrObject* pClone = pObject->Clone();
321 [ # # ]: 0 : if ( pClone )
322 : : {
323 [ # # ][ # # ]: 0 : xSet.set(pClone->getUnoShape(),uno::UNO_QUERY_THROW );
[ # # ]
324 : : }
325 : : }
326 : : }
327 : : }
328 [ # # ]: 0 : catch(const uno::Exception&)
329 : : {
330 : : DBG_UNHANDLED_EXCEPTION();
331 : : }
332 [ # # ][ # # ]: 0 : return xSet.get();
333 : : }
334 : : // -----------------------------------------------------------------------------
335 : : // XChild
336 : 0 : uno::Reference< uno::XInterface > SAL_CALL OShape::getParent( ) throw (uno::RuntimeException)
337 : : {
338 : 0 : return OShapeHelper::getParent(this);
339 : : }
340 : : // -----------------------------------------------------------------------------
341 : 0 : void SAL_CALL OShape::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException)
342 : : {
343 [ # # ]: 0 : ::osl::MutexGuard aGuard(m_aMutex);
344 [ # # ][ # # ]: 0 : m_aProps.aComponent.m_xParent = uno::Reference< container::XChild >(Parent,uno::UNO_QUERY);
[ # # ]
345 : 0 : }
346 : 0 : uno::Reference< report::XFormatCondition > SAL_CALL OShape::createFormatCondition( ) throw (uno::Exception, uno::RuntimeException)
347 : : {
348 [ # # ][ # # ]: 0 : return new OFormatCondition(m_aProps.aComponent.m_xContext);
349 : : }
350 : : // -----------------------------------------------------------------------------
351 : : // XContainer
352 : 0 : void SAL_CALL OShape::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
353 : : {
354 : 0 : m_aProps.addContainerListener(xListener);
355 : 0 : }
356 : : // -----------------------------------------------------------------------------
357 : 0 : void SAL_CALL OShape::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
358 : : {
359 : 0 : m_aProps.removeContainerListener(xListener);
360 : 0 : }
361 : : // -----------------------------------------------------------------------------
362 : : // XElementAccess
363 : 0 : uno::Type SAL_CALL OShape::getElementType( ) throw (uno::RuntimeException)
364 : : {
365 : 0 : return ::getCppuType(static_cast< uno::Reference<report::XFormatCondition>*>(NULL));
366 : : }
367 : : // -----------------------------------------------------------------------------
368 : 0 : ::sal_Bool SAL_CALL OShape::hasElements( ) throw (uno::RuntimeException)
369 : : {
370 : 0 : return m_aProps.hasElements();
371 : : }
372 : : // -----------------------------------------------------------------------------
373 : : // XIndexContainer
374 : 0 : void SAL_CALL OShape::insertByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
375 : : {
376 : 0 : m_aProps.insertByIndex(Index,Element);
377 : 0 : }
378 : : // -----------------------------------------------------------------------------
379 : 0 : void SAL_CALL OShape::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
380 : : {
381 : 0 : m_aProps.removeByIndex(Index);
382 : 0 : }
383 : : // -----------------------------------------------------------------------------
384 : : // XIndexReplace
385 : 0 : void SAL_CALL OShape::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
386 : : {
387 : 0 : m_aProps.replaceByIndex(Index,Element);
388 : 0 : }
389 : : // -----------------------------------------------------------------------------
390 : : // XIndexAccess
391 : 0 : ::sal_Int32 SAL_CALL OShape::getCount( ) throw (uno::RuntimeException)
392 : : {
393 : 0 : return m_aProps.getCount();
394 : : }
395 : : // -----------------------------------------------------------------------------
396 : 0 : uno::Any SAL_CALL OShape::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
397 : : {
398 : 0 : return m_aProps.getByIndex( Index );
399 : : }
400 : : // -----------------------------------------------------------------------------
401 : : // XShape
402 : 0 : awt::Point SAL_CALL OShape::getPosition( ) throw (uno::RuntimeException)
403 : : {
404 : 0 : return OShapeHelper::getPosition(this);
405 : : }
406 : : // -----------------------------------------------------------------------------
407 : 0 : void SAL_CALL OShape::setPosition( const awt::Point& aPosition ) throw (uno::RuntimeException)
408 : : {
409 : 0 : OShapeHelper::setPosition(aPosition,this);
410 : 0 : }
411 : : // -----------------------------------------------------------------------------
412 : 0 : awt::Size SAL_CALL OShape::getSize( ) throw (uno::RuntimeException)
413 : : {
414 : 0 : return OShapeHelper::getSize(this);
415 : : }
416 : : // -----------------------------------------------------------------------------
417 : 0 : void SAL_CALL OShape::setSize( const awt::Size& aSize ) throw (beans::PropertyVetoException, uno::RuntimeException)
418 : : {
419 : 0 : OShapeHelper::setSize(aSize,this);
420 : 0 : }
421 : : // -----------------------------------------------------------------------------
422 : :
423 : : // XShapeDescriptor
424 : 0 : ::rtl::OUString SAL_CALL OShape::getShapeType( ) throw (uno::RuntimeException)
425 : : {
426 : 0 : return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape"));
427 : : }
428 : : // -----------------------------------------------------------------------------
429 : 0 : ::sal_Int32 SAL_CALL OShape::getZOrder() throw (uno::RuntimeException)
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)
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)
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)
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)
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)
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 : ::rtl::OUString SAL_CALL OShape::getCustomShapeEngine() throw (uno::RuntimeException)
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 ::rtl::OUString& _customshapeengine ) throw (uno::RuntimeException)
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 : ::rtl::OUString SAL_CALL OShape::getCustomShapeData() throw (uno::RuntimeException)
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 ::rtl::OUString& _customshapedata ) throw (uno::RuntimeException)
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)
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)
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 : : }// namespace reportdesign
512 : : // =============================================================================
513 : :
514 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|