LCOV - code coverage report
Current view: top level - chart2/source/tools - RegressionCurveModel.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 177 231 76.6 %
Date: 2014-04-11 Functions: 59 100 59.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10