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 "FormattedField.hxx"
29 : : #include <com/sun/star/beans/PropertyAttribute.hpp>
30 : : #include <com/sun/star/beans/XPropertyState.hpp>
31 : : #include "corestrings.hrc"
32 : : #include "core_resource.hrc"
33 : : #include "core_resource.hxx"
34 : : #include <comphelper/sequence.hxx>
35 : : #include <tools/color.hxx>
36 : : #include <tools/debug.hxx>
37 : : #include <connectivity/dbtools.hxx>
38 : : #include <comphelper/property.hxx>
39 : : #include "Tools.hxx"
40 : : #include "FormatCondition.hxx"
41 : : #include <com/sun/star/text/ParagraphVertAlign.hpp>
42 : : #include "ReportHelperImpl.hxx"
43 : : // =============================================================================
44 : : namespace reportdesign
45 : : {
46 : : // =============================================================================
47 : : using namespace com::sun::star;
48 : : using namespace comphelper;
49 : : //------------------------------------------------------------------------------
50 : 0 : uno::Reference< uno::XInterface > OFormattedField::create(uno::Reference< uno::XComponentContext > const & xContext)
51 : : {
52 [ # # ]: 0 : return *(new OFormattedField(xContext));
53 : : }
54 : :
55 : 0 : uno::Sequence< ::rtl::OUString > lcl_getFormattedFieldOptionals()
56 : : {
57 [ # # ][ # # ]: 0 : ::rtl::OUString pProps[] = { PROPERTY_MASTERFIELDS,PROPERTY_DETAILFIELDS };
[ # # # # ]
58 [ # # ][ # # ]: 0 : return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
[ # # ]
59 : : }
60 : : DBG_NAME( rpt_OFormattedField )
61 : : // -----------------------------------------------------------------------------
62 : 0 : OFormattedField::OFormattedField(uno::Reference< uno::XComponentContext > const & _xContext)
63 : : :FormattedFieldBase(m_aMutex)
64 : : ,FormattedFieldPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getFormattedFieldOptionals())
65 : : ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
66 [ # # ][ # # ]: 0 : ,m_nFormatKey(0)
[ # # ][ # # ]
67 : : {
68 : : DBG_CTOR( rpt_OFormattedField,NULL);
69 [ # # ][ # # ]: 0 : m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_FORMATTEDFIELD,m_aProps.aComponent.m_xContext->getServiceManager());
[ # # ]
70 : 0 : }
71 : : // -----------------------------------------------------------------------------
72 : 0 : OFormattedField::OFormattedField(uno::Reference< uno::XComponentContext > const & _xContext
73 : : ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
74 : : ,uno::Reference< drawing::XShape >& _xShape)
75 : : :FormattedFieldBase(m_aMutex)
76 : : ,FormattedFieldPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getFormattedFieldOptionals())
77 : : ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
78 [ # # ][ # # ]: 0 : ,m_nFormatKey(0)
[ # # ][ # # ]
79 : : {
80 : : DBG_CTOR( rpt_OFormattedField,NULL);
81 [ # # ][ # # ]: 0 : m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_FORMATTEDFIELD,m_aProps.aComponent.m_xContext->getServiceManager());
[ # # ]
82 [ # # ]: 0 : m_aProps.aComponent.m_xFactory = _xFactory;
83 [ # # ]: 0 : osl_incrementInterlockedCount( &m_refCount );
84 : : {
85 [ # # ][ # # ]: 0 : m_aProps.aComponent.setShape(_xShape,this,m_refCount);
86 : : }
87 [ # # ]: 0 : osl_decrementInterlockedCount( &m_refCount );
88 : 0 : }
89 : : // -----------------------------------------------------------------------------
90 [ # # ][ # # ]: 0 : OFormattedField::~OFormattedField()
[ # # ]
91 : : {
92 : : DBG_DTOR( rpt_OFormattedField,NULL);
93 [ # # ]: 0 : }
94 : : // -----------------------------------------------------------------------------
95 : 0 : IMPLEMENT_FORWARD_REFCOUNT( OFormattedField, FormattedFieldBase )
96 : : // --------------------------------------------------------------------------------
97 : 0 : uno::Any SAL_CALL OFormattedField::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
98 : : {
99 [ # # ]: 0 : uno::Any aReturn = FormattedFieldBase::queryInterface(_rType);
100 [ # # ]: 0 : if ( !aReturn.hasValue() )
101 [ # # ]: 0 : aReturn = FormattedFieldPropertySet::queryInterface(_rType);
102 [ # # ][ # # ]: 0 : if ( !aReturn.hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
[ # # ][ # # ]
103 : 0 : return aReturn;
104 : :
105 [ # # ][ # # ]: 0 : return aReturn.hasValue() ? aReturn : (m_aProps.aComponent.m_xProxy.is() ? m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn);
[ # # ][ # # ]
106 : : }
107 : :
108 : : // -----------------------------------------------------------------------------
109 : 0 : void SAL_CALL OFormattedField::dispose() throw(uno::RuntimeException)
110 : : {
111 : 0 : FormattedFieldPropertySet::dispose();
112 : 0 : cppu::WeakComponentImplHelperBase::dispose();
113 : 0 : m_xFormatsSupplier.clear();
114 : 0 : m_xFunction.clear();
115 : 0 : }
116 : : // -----------------------------------------------------------------------------
117 : 0 : ::rtl::OUString OFormattedField::getImplementationName_Static( ) throw(uno::RuntimeException)
118 : : {
119 : 0 : return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OFormattedField"));
120 : : }
121 : :
122 : : //--------------------------------------------------------------------------
123 : 0 : ::rtl::OUString SAL_CALL OFormattedField::getImplementationName( ) throw(uno::RuntimeException)
124 : : {
125 : 0 : return getImplementationName_Static();
126 : : }
127 : : //--------------------------------------------------------------------------
128 : 0 : uno::Sequence< ::rtl::OUString > OFormattedField::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
129 : : {
130 : 0 : uno::Sequence< ::rtl::OUString > aServices(2);
131 [ # # ][ # # ]: 0 : aServices.getArray()[0] = SERVICE_FORMATTEDFIELD;
132 [ # # ][ # # ]: 0 : aServices.getArray()[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFormattedFieldModel"));
133 : :
134 : 0 : return aServices;
135 : : }
136 : : //--------------------------------------------------------------------------
137 : 0 : uno::Sequence< ::rtl::OUString > SAL_CALL OFormattedField::getSupportedServiceNames( ) throw(uno::RuntimeException)
138 : : {
139 : 0 : return getSupportedServiceNames_Static();
140 : : }
141 : : //------------------------------------------------------------------------------
142 : 0 : sal_Bool SAL_CALL OFormattedField::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
143 : : {
144 [ # # ]: 0 : return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
145 : : }
146 : : // -----------------------------------------------------------------------------
147 : : // XReportComponent
148 [ # # ][ # # ]: 0 : REPORTCOMPONENT_IMPL(OFormattedField,m_aProps.aComponent)
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
149 [ # # ][ # # ]: 0 : REPORTCOMPONENT_IMPL2(OFormattedField,m_aProps.aComponent)
[ # # ][ # # ]
[ # # ][ # # ]
150 [ # # ][ # # ]: 0 : REPORTCOMPONENT_NOMASTERDETAIL(OFormattedField)
[ # # ][ # # ]
151 [ # # ][ # # ]: 0 : REPORTCONTROLFORMAT_IMPL(OFormattedField,m_aProps.aFormatProperties)
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
152 : :
153 : : // -----------------------------------------------------------------------------
154 : 0 : uno::Reference< beans::XPropertySetInfo > SAL_CALL OFormattedField::getPropertySetInfo( ) throw(uno::RuntimeException)
155 : : {
156 : 0 : return FormattedFieldPropertySet::getPropertySetInfo();
157 : : }
158 : : // -----------------------------------------------------------------------------
159 : 0 : void SAL_CALL OFormattedField::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
160 : : {
161 : : // special case here /// TODO check
162 [ # # ][ # # ]: 0 : if ( !aValue.hasValue() && aPropertyName == PROPERTY_FORMATKEY )
[ # # ][ # # ]
[ # # # # ]
163 : 0 : m_nFormatKey = 0;
164 : : else
165 : 0 : FormattedFieldPropertySet::setPropertyValue( aPropertyName, aValue );
166 : 0 : }
167 : : // -----------------------------------------------------------------------------
168 : 0 : uno::Any SAL_CALL OFormattedField::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
169 : : {
170 : 0 : return FormattedFieldPropertySet::getPropertyValue( PropertyName);
171 : : }
172 : : // -----------------------------------------------------------------------------
173 : 0 : void SAL_CALL OFormattedField::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
174 : : {
175 : 0 : FormattedFieldPropertySet::addPropertyChangeListener( aPropertyName, xListener );
176 : 0 : }
177 : : // -----------------------------------------------------------------------------
178 : 0 : void SAL_CALL OFormattedField::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
179 : : {
180 : 0 : FormattedFieldPropertySet::removePropertyChangeListener( aPropertyName, aListener );
181 : 0 : }
182 : : // -----------------------------------------------------------------------------
183 : 0 : void SAL_CALL OFormattedField::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
184 : : {
185 : 0 : FormattedFieldPropertySet::addVetoableChangeListener( PropertyName, aListener );
186 : 0 : }
187 : : // -----------------------------------------------------------------------------
188 : 0 : void SAL_CALL OFormattedField::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
189 : : {
190 : 0 : FormattedFieldPropertySet::removeVetoableChangeListener( PropertyName, aListener );
191 : 0 : }
192 : : // -----------------------------------------------------------------------------
193 : : // XReportControlModel
194 : 0 : ::rtl::OUString SAL_CALL OFormattedField::getDataField() throw ( beans::UnknownPropertyException, uno::RuntimeException)
195 : : {
196 [ # # ]: 0 : ::osl::MutexGuard aGuard(m_aMutex);
197 [ # # ]: 0 : return m_aProps.aDataField;
198 : : }
199 : : // -----------------------------------------------------------------------------
200 : 0 : void SAL_CALL OFormattedField::setDataField( const ::rtl::OUString& _datafield ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
201 : : {
202 [ # # ]: 0 : set(PROPERTY_DATAFIELD,_datafield,m_aProps.aDataField);
203 : 0 : }
204 : : // -----------------------------------------------------------------------------
205 : 0 : ::sal_Bool SAL_CALL OFormattedField::getPrintWhenGroupChange() throw (beans::UnknownPropertyException, uno::RuntimeException)
206 : : {
207 [ # # ]: 0 : ::osl::MutexGuard aGuard(m_aMutex);
208 [ # # ]: 0 : return m_aProps.bPrintWhenGroupChange;
209 : : }
210 : : // -----------------------------------------------------------------------------
211 : 0 : void SAL_CALL OFormattedField::setPrintWhenGroupChange( ::sal_Bool _printwhengroupchange ) throw (beans::UnknownPropertyException, uno::RuntimeException)
212 : : {
213 [ # # ]: 0 : set(PROPERTY_PRINTWHENGROUPCHANGE,_printwhengroupchange,m_aProps.bPrintWhenGroupChange);
214 : 0 : }
215 : : // -----------------------------------------------------------------------------
216 : 0 : ::rtl::OUString SAL_CALL OFormattedField::getConditionalPrintExpression() throw (beans::UnknownPropertyException, uno::RuntimeException)
217 : : {
218 [ # # ]: 0 : ::osl::MutexGuard aGuard(m_aMutex);
219 [ # # ]: 0 : return m_aProps.aConditionalPrintExpression;
220 : : }
221 : : // -----------------------------------------------------------------------------
222 : 0 : void SAL_CALL OFormattedField::setConditionalPrintExpression( const ::rtl::OUString& _conditionalprintexpression ) throw (beans::UnknownPropertyException, uno::RuntimeException)
223 : : {
224 [ # # ]: 0 : set(PROPERTY_CONDITIONALPRINTEXPRESSION,_conditionalprintexpression,m_aProps.aConditionalPrintExpression);
225 : 0 : }
226 : :
227 : : // -----------------------------------------------------------------------------
228 : :
229 : : // XCloneable
230 : 0 : uno::Reference< util::XCloneable > SAL_CALL OFormattedField::createClone( ) throw (uno::RuntimeException)
231 : : {
232 [ # # ]: 0 : uno::Reference< report::XReportComponent> xSource = this;
233 [ # # ][ # # ]: 0 : uno::Reference< report::XFormattedField> xSet(cloneObject(xSource,m_aProps.aComponent.m_xFactory,SERVICE_FORMATTEDFIELD),uno::UNO_QUERY_THROW);
[ # # ]
234 : :
235 [ # # ]: 0 : if ( xSet.is() )
236 : : {
237 : 0 : ::std::vector< uno::Reference< report::XFormatCondition> >::iterator aIter = m_aProps.m_aFormatConditions.begin();
238 : 0 : ::std::vector< uno::Reference< report::XFormatCondition> >::iterator aEnd = m_aProps.m_aFormatConditions.end();
239 [ # # ][ # # ]: 0 : for (sal_Int32 i = 0; aIter != aEnd; ++aIter,++i)
240 : : {
241 [ # # ][ # # ]: 0 : uno::Reference< report::XFormatCondition > xCond = xSet->createFormatCondition();
242 [ # # ][ # # ]: 0 : ::comphelper::copyProperties(aIter->get(),xCond.get());
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
243 [ # # ][ # # ]: 0 : xSet->insertByIndex(i,uno::makeAny(xCond));
[ # # ]
244 : 0 : }
245 : : }
246 [ # # ][ # # ]: 0 : return xSet.get();
247 : : }
248 : : // -----------------------------------------------------------------------------
249 : : // XFormattedField
250 : : // -----------------------------------------------------------------------------
251 : 0 : ::sal_Int32 SAL_CALL OFormattedField::getFormatKey() throw (uno::RuntimeException)
252 : : {
253 [ # # ]: 0 : ::osl::MutexGuard aGuard(m_aMutex);
254 [ # # ]: 0 : return m_nFormatKey;
255 : : }
256 : :
257 : 0 : void SAL_CALL OFormattedField::setFormatKey(::sal_Int32 _formatkey) throw (uno::RuntimeException)
258 : : {
259 [ # # ]: 0 : set(PROPERTY_FORMATKEY,_formatkey,m_nFormatKey);
260 : 0 : }
261 : : // -----------------------------------------------------------------------------
262 : 0 : uno::Reference< util::XNumberFormatsSupplier > SAL_CALL OFormattedField::getFormatsSupplier() throw (uno::RuntimeException)
263 : : {
264 [ # # ]: 0 : ::osl::MutexGuard aGuard(m_aMutex);
265 [ # # ]: 0 : if ( !m_xFormatsSupplier.is() )
266 : : {
267 [ # # ]: 0 : uno::Reference< report::XSection> xSection = getSection();
268 [ # # ]: 0 : if ( xSection.is() )
269 [ # # ][ # # ]: 0 : m_xFormatsSupplier.set(xSection->getReportDefinition(),uno::UNO_QUERY);
[ # # ]
270 [ # # ]: 0 : if ( !m_xFormatsSupplier.is() )
271 : : {
272 [ # # ][ # # ]: 0 : uno::Reference< beans::XPropertySet> xProp(::dbtools::findDataSource(getParent()),uno::UNO_QUERY);
[ # # ]
273 [ # # ]: 0 : if ( xProp.is() )
274 [ # # ][ # # ]: 0 : m_xFormatsSupplier.set(xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NumberFormatsSupplier"))),uno::UNO_QUERY);
[ # # ][ # # ]
275 : 0 : }
276 : : }
277 [ # # ]: 0 : return m_xFormatsSupplier;
278 : : }
279 : : // -----------------------------------------------------------------------------
280 : 0 : void SAL_CALL OFormattedField::setFormatsSupplier( const uno::Reference< util::XNumberFormatsSupplier >& _formatssupplier ) throw (uno::RuntimeException)
281 : : {
282 [ # # ]: 0 : set(PROPERTY_FORMATSSUPPLIER,_formatssupplier,m_xFormatsSupplier);
283 : 0 : }
284 : : // -----------------------------------------------------------------------------
285 : : // XChild
286 : 0 : uno::Reference< uno::XInterface > SAL_CALL OFormattedField::getParent( ) throw (uno::RuntimeException)
287 : : {
288 : 0 : return OShapeHelper::getParent(this);
289 : : }
290 : : // -----------------------------------------------------------------------------
291 : 0 : void SAL_CALL OFormattedField::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException)
292 : : {
293 : 0 : OShapeHelper::setParent(Parent,this);
294 : 0 : }
295 : : // -----------------------------------------------------------------------------
296 : 0 : uno::Reference< report::XFormatCondition > SAL_CALL OFormattedField::createFormatCondition( ) throw (uno::Exception, uno::RuntimeException)
297 : : {
298 [ # # ][ # # ]: 0 : return new OFormatCondition(m_aProps.aComponent.m_xContext);
299 : : }
300 : : // -----------------------------------------------------------------------------
301 : : // XContainer
302 : 0 : void SAL_CALL OFormattedField::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
303 : : {
304 : 0 : m_aProps.addContainerListener(xListener);
305 : 0 : }
306 : : // -----------------------------------------------------------------------------
307 : 0 : void SAL_CALL OFormattedField::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
308 : : {
309 : 0 : m_aProps.removeContainerListener(xListener);
310 : 0 : }
311 : : // -----------------------------------------------------------------------------
312 : : // XElementAccess
313 : 0 : uno::Type SAL_CALL OFormattedField::getElementType( ) throw (uno::RuntimeException)
314 : : {
315 : 0 : return ::getCppuType(static_cast< uno::Reference<report::XFormatCondition>*>(NULL));
316 : : }
317 : : // -----------------------------------------------------------------------------
318 : 0 : ::sal_Bool SAL_CALL OFormattedField::hasElements( ) throw (uno::RuntimeException)
319 : : {
320 : 0 : return m_aProps.hasElements();
321 : : }
322 : : // -----------------------------------------------------------------------------
323 : : // XIndexContainer
324 : 0 : void SAL_CALL OFormattedField::insertByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
325 : : {
326 : 0 : m_aProps.insertByIndex(Index,Element);
327 : 0 : }
328 : : // -----------------------------------------------------------------------------
329 : 0 : void SAL_CALL OFormattedField::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
330 : : {
331 : 0 : m_aProps.removeByIndex(Index);
332 : 0 : }
333 : : // -----------------------------------------------------------------------------
334 : : // XIndexReplace
335 : 0 : void SAL_CALL OFormattedField::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
336 : : {
337 : 0 : m_aProps.replaceByIndex(Index,Element);
338 : 0 : }
339 : : // -----------------------------------------------------------------------------
340 : : // XIndexAccess
341 : 0 : ::sal_Int32 SAL_CALL OFormattedField::getCount( ) throw (uno::RuntimeException)
342 : : {
343 : 0 : return m_aProps.getCount();
344 : : }
345 : : // -----------------------------------------------------------------------------
346 : 0 : uno::Any SAL_CALL OFormattedField::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
347 : : {
348 : 0 : return m_aProps.getByIndex( Index );
349 : : }
350 : : // -----------------------------------------------------------------------------
351 : : // XShape
352 : 0 : awt::Point SAL_CALL OFormattedField::getPosition( ) throw (uno::RuntimeException)
353 : : {
354 : 0 : return OShapeHelper::getPosition(this);
355 : : }
356 : : // -----------------------------------------------------------------------------
357 : 0 : void SAL_CALL OFormattedField::setPosition( const awt::Point& aPosition ) throw (uno::RuntimeException)
358 : : {
359 : 0 : OShapeHelper::setPosition(aPosition,this);
360 : 0 : }
361 : : // -----------------------------------------------------------------------------
362 : 0 : awt::Size SAL_CALL OFormattedField::getSize( ) throw (uno::RuntimeException)
363 : : {
364 : 0 : return OShapeHelper::getSize(this);
365 : : }
366 : : // -----------------------------------------------------------------------------
367 : 0 : void SAL_CALL OFormattedField::setSize( const awt::Size& aSize ) throw (beans::PropertyVetoException, uno::RuntimeException)
368 : : {
369 : 0 : OShapeHelper::setSize(aSize,this);
370 : 0 : }
371 : : // -----------------------------------------------------------------------------
372 : :
373 : : // XShapeDescriptor
374 : 0 : ::rtl::OUString SAL_CALL OFormattedField::getShapeType( ) throw (uno::RuntimeException)
375 : : {
376 : 0 : return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape"));
377 : : }
378 : : // -----------------------------------------------------------------------------
379 : : // =============================================================================
380 : : } // namespace reportdesign
381 : : // =============================================================================
382 : :
383 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|