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 72 : static const OUString lcl_aImplementationName_MeanValue(
41 36 : "com.sun.star.comp.chart2.MeanValueRegressionCurve" );
42 72 : static const OUString lcl_aImplementationName_Linear(
43 36 : "com.sun.star.comp.chart2.LinearRegressionCurve" );
44 72 : static const OUString lcl_aImplementationName_Logarithmic(
45 36 : "com.sun.star.comp.chart2.LogarithmicRegressionCurve" );
46 72 : static const OUString lcl_aImplementationName_Exponential(
47 36 : "com.sun.star.comp.chart2.ExponentialRegressionCurve" );
48 72 : static const OUString lcl_aImplementationName_Potential(
49 36 : "com.sun.star.comp.chart2.PotentialRegressionCurve" );
50 72 : static const OUString lcl_aImplementationName_Polynomial(
51 36 : "com.sun.star.comp.chart2.PolynomialRegressionCurve" );
52 72 : static const OUString lcl_aImplementationName_MovingAverage(
53 36 : "com.sun.star.comp.chart2.MovingAverageRegressionCurve" );
54 :
55 72 : static const OUString lcl_aServiceName(
56 36 : "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 4 : void lcl_AddPropertiesToVector(
70 : ::std::vector< Property > & rOutProperties )
71 : {
72 : rOutProperties.push_back(
73 : Property( "PolynomialDegree",
74 : PROPERTY_DEGREE,
75 4 : cppu::UnoType<sal_Int32>::get(),
76 : beans::PropertyAttribute::BOUND |
77 8 : beans::PropertyAttribute::MAYBEDEFAULT ));
78 :
79 : rOutProperties.push_back(
80 : Property( "MovingAveragePeriod",
81 : PROPERTY_PERIOD,
82 4 : cppu::UnoType<sal_Int32>::get(),
83 : beans::PropertyAttribute::BOUND |
84 8 : beans::PropertyAttribute::MAYBEDEFAULT ));
85 :
86 : rOutProperties.push_back(
87 : Property( "ExtrapolateForward",
88 : PROPERTY_EXTRAPOLATE_FORWARD,
89 4 : cppu::UnoType<double>::get(),
90 : beans::PropertyAttribute::BOUND |
91 8 : beans::PropertyAttribute::MAYBEDEFAULT ));
92 :
93 : rOutProperties.push_back(
94 : Property( "ExtrapolateBackward",
95 : PROPERTY_EXTRAPOLATE_BACKWARD,
96 4 : cppu::UnoType<double>::get(),
97 : beans::PropertyAttribute::BOUND |
98 8 : beans::PropertyAttribute::MAYBEDEFAULT ));
99 :
100 : rOutProperties.push_back(
101 : Property( "ForceIntercept",
102 : PROPERTY_FORCE_INTERCEPT,
103 4 : ::getBooleanCppuType(),
104 : beans::PropertyAttribute::BOUND
105 8 : | beans::PropertyAttribute::MAYBEDEFAULT ));
106 :
107 : rOutProperties.push_back(
108 : Property( "InterceptValue",
109 : PROPERTY_INTERCEPT_VALUE,
110 4 : cppu::UnoType<double>::get(),
111 : beans::PropertyAttribute::BOUND |
112 8 : beans::PropertyAttribute::MAYBEDEFAULT ));
113 :
114 : rOutProperties.push_back(
115 : Property( "CurveName",
116 : PROPERTY_CURVE_NAME,
117 4 : cppu::UnoType<OUString>::get(),
118 4 : beans::PropertyAttribute::BOUND ));
119 4 : }
120 :
121 : struct StaticXXXDefaults_Initializer
122 : {
123 6 : ::chart::tPropertyValueMap* operator()()
124 : {
125 6 : static ::chart::tPropertyValueMap aStaticDefaults;
126 6 : lcl_AddDefaultsToMap( aStaticDefaults );
127 6 : return &aStaticDefaults;
128 : }
129 : private:
130 6 : void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
131 : {
132 6 : ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
133 6 : }
134 : };
135 :
136 : struct StaticXXXDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticXXXDefaults_Initializer >
137 : {
138 : };
139 :
140 : struct StaticRegressionCurveInfoHelper_Initializer
141 : {
142 4 : ::cppu::OPropertyArrayHelper* operator()()
143 : {
144 4 : static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
145 4 : return &aPropHelper;
146 : }
147 :
148 : private:
149 4 : uno::Sequence< Property > lcl_GetPropertySequence()
150 : {
151 4 : ::std::vector< ::com::sun::star::beans::Property > aProperties;
152 4 : lcl_AddPropertiesToVector( aProperties );
153 4 : ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
154 :
155 : ::std::sort( aProperties.begin(), aProperties.end(),
156 4 : ::chart::PropertyNameLess() );
157 :
158 4 : 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 4 : uno::Reference< beans::XPropertySetInfo >* operator()()
169 : {
170 : static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
171 4 : ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticRegressionCurveInfoHelper::get() ) );
172 4 : 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 56 : 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 56 : 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 56 : LinePropertiesHelper::PROP_LINE_WIDTH, uno::makeAny( sal_Int32( 0 )));
198 56 : ModifyListenerHelper::addListener( m_xEquationProperties, m_xModifyEventForwarder );
199 56 : }
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 54 : RegressionCurveModel::~RegressionCurveModel()
214 54 : {}
215 :
216 : // ____ XRegressionCurve ____
217 : uno::Reference< chart2::XRegressionCurveCalculator > SAL_CALL
218 94 : RegressionCurveModel::getCalculator()
219 : throw (uno::RuntimeException, std::exception)
220 : {
221 94 : return RegressionCurveHelper::createRegressionCurveCalculatorByServiceName( getServiceName());
222 : }
223 :
224 165 : uno::Reference< beans::XPropertySet > SAL_CALL RegressionCurveModel::getEquationProperties()
225 : throw (uno::RuntimeException, std::exception)
226 : {
227 165 : return m_xEquationProperties;
228 : }
229 :
230 24 : void SAL_CALL RegressionCurveModel::setEquationProperties( const uno::Reference< beans::XPropertySet >& xEquationProperties )
231 : throw (uno::RuntimeException, std::exception)
232 : {
233 24 : if( xEquationProperties.is())
234 : {
235 16 : if( m_xEquationProperties.is())
236 16 : ModifyListenerHelper::removeListener( m_xEquationProperties, m_xModifyEventForwarder );
237 :
238 16 : m_xEquationProperties.set( xEquationProperties );
239 16 : ModifyListenerHelper::addListener( m_xEquationProperties, m_xModifyEventForwarder );
240 16 : fireModifyEvent();
241 : }
242 24 : }
243 :
244 : // ____ XServiceName ____
245 353 : OUString SAL_CALL RegressionCurveModel::getServiceName()
246 : throw (uno::RuntimeException, std::exception)
247 : {
248 353 : switch( m_eRegressionCurveType )
249 : {
250 : case CURVE_TYPE_MEAN_VALUE:
251 125 : return OUString("com.sun.star.chart2.MeanValueRegressionCurve");
252 : case CURVE_TYPE_LINEAR:
253 76 : 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 76 : return OUString("com.sun.star.chart2.PolynomialRegressionCurve");
262 : case CURVE_TYPE_MOVING_AVERAGE:
263 76 : return OUString("com.sun.star.chart2.MovingAverageRegressionCurve");
264 : }
265 :
266 0 : return OUString();
267 : }
268 :
269 : // ____ XModifyBroadcaster ____
270 44 : void SAL_CALL RegressionCurveModel::addModifyListener( const uno::Reference< util::XModifyListener >& aListener )
271 : throw (uno::RuntimeException, std::exception)
272 : {
273 : try
274 : {
275 44 : uno::Reference< util::XModifyBroadcaster > xBroadcaster( m_xModifyEventForwarder, uno::UNO_QUERY_THROW );
276 44 : xBroadcaster->addModifyListener( aListener );
277 : }
278 0 : catch( const uno::Exception & ex )
279 : {
280 : ASSERT_EXCEPTION( ex );
281 : }
282 44 : }
283 :
284 42 : void SAL_CALL RegressionCurveModel::removeModifyListener( const uno::Reference< util::XModifyListener >& aListener )
285 : throw (uno::RuntimeException, std::exception)
286 : {
287 : try
288 : {
289 42 : uno::Reference< util::XModifyBroadcaster > xBroadcaster( m_xModifyEventForwarder, uno::UNO_QUERY_THROW );
290 42 : xBroadcaster->removeModifyListener( aListener );
291 : }
292 0 : catch( const uno::Exception & ex )
293 : {
294 : ASSERT_EXCEPTION( ex );
295 : }
296 42 : }
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 122 : void RegressionCurveModel::firePropertyChangeEvent()
314 : {
315 122 : fireModifyEvent();
316 122 : }
317 :
318 138 : void RegressionCurveModel::fireModifyEvent()
319 : {
320 138 : m_xModifyEventForwarder->modified( lang::EventObject( static_cast< uno::XWeak* >( this )));
321 138 : }
322 :
323 : // ____ OPropertySet ____
324 1338 : uno::Any RegressionCurveModel::GetDefaultValue( sal_Int32 nHandle ) const
325 : throw(beans::UnknownPropertyException)
326 : {
327 1338 : const tPropertyValueMap& rStaticDefaults = *StaticXXXDefaults::get();
328 1338 : tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
329 1338 : if( aFound == rStaticDefaults.end() )
330 656 : return uno::Any();
331 682 : return (*aFound).second;
332 : }
333 :
334 3490 : ::cppu::IPropertyArrayHelper & SAL_CALL RegressionCurveModel::getInfoHelper()
335 : {
336 3490 : return *StaticRegressionCurveInfoHelper::get();
337 : }
338 :
339 : // ____ XPropertySet ____
340 82 : uno::Reference< beans::XPropertySetInfo > SAL_CALL RegressionCurveModel::getPropertySetInfo()
341 : throw (uno::RuntimeException, std::exception)
342 : {
343 82 : return *StaticRegressionCurveInfo::get();
344 : }
345 :
346 : // needed by MSC compiler
347 : using impl::RegressionCurveModel_Base;
348 :
349 7637 : IMPLEMENT_FORWARD_XINTERFACE2( RegressionCurveModel, RegressionCurveModel_Base, OPropertySet )
350 0 : IMPLEMENT_FORWARD_XTYPEPROVIDER2( RegressionCurveModel, RegressionCurveModel_Base, OPropertySet )
351 :
352 : // implementations
353 :
354 8 : MeanValueRegressionCurve::MeanValueRegressionCurve(
355 : const uno::Reference< uno::XComponentContext > & xContext )
356 8 : : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_MEAN_VALUE )
357 8 : {}
358 0 : MeanValueRegressionCurve::MeanValueRegressionCurve(
359 : const MeanValueRegressionCurve & rOther ) :
360 0 : RegressionCurveModel( rOther )
361 0 : {}
362 12 : MeanValueRegressionCurve::~MeanValueRegressionCurve()
363 12 : {}
364 2 : uno::Sequence< OUString > MeanValueRegressionCurve::getSupportedServiceNames_Static()
365 : {
366 2 : uno::Sequence< OUString > aServices( 2 );
367 2 : aServices[ 0 ] = lcl_aServiceName;
368 2 : aServices[ 1 ] = "com.sun.star.chart2.MeanValueRegressionCurve";
369 2 : return aServices;
370 : }
371 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
372 98 : 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 14 : LinearRegressionCurve::LinearRegressionCurve(
381 : const uno::Reference< uno::XComponentContext > & xContext )
382 14 : : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_LINEAR )
383 14 : {}
384 0 : LinearRegressionCurve::LinearRegressionCurve(
385 : const LinearRegressionCurve & rOther ) :
386 0 : RegressionCurveModel( rOther )
387 0 : {}
388 28 : LinearRegressionCurve::~LinearRegressionCurve()
389 28 : {}
390 4 : uno::Sequence< OUString > LinearRegressionCurve::getSupportedServiceNames_Static()
391 : {
392 4 : uno::Sequence< OUString > aServices( 2 );
393 4 : aServices[ 0 ] = lcl_aServiceName;
394 4 : aServices[ 1 ] = "com.sun.star.chart2.LinearRegressionCurve";
395 4 : return aServices;
396 : }
397 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
398 94 : 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 2 : LogarithmicRegressionCurve::LogarithmicRegressionCurve(
407 : const uno::Reference< uno::XComponentContext > & xContext )
408 2 : : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_LOGARITHM )
409 2 : {}
410 0 : LogarithmicRegressionCurve::LogarithmicRegressionCurve(
411 : const LogarithmicRegressionCurve & rOther ) :
412 0 : RegressionCurveModel( rOther )
413 0 : {}
414 4 : LogarithmicRegressionCurve::~LogarithmicRegressionCurve()
415 4 : {}
416 2 : uno::Sequence< OUString > LogarithmicRegressionCurve::getSupportedServiceNames_Static()
417 : {
418 2 : uno::Sequence< OUString > aServices( 2 );
419 2 : aServices[ 0 ] = lcl_aServiceName;
420 2 : aServices[ 1 ] = "com.sun.star.chart2.LogarithmicRegressionCurve";
421 2 : return aServices;
422 : }
423 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
424 94 : 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 2 : ExponentialRegressionCurve::ExponentialRegressionCurve(
433 : const uno::Reference< uno::XComponentContext > & xContext )
434 2 : : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_EXPONENTIAL )
435 2 : {}
436 0 : ExponentialRegressionCurve::ExponentialRegressionCurve(
437 : const ExponentialRegressionCurve & rOther ) :
438 0 : RegressionCurveModel( rOther )
439 0 : {}
440 4 : ExponentialRegressionCurve::~ExponentialRegressionCurve()
441 4 : {}
442 2 : uno::Sequence< OUString > ExponentialRegressionCurve::getSupportedServiceNames_Static()
443 : {
444 2 : uno::Sequence< OUString > aServices( 2 );
445 2 : aServices[ 0 ] = lcl_aServiceName;
446 2 : aServices[ 1 ] = "com.sun.star.chart2.ExponentialRegressionCurve";
447 2 : return aServices;
448 : }
449 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
450 94 : 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 2 : PotentialRegressionCurve::PotentialRegressionCurve(
459 : const uno::Reference< uno::XComponentContext > & xContext )
460 2 : : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_POWER )
461 2 : {}
462 0 : PotentialRegressionCurve::PotentialRegressionCurve(
463 : const PotentialRegressionCurve & rOther ) :
464 0 : RegressionCurveModel( rOther )
465 0 : {}
466 4 : PotentialRegressionCurve::~PotentialRegressionCurve()
467 4 : {}
468 2 : uno::Sequence< OUString > PotentialRegressionCurve::getSupportedServiceNames_Static()
469 : {
470 2 : uno::Sequence< OUString > aServices( 2 );
471 2 : aServices[ 0 ] = lcl_aServiceName;
472 2 : aServices[ 1 ] = "com.sun.star.chart2.PotentialRegressionCurve";
473 2 : return aServices;
474 : }
475 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
476 94 : 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 14 : PolynomialRegressionCurve::PolynomialRegressionCurve(
485 : const uno::Reference< uno::XComponentContext > & xContext )
486 14 : : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_POLYNOMIAL )
487 14 : {}
488 0 : PolynomialRegressionCurve::PolynomialRegressionCurve(
489 : const PolynomialRegressionCurve & rOther ) :
490 0 : RegressionCurveModel( rOther )
491 0 : {}
492 28 : PolynomialRegressionCurve::~PolynomialRegressionCurve()
493 28 : {}
494 4 : uno::Sequence< OUString > PolynomialRegressionCurve::getSupportedServiceNames_Static()
495 : {
496 4 : uno::Sequence< OUString > aServices( 2 );
497 4 : aServices[ 0 ] = lcl_aServiceName;
498 4 : aServices[ 1 ] = "com.sun.star.chart2.PolynomialRegressionCurve";
499 4 : return aServices;
500 : }
501 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
502 94 : 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 14 : MovingAverageRegressionCurve::MovingAverageRegressionCurve(
511 : const uno::Reference< uno::XComponentContext > & xContext )
512 14 : : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_MOVING_AVERAGE )
513 14 : {}
514 0 : MovingAverageRegressionCurve::MovingAverageRegressionCurve(
515 : const MovingAverageRegressionCurve & rOther ) :
516 0 : RegressionCurveModel( rOther )
517 0 : {}
518 28 : MovingAverageRegressionCurve::~MovingAverageRegressionCurve()
519 28 : {}
520 4 : uno::Sequence< OUString > MovingAverageRegressionCurve::getSupportedServiceNames_Static()
521 : {
522 4 : uno::Sequence< OUString > aServices( 2 );
523 4 : aServices[ 0 ] = lcl_aServiceName;
524 4 : aServices[ 1 ] = "com.sun.star.chart2.MovingAverageRegressionCurve";
525 4 : return aServices;
526 : }
527 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
528 94 : 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 108 : } // namespace chart
537 :
538 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|