Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include "RegressionCurveModel.hxx"
21 : #include "macros.hxx"
22 : #include "LinePropertiesHelper.hxx"
23 : #include "RegressionCurveHelper.hxx"
24 : #include "RegressionCalculationHelper.hxx"
25 : #include "RegressionEquation.hxx"
26 : #include "ContainerHelper.hxx"
27 : #include "CloneHelper.hxx"
28 : #include "PropertyHelper.hxx"
29 : #include <com/sun/star/beans/PropertyAttribute.hpp>
30 : #include <rtl/math.hxx>
31 : #include <rtl/ustrbuf.hxx>
32 :
33 : using namespace ::com::sun::star;
34 :
35 : using ::com::sun::star::beans::Property;
36 : using ::osl::MutexGuard;
37 :
38 : namespace
39 : {
40 0 : static const OUString lcl_aImplementationName_MeanValue(
41 0 : "com.sun.star.comp.chart2.MeanValueRegressionCurve" );
42 0 : static const OUString lcl_aImplementationName_Linear(
43 0 : "com.sun.star.comp.chart2.LinearRegressionCurve" );
44 0 : static const OUString lcl_aImplementationName_Logarithmic(
45 0 : "com.sun.star.comp.chart2.LogarithmicRegressionCurve" );
46 0 : static const OUString lcl_aImplementationName_Exponential(
47 0 : "com.sun.star.comp.chart2.ExponentialRegressionCurve" );
48 0 : static const OUString lcl_aImplementationName_Potential(
49 0 : "com.sun.star.comp.chart2.PotentialRegressionCurve" );
50 0 : static const OUString lcl_aImplementationName_Polynomial(
51 0 : "com.sun.star.comp.chart2.PolynomialRegressionCurve" );
52 0 : static const OUString lcl_aImplementationName_MovingAverage(
53 0 : "com.sun.star.comp.chart2.MovingAverageRegressionCurve" );
54 :
55 0 : static const OUString lcl_aServiceName(
56 0 : "com.sun.star.chart2.RegressionCurve" );
57 :
58 : enum
59 : {
60 : PROPERTY_DEGREE,
61 : PROPERTY_PERIOD,
62 : PROPERTY_EXTRAPOLATE_FORWARD,
63 : PROPERTY_EXTRAPOLATE_BACKWARD,
64 : PROPERTY_FORCE_INTERCEPT,
65 : PROPERTY_INTERCEPT_VALUE,
66 : PROPERTY_CURVE_NAME
67 : };
68 :
69 0 : void lcl_AddPropertiesToVector(
70 : ::std::vector< Property > & rOutProperties )
71 : {
72 : rOutProperties.push_back(
73 : Property( "PolynomialDegree",
74 : PROPERTY_DEGREE,
75 0 : ::getCppuType( reinterpret_cast< const sal_Int32* >(0)),
76 : beans::PropertyAttribute::BOUND |
77 0 : beans::PropertyAttribute::MAYBEDEFAULT ));
78 :
79 : rOutProperties.push_back(
80 : Property( "MovingAveragePeriod",
81 : PROPERTY_PERIOD,
82 0 : ::getCppuType( reinterpret_cast< const sal_Int32* >(0)),
83 : beans::PropertyAttribute::BOUND |
84 0 : beans::PropertyAttribute::MAYBEDEFAULT ));
85 :
86 : rOutProperties.push_back(
87 : Property( "ExtrapolateForward",
88 : PROPERTY_EXTRAPOLATE_FORWARD,
89 0 : ::getCppuType( reinterpret_cast< const double* >(0) ),
90 : beans::PropertyAttribute::BOUND |
91 0 : beans::PropertyAttribute::MAYBEDEFAULT ));
92 :
93 : rOutProperties.push_back(
94 : Property( "ExtrapolateBackward",
95 : PROPERTY_EXTRAPOLATE_BACKWARD,
96 0 : ::getCppuType( reinterpret_cast< const double* >(0) ),
97 : beans::PropertyAttribute::BOUND |
98 0 : beans::PropertyAttribute::MAYBEDEFAULT ));
99 :
100 : rOutProperties.push_back(
101 : Property( "ForceIntercept",
102 : PROPERTY_FORCE_INTERCEPT,
103 0 : ::getBooleanCppuType(),
104 : beans::PropertyAttribute::BOUND
105 0 : | beans::PropertyAttribute::MAYBEDEFAULT ));
106 :
107 : rOutProperties.push_back(
108 : Property( "InterceptValue",
109 : PROPERTY_INTERCEPT_VALUE,
110 0 : ::getCppuType( reinterpret_cast< const double* >(0) ),
111 : beans::PropertyAttribute::BOUND |
112 0 : beans::PropertyAttribute::MAYBEDEFAULT ));
113 :
114 : rOutProperties.push_back(
115 : Property( "CurveName",
116 : PROPERTY_CURVE_NAME,
117 0 : ::getCppuType( reinterpret_cast< const OUString* >(0) ),
118 0 : beans::PropertyAttribute::BOUND ));
119 0 : }
120 :
121 : struct StaticXXXDefaults_Initializer
122 : {
123 0 : ::chart::tPropertyValueMap* operator()()
124 : {
125 0 : static ::chart::tPropertyValueMap aStaticDefaults;
126 0 : lcl_AddDefaultsToMap( aStaticDefaults );
127 0 : return &aStaticDefaults;
128 : }
129 : private:
130 0 : void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
131 : {
132 0 : ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
133 0 : }
134 : };
135 :
136 : struct StaticXXXDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticXXXDefaults_Initializer >
137 : {
138 : };
139 :
140 : struct StaticRegressionCurveInfoHelper_Initializer
141 : {
142 0 : ::cppu::OPropertyArrayHelper* operator()()
143 : {
144 0 : static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
145 0 : return &aPropHelper;
146 : }
147 :
148 : private:
149 0 : uno::Sequence< Property > lcl_GetPropertySequence()
150 : {
151 0 : ::std::vector< ::com::sun::star::beans::Property > aProperties;
152 0 : lcl_AddPropertiesToVector( aProperties );
153 0 : ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
154 :
155 : ::std::sort( aProperties.begin(), aProperties.end(),
156 0 : ::chart::PropertyNameLess() );
157 :
158 0 : return ::chart::ContainerHelper::ContainerToSequence( aProperties );
159 : }
160 : };
161 :
162 : struct StaticRegressionCurveInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticRegressionCurveInfoHelper_Initializer >
163 : {
164 : };
165 :
166 : struct StaticRegressionCurveInfo_Initializer
167 : {
168 0 : uno::Reference< beans::XPropertySetInfo >* operator()()
169 : {
170 : static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
171 0 : ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticRegressionCurveInfoHelper::get() ) );
172 0 : return &xPropertySetInfo;
173 : }
174 : };
175 :
176 : struct StaticRegressionCurveInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticRegressionCurveInfo_Initializer >
177 : {
178 : };
179 :
180 : } // anonymous namespace
181 :
182 : namespace chart
183 : {
184 :
185 0 : RegressionCurveModel::RegressionCurveModel(
186 : uno::Reference< uno::XComponentContext > const & xContext,
187 : tCurveType eCurveType ) :
188 : ::property::OPropertySet( m_aMutex ),
189 : m_xContext( xContext ),
190 : m_eRegressionCurveType( eCurveType ),
191 : m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()),
192 0 : m_xEquationProperties( new RegressionEquation( xContext ))
193 : {
194 : // set 0 line width (default) hard, so that it is always written to XML,
195 : // because the old implementation uses different defaults
196 : setFastPropertyValue_NoBroadcast(
197 0 : LinePropertiesHelper::PROP_LINE_WIDTH, uno::makeAny( sal_Int32( 0 )));
198 0 : ModifyListenerHelper::addListener( m_xEquationProperties, m_xModifyEventForwarder );
199 0 : }
200 :
201 0 : RegressionCurveModel::RegressionCurveModel( const RegressionCurveModel & rOther ) :
202 : MutexContainer(),
203 : impl::RegressionCurveModel_Base(),
204 : ::property::OPropertySet( rOther, m_aMutex ),
205 : m_xContext( rOther.m_xContext ),
206 : m_eRegressionCurveType( rOther.m_eRegressionCurveType ),
207 0 : m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
208 : {
209 0 : m_xEquationProperties.set( CloneHelper::CreateRefClone< uno::Reference< beans::XPropertySet > >()( rOther.m_xEquationProperties ));
210 0 : ModifyListenerHelper::addListener( m_xEquationProperties, m_xModifyEventForwarder );
211 0 : }
212 :
213 0 : RegressionCurveModel::~RegressionCurveModel()
214 0 : {}
215 :
216 : // ____ XRegressionCurve ____
217 : uno::Reference< chart2::XRegressionCurveCalculator > SAL_CALL
218 0 : RegressionCurveModel::getCalculator()
219 : throw (uno::RuntimeException, std::exception)
220 : {
221 0 : return RegressionCurveHelper::createRegressionCurveCalculatorByServiceName( getServiceName());
222 : }
223 :
224 0 : uno::Reference< beans::XPropertySet > SAL_CALL RegressionCurveModel::getEquationProperties()
225 : throw (uno::RuntimeException, std::exception)
226 : {
227 0 : return m_xEquationProperties;
228 : }
229 :
230 0 : void SAL_CALL RegressionCurveModel::setEquationProperties( const uno::Reference< beans::XPropertySet >& xEquationProperties )
231 : throw (uno::RuntimeException, std::exception)
232 : {
233 0 : if( xEquationProperties.is())
234 : {
235 0 : if( m_xEquationProperties.is())
236 0 : ModifyListenerHelper::removeListener( m_xEquationProperties, m_xModifyEventForwarder );
237 :
238 0 : m_xEquationProperties.set( xEquationProperties );
239 0 : ModifyListenerHelper::addListener( m_xEquationProperties, m_xModifyEventForwarder );
240 0 : fireModifyEvent();
241 : }
242 0 : }
243 :
244 : // ____ XServiceName ____
245 0 : OUString SAL_CALL RegressionCurveModel::getServiceName()
246 : throw (uno::RuntimeException, std::exception)
247 : {
248 0 : switch( m_eRegressionCurveType )
249 : {
250 : case CURVE_TYPE_MEAN_VALUE:
251 0 : return OUString("com.sun.star.chart2.MeanValueRegressionCurve");
252 : case CURVE_TYPE_LINEAR:
253 0 : return OUString("com.sun.star.chart2.LinearRegressionCurve");
254 : case CURVE_TYPE_LOGARITHM:
255 0 : return OUString("com.sun.star.chart2.LogarithmicRegressionCurve");
256 : case CURVE_TYPE_EXPONENTIAL:
257 0 : return OUString("com.sun.star.chart2.ExponentialRegressionCurve");
258 : case CURVE_TYPE_POWER:
259 0 : return OUString("com.sun.star.chart2.PotentialRegressionCurve");
260 : case CURVE_TYPE_POLYNOMIAL:
261 0 : return OUString("com.sun.star.chart2.PolynomialRegressionCurve");
262 : case CURVE_TYPE_MOVING_AVERAGE:
263 0 : return OUString("com.sun.star.chart2.MovingAverageRegressionCurve");
264 : }
265 :
266 0 : return OUString();
267 : }
268 :
269 : // ____ XModifyBroadcaster ____
270 0 : void SAL_CALL RegressionCurveModel::addModifyListener( const uno::Reference< util::XModifyListener >& aListener )
271 : throw (uno::RuntimeException, std::exception)
272 : {
273 : try
274 : {
275 0 : uno::Reference< util::XModifyBroadcaster > xBroadcaster( m_xModifyEventForwarder, uno::UNO_QUERY_THROW );
276 0 : xBroadcaster->addModifyListener( aListener );
277 : }
278 0 : catch( const uno::Exception & ex )
279 : {
280 : ASSERT_EXCEPTION( ex );
281 : }
282 0 : }
283 :
284 0 : void SAL_CALL RegressionCurveModel::removeModifyListener( const uno::Reference< util::XModifyListener >& aListener )
285 : throw (uno::RuntimeException, std::exception)
286 : {
287 : try
288 : {
289 0 : uno::Reference< util::XModifyBroadcaster > xBroadcaster( m_xModifyEventForwarder, uno::UNO_QUERY_THROW );
290 0 : xBroadcaster->removeModifyListener( aListener );
291 : }
292 0 : catch( const uno::Exception & ex )
293 : {
294 : ASSERT_EXCEPTION( ex );
295 : }
296 0 : }
297 :
298 : // ____ XModifyListener ____
299 0 : void SAL_CALL RegressionCurveModel::modified( const lang::EventObject& aEvent )
300 : throw (uno::RuntimeException, std::exception)
301 : {
302 0 : m_xModifyEventForwarder->modified( aEvent );
303 0 : }
304 :
305 : // ____ XEventListener (base of XModifyListener) ____
306 0 : void SAL_CALL RegressionCurveModel::disposing( const lang::EventObject& /* Source */ )
307 : throw (uno::RuntimeException, std::exception)
308 : {
309 : // nothing
310 0 : }
311 :
312 : // ____ OPropertySet ____
313 0 : void RegressionCurveModel::firePropertyChangeEvent()
314 : {
315 0 : fireModifyEvent();
316 0 : }
317 :
318 0 : void RegressionCurveModel::fireModifyEvent()
319 : {
320 0 : m_xModifyEventForwarder->modified( lang::EventObject( static_cast< uno::XWeak* >( this )));
321 0 : }
322 :
323 : // ____ OPropertySet ____
324 0 : uno::Any RegressionCurveModel::GetDefaultValue( sal_Int32 nHandle ) const
325 : throw(beans::UnknownPropertyException)
326 : {
327 0 : const tPropertyValueMap& rStaticDefaults = *StaticXXXDefaults::get();
328 0 : tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
329 0 : if( aFound == rStaticDefaults.end() )
330 0 : return uno::Any();
331 0 : return (*aFound).second;
332 : }
333 :
334 0 : ::cppu::IPropertyArrayHelper & SAL_CALL RegressionCurveModel::getInfoHelper()
335 : {
336 0 : return *StaticRegressionCurveInfoHelper::get();
337 : }
338 :
339 : // ____ XPropertySet ____
340 0 : uno::Reference< beans::XPropertySetInfo > SAL_CALL RegressionCurveModel::getPropertySetInfo()
341 : throw (uno::RuntimeException, std::exception)
342 : {
343 0 : return *StaticRegressionCurveInfo::get();
344 : }
345 :
346 : // needed by MSC compiler
347 : using impl::RegressionCurveModel_Base;
348 :
349 0 : IMPLEMENT_FORWARD_XINTERFACE2( RegressionCurveModel, RegressionCurveModel_Base, OPropertySet )
350 0 : IMPLEMENT_FORWARD_XTYPEPROVIDER2( RegressionCurveModel, RegressionCurveModel_Base, OPropertySet )
351 :
352 : // implementations
353 :
354 0 : MeanValueRegressionCurve::MeanValueRegressionCurve(
355 : const uno::Reference< uno::XComponentContext > & xContext )
356 0 : : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_MEAN_VALUE )
357 0 : {}
358 0 : MeanValueRegressionCurve::MeanValueRegressionCurve(
359 : const MeanValueRegressionCurve & rOther ) :
360 0 : RegressionCurveModel( rOther )
361 0 : {}
362 0 : MeanValueRegressionCurve::~MeanValueRegressionCurve()
363 0 : {}
364 0 : uno::Sequence< OUString > MeanValueRegressionCurve::getSupportedServiceNames_Static()
365 : {
366 0 : uno::Sequence< OUString > aServices( 2 );
367 0 : aServices[ 0 ] = lcl_aServiceName;
368 0 : aServices[ 1 ] = "com.sun.star.chart2.MeanValueRegressionCurve";
369 0 : return aServices;
370 : }
371 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
372 0 : APPHELPER_XSERVICEINFO_IMPL( MeanValueRegressionCurve, lcl_aImplementationName_MeanValue );
373 :
374 0 : uno::Reference< util::XCloneable > SAL_CALL MeanValueRegressionCurve::createClone()
375 : throw (uno::RuntimeException, std::exception)
376 : {
377 0 : return uno::Reference< util::XCloneable >( new MeanValueRegressionCurve( *this ));
378 : }
379 :
380 0 : LinearRegressionCurve::LinearRegressionCurve(
381 : const uno::Reference< uno::XComponentContext > & xContext )
382 0 : : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_LINEAR )
383 0 : {}
384 0 : LinearRegressionCurve::LinearRegressionCurve(
385 : const LinearRegressionCurve & rOther ) :
386 0 : RegressionCurveModel( rOther )
387 0 : {}
388 0 : LinearRegressionCurve::~LinearRegressionCurve()
389 0 : {}
390 0 : uno::Sequence< OUString > LinearRegressionCurve::getSupportedServiceNames_Static()
391 : {
392 0 : uno::Sequence< OUString > aServices( 2 );
393 0 : aServices[ 0 ] = lcl_aServiceName;
394 0 : aServices[ 1 ] = "com.sun.star.chart2.LinearRegressionCurve";
395 0 : return aServices;
396 : }
397 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
398 0 : APPHELPER_XSERVICEINFO_IMPL( LinearRegressionCurve, lcl_aImplementationName_Linear );
399 :
400 0 : uno::Reference< util::XCloneable > SAL_CALL LinearRegressionCurve::createClone()
401 : throw (uno::RuntimeException, std::exception)
402 : {
403 0 : return uno::Reference< util::XCloneable >( new LinearRegressionCurve( *this ));
404 : }
405 :
406 0 : LogarithmicRegressionCurve::LogarithmicRegressionCurve(
407 : const uno::Reference< uno::XComponentContext > & xContext )
408 0 : : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_LOGARITHM )
409 0 : {}
410 0 : LogarithmicRegressionCurve::LogarithmicRegressionCurve(
411 : const LogarithmicRegressionCurve & rOther ) :
412 0 : RegressionCurveModel( rOther )
413 0 : {}
414 0 : LogarithmicRegressionCurve::~LogarithmicRegressionCurve()
415 0 : {}
416 0 : uno::Sequence< OUString > LogarithmicRegressionCurve::getSupportedServiceNames_Static()
417 : {
418 0 : uno::Sequence< OUString > aServices( 2 );
419 0 : aServices[ 0 ] = lcl_aServiceName;
420 0 : aServices[ 1 ] = "com.sun.star.chart2.LogarithmicRegressionCurve";
421 0 : return aServices;
422 : }
423 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
424 0 : APPHELPER_XSERVICEINFO_IMPL( LogarithmicRegressionCurve, lcl_aImplementationName_Logarithmic );
425 :
426 0 : uno::Reference< util::XCloneable > SAL_CALL LogarithmicRegressionCurve::createClone()
427 : throw (uno::RuntimeException, std::exception)
428 : {
429 0 : return uno::Reference< util::XCloneable >( new LogarithmicRegressionCurve( *this ));
430 : }
431 :
432 0 : ExponentialRegressionCurve::ExponentialRegressionCurve(
433 : const uno::Reference< uno::XComponentContext > & xContext )
434 0 : : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_EXPONENTIAL )
435 0 : {}
436 0 : ExponentialRegressionCurve::ExponentialRegressionCurve(
437 : const ExponentialRegressionCurve & rOther ) :
438 0 : RegressionCurveModel( rOther )
439 0 : {}
440 0 : ExponentialRegressionCurve::~ExponentialRegressionCurve()
441 0 : {}
442 0 : uno::Sequence< OUString > ExponentialRegressionCurve::getSupportedServiceNames_Static()
443 : {
444 0 : uno::Sequence< OUString > aServices( 2 );
445 0 : aServices[ 0 ] = lcl_aServiceName;
446 0 : aServices[ 1 ] = "com.sun.star.chart2.ExponentialRegressionCurve";
447 0 : return aServices;
448 : }
449 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
450 0 : APPHELPER_XSERVICEINFO_IMPL( ExponentialRegressionCurve, lcl_aImplementationName_Exponential );
451 :
452 0 : uno::Reference< util::XCloneable > SAL_CALL ExponentialRegressionCurve::createClone()
453 : throw (uno::RuntimeException, std::exception)
454 : {
455 0 : return uno::Reference< util::XCloneable >( new ExponentialRegressionCurve( *this ));
456 : }
457 :
458 0 : PotentialRegressionCurve::PotentialRegressionCurve(
459 : const uno::Reference< uno::XComponentContext > & xContext )
460 0 : : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_POWER )
461 0 : {}
462 0 : PotentialRegressionCurve::PotentialRegressionCurve(
463 : const PotentialRegressionCurve & rOther ) :
464 0 : RegressionCurveModel( rOther )
465 0 : {}
466 0 : PotentialRegressionCurve::~PotentialRegressionCurve()
467 0 : {}
468 0 : uno::Sequence< OUString > PotentialRegressionCurve::getSupportedServiceNames_Static()
469 : {
470 0 : uno::Sequence< OUString > aServices( 2 );
471 0 : aServices[ 0 ] = lcl_aServiceName;
472 0 : aServices[ 1 ] = "com.sun.star.chart2.PotentialRegressionCurve";
473 0 : return aServices;
474 : }
475 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
476 0 : APPHELPER_XSERVICEINFO_IMPL( PotentialRegressionCurve, lcl_aImplementationName_Potential );
477 :
478 0 : uno::Reference< util::XCloneable > SAL_CALL PotentialRegressionCurve::createClone()
479 : throw (uno::RuntimeException, std::exception)
480 : {
481 0 : return uno::Reference< util::XCloneable >( new PotentialRegressionCurve( *this ));
482 : }
483 :
484 0 : PolynomialRegressionCurve::PolynomialRegressionCurve(
485 : const uno::Reference< uno::XComponentContext > & xContext )
486 0 : : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_POLYNOMIAL )
487 0 : {}
488 0 : PolynomialRegressionCurve::PolynomialRegressionCurve(
489 : const PolynomialRegressionCurve & rOther ) :
490 0 : RegressionCurveModel( rOther )
491 0 : {}
492 0 : PolynomialRegressionCurve::~PolynomialRegressionCurve()
493 0 : {}
494 0 : uno::Sequence< OUString > PolynomialRegressionCurve::getSupportedServiceNames_Static()
495 : {
496 0 : uno::Sequence< OUString > aServices( 2 );
497 0 : aServices[ 0 ] = lcl_aServiceName;
498 0 : aServices[ 1 ] = "com.sun.star.chart2.PolynomialRegressionCurve";
499 0 : return aServices;
500 : }
501 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
502 0 : APPHELPER_XSERVICEINFO_IMPL( PolynomialRegressionCurve, lcl_aImplementationName_Polynomial );
503 :
504 0 : uno::Reference< util::XCloneable > SAL_CALL PolynomialRegressionCurve::createClone()
505 : throw (uno::RuntimeException, std::exception)
506 : {
507 0 : return uno::Reference< util::XCloneable >( new PolynomialRegressionCurve( *this ));
508 : }
509 :
510 0 : MovingAverageRegressionCurve::MovingAverageRegressionCurve(
511 : const uno::Reference< uno::XComponentContext > & xContext )
512 0 : : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_MOVING_AVERAGE )
513 0 : {}
514 0 : MovingAverageRegressionCurve::MovingAverageRegressionCurve(
515 : const MovingAverageRegressionCurve & rOther ) :
516 0 : RegressionCurveModel( rOther )
517 0 : {}
518 0 : MovingAverageRegressionCurve::~MovingAverageRegressionCurve()
519 0 : {}
520 0 : uno::Sequence< OUString > MovingAverageRegressionCurve::getSupportedServiceNames_Static()
521 : {
522 0 : uno::Sequence< OUString > aServices( 2 );
523 0 : aServices[ 0 ] = lcl_aServiceName;
524 0 : aServices[ 1 ] = "com.sun.star.chart2.MovingAverageRegressionCurve";
525 0 : return aServices;
526 : }
527 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
528 0 : APPHELPER_XSERVICEINFO_IMPL( MovingAverageRegressionCurve, lcl_aImplementationName_MovingAverage );
529 :
530 0 : uno::Reference< util::XCloneable > SAL_CALL MovingAverageRegressionCurve::createClone()
531 : throw (uno::RuntimeException, std::exception)
532 : {
533 0 : return uno::Reference< util::XCloneable >( new MovingAverageRegressionCurve( *this ));
534 : }
535 :
536 0 : } // namespace chart
537 :
538 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|