diff options
author | Noel Grandin <noel@peralex.com> | 2016-08-24 13:21:36 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-08-25 08:40:00 +0200 |
commit | 2927a5c1c70b66062cc2b60f6f4eb7cf6c727d2c (patch) | |
tree | 038daf69a2a5103d97d2e285df3fd4fb19745d88 /chart2/source | |
parent | 8387ca6817f2fafcbb9c3bd9df76c91e93d4f772 (diff) |
convert SvxChartRegress to scoped enum
Change-Id: Ibdaad10c7936a0e53ab61c2016c8c9f3ac278767
Diffstat (limited to 'chart2/source')
7 files changed, 54 insertions, 54 deletions
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx index d81103e4c04a..3a4c801e31ba 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx @@ -60,22 +60,22 @@ css::chart::ChartRegressionCurveType lcl_getRegressionCurveType(SvxChartRegress css::chart::ChartRegressionCurveType eRet = css::chart::ChartRegressionCurveType_NONE; switch(eRegressionType) { - case CHREGRESS_LINEAR: + case SvxChartRegress::Linear: eRet = css::chart::ChartRegressionCurveType_LINEAR; break; - case CHREGRESS_LOG: + case SvxChartRegress::Log: eRet = css::chart::ChartRegressionCurveType_LOGARITHM; break; - case CHREGRESS_EXP: + case SvxChartRegress::Exp: eRet = css::chart::ChartRegressionCurveType_EXPONENTIAL; break; - case CHREGRESS_POWER: + case SvxChartRegress::Power: eRet = css::chart::ChartRegressionCurveType_POWER; break; - case CHREGRESS_POLYNOMIAL: + case SvxChartRegress::Polynomial: eRet = css::chart::ChartRegressionCurveType_POLYNOMIAL; break; - /*case CHREGRESS_MOVING_AVERAGE: + /*case SvxChartRegress::MovingAverage: eRet = css::chart::ChartRegressionCurveType_MOVING_AVERAGE; break;*/ default: @@ -91,21 +91,21 @@ SvxChartRegress lcl_getRegressionType( css::chart::ChartRegressionCurveType eReg switch (eRegressionCurveType) { case css::chart::ChartRegressionCurveType_LINEAR: - eRet = CHREGRESS_LINEAR; + eRet = SvxChartRegress::Linear; break; case css::chart::ChartRegressionCurveType_LOGARITHM: - eRet = CHREGRESS_LOG; + eRet = SvxChartRegress::Log; break; case css::chart::ChartRegressionCurveType_EXPONENTIAL: - eRet = CHREGRESS_EXP; + eRet = SvxChartRegress::Exp; break; case css::chart::ChartRegressionCurveType_POLYNOMIAL: //case css::chart::ChartRegressionCurveType_MOVING_AVERAGE: case css::chart::ChartRegressionCurveType_POWER: - eRet = CHREGRESS_POWER; + eRet = SvxChartRegress::Power; break; default: - eRet = CHREGRESS_NONE; + eRet = SvxChartRegress::NONE; break; } return eRet; diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx index dbd77e690548..034a63b756f5 100644 --- a/chart2/source/controller/dialogs/res_Trendline.cxx +++ b/chart2/source/controller/dialogs/res_Trendline.cxx @@ -40,7 +40,7 @@ void lcl_setValue( FormattedField& rFmtField, double fValue ) } TrendlineResources::TrendlineResources( vcl::Window * pParent, const SfxItemSet& rInAttrs ) : - m_eTrendLineType( CHREGRESS_LINEAR ), + m_eTrendLineType( SvxChartRegress::Linear ), m_bTrendLineUnique( true ), m_pNumFormatter( nullptr ), m_nNbPoints( 0 ) @@ -96,17 +96,17 @@ TrendlineResources::~TrendlineResources() IMPL_LINK_TYPED( TrendlineResources, SelectTrendLine, Button *, pRadioButton, void ) { if( pRadioButton == m_pRB_Linear ) - m_eTrendLineType = CHREGRESS_LINEAR; + m_eTrendLineType = SvxChartRegress::Linear; else if( pRadioButton == m_pRB_Logarithmic ) - m_eTrendLineType = CHREGRESS_LOG; + m_eTrendLineType = SvxChartRegress::Log; else if( pRadioButton == m_pRB_Exponential ) - m_eTrendLineType = CHREGRESS_EXP; + m_eTrendLineType = SvxChartRegress::Exp; else if( pRadioButton == m_pRB_Power ) - m_eTrendLineType = CHREGRESS_POWER; + m_eTrendLineType = SvxChartRegress::Power; else if( pRadioButton == m_pRB_Polynomial ) - m_eTrendLineType = CHREGRESS_POLYNOMIAL; + m_eTrendLineType = SvxChartRegress::Polynomial; else if( pRadioButton == m_pRB_MovingAverage ) - m_eTrendLineType = CHREGRESS_MOVING_AVERAGE; + m_eTrendLineType = SvxChartRegress::MovingAverage; m_bTrendLineUnique = true; UpdateControlStates(); @@ -239,22 +239,22 @@ void TrendlineResources::Reset( const SfxItemSet& rInAttrs ) { switch( m_eTrendLineType ) { - case CHREGRESS_LINEAR : + case SvxChartRegress::Linear : m_pRB_Linear->Check(); break; - case CHREGRESS_LOG : + case SvxChartRegress::Log : m_pRB_Logarithmic->Check(); break; - case CHREGRESS_EXP : + case SvxChartRegress::Exp : m_pRB_Exponential->Check(); break; - case CHREGRESS_POWER : + case SvxChartRegress::Power : m_pRB_Power->Check(); break; - case CHREGRESS_POLYNOMIAL : + case SvxChartRegress::Polynomial : m_pRB_Polynomial->Check(); break; - case CHREGRESS_MOVING_AVERAGE : + case SvxChartRegress::MovingAverage : m_pRB_MovingAverage->Check(); break; default: @@ -329,10 +329,10 @@ void TrendlineResources::UpdateControlStates() m_pNF_Degree->SetMax( nMaxValue ); m_pNF_Period->SetMax( m_nNbPoints - 1 ); } - bool bMovingAverage = ( m_eTrendLineType == CHREGRESS_MOVING_AVERAGE ); - bool bInterceptAvailable = ( m_eTrendLineType == CHREGRESS_LINEAR ) - || ( m_eTrendLineType == CHREGRESS_POLYNOMIAL ) - || ( m_eTrendLineType == CHREGRESS_EXP ); + bool bMovingAverage = ( m_eTrendLineType == SvxChartRegress::MovingAverage ); + bool bInterceptAvailable = ( m_eTrendLineType == SvxChartRegress::Linear ) + || ( m_eTrendLineType == SvxChartRegress::Polynomial ) + || ( m_eTrendLineType == SvxChartRegress::Exp ); m_pFmtFld_ExtrapolateForward->Enable( !bMovingAverage ); m_pFmtFld_ExtrapolateBackward->Enable( !bMovingAverage ); m_pCB_SetIntercept->Enable( bInterceptAvailable ); diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx index b99d19afa9bd..cdea9738f74c 100644 --- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx @@ -118,12 +118,12 @@ uno::Reference< beans::XPropertySet > lcl_getEquationProperties( // ensure that a trendline is on if( pItemSet ) { - SvxChartRegress eRegress = CHREGRESS_NONE; + SvxChartRegress eRegress = SvxChartRegress::NONE; const SfxPoolItem *pPoolItem = nullptr; if( pItemSet->GetItemState( SCHATTR_REGRESSION_TYPE, true, &pPoolItem ) == SfxItemState::SET ) { eRegress = static_cast< const SvxChartRegressItem * >( pPoolItem )->GetValue(); - bEquationExists = ( eRegress != CHREGRESS_NONE ); + bEquationExists = ( eRegress != SvxChartRegress::NONE ); } } @@ -149,12 +149,12 @@ uno::Reference< beans::XPropertySet > lcl_getCurveProperties( // ensure that a trendline is on if( pItemSet ) { - SvxChartRegress eRegress = CHREGRESS_NONE; + SvxChartRegress eRegress = SvxChartRegress::NONE; const SfxPoolItem *pPoolItem = nullptr; if( pItemSet->GetItemState( SCHATTR_REGRESSION_TYPE, true, &pPoolItem ) == SfxItemState::SET ) { eRegress = static_cast< const SvxChartRegressItem * >( pPoolItem )->GetValue(); - bExists = ( eRegress != CHREGRESS_NONE ); + bExists = ( eRegress != SvxChartRegress::NONE ); } } @@ -420,7 +420,7 @@ bool StatisticsItemConverter::ApplySpecialItem( uno::Reference< chart2::XRegressionCurve > xCurve( GetPropertySet(), uno::UNO_QUERY ); uno::Reference< chart2::XRegressionCurveContainer > xContainer( GetPropertySet(), uno::UNO_QUERY ); - if( eRegress == CHREGRESS_NONE ) + if( eRegress == SvxChartRegress::NONE ) { if ( xContainer.is() ) { diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index 38819c7596b1..fe7fef344d8b 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -367,7 +367,7 @@ void ChartController::executeDispatch_InsertTrendline() uno::Reference< chart2::XRegressionCurve > xCurve = RegressionCurveHelper::addRegressionCurve( - CHREGRESS_LINEAR, + SvxChartRegress::Linear, xRegressionCurveContainer, m_xCC ); diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx index 7147dda6cb69..43b36ddbe01e 100644 --- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx +++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx @@ -167,7 +167,7 @@ void setTrendlineVisible(const css::uno::Reference<css::frame::XModel>& /* code */ uno::Reference< chart2::XRegressionCurve > xCurve = RegressionCurveHelper::addRegressionCurve( - CHREGRESS_LINEAR, + SvxChartRegress::Linear, xRegressionCurveContainer, comphelper::getProcessComponentContext()); } diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx index 4cc6d69dc427..084cc2fffaa0 100644 --- a/chart2/source/tools/RegressionCurveHelper.cxx +++ b/chart2/source/tools/RegressionCurveHelper.cxx @@ -53,22 +53,22 @@ OUString lcl_getServiceNameForType(SvxChartRegress eType) OUString aServiceName; switch( eType ) { - case CHREGRESS_LINEAR: + case SvxChartRegress::Linear: aServiceName = "com.sun.star.chart2.LinearRegressionCurve"; break; - case CHREGRESS_LOG: + case SvxChartRegress::Log: aServiceName = "com.sun.star.chart2.LogarithmicRegressionCurve"; break; - case CHREGRESS_EXP: + case SvxChartRegress::Exp: aServiceName = "com.sun.star.chart2.ExponentialRegressionCurve"; break; - case CHREGRESS_POWER: + case SvxChartRegress::Power: aServiceName = "com.sun.star.chart2.PotentialRegressionCurve"; break; - case CHREGRESS_POLYNOMIAL: + case SvxChartRegress::Polynomial: aServiceName = "com.sun.star.chart2.PolynomialRegressionCurve"; break; - case CHREGRESS_MOVING_AVERAGE: + case SvxChartRegress::MovingAverage: aServiceName = "com.sun.star.chart2.MovingAverageRegressionCurve"; break; default: @@ -362,7 +362,7 @@ uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::addRegressionC if( !xRegressionCurveContainer.is() ) return xCurve; - if( eType == CHREGRESS_NONE ) + if( eType == SvxChartRegress::NONE ) { OSL_FAIL("don't create a regression curve of type none"); return xCurve; @@ -539,7 +539,7 @@ uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::getRegressionC SvxChartRegress RegressionCurveHelper::getRegressionType( const Reference< XRegressionCurve > & xCurve ) { - SvxChartRegress eResult = CHREGRESS_UNKNOWN; + SvxChartRegress eResult = SvxChartRegress::Unknown; try { @@ -550,31 +550,31 @@ SvxChartRegress RegressionCurveHelper::getRegressionType( if( aServiceName == "com.sun.star.chart2.LinearRegressionCurve" ) { - eResult = CHREGRESS_LINEAR; + eResult = SvxChartRegress::Linear; } else if( aServiceName == "com.sun.star.chart2.LogarithmicRegressionCurve" ) { - eResult = CHREGRESS_LOG; + eResult = SvxChartRegress::Log; } else if( aServiceName == "com.sun.star.chart2.ExponentialRegressionCurve" ) { - eResult = CHREGRESS_EXP; + eResult = SvxChartRegress::Exp; } else if( aServiceName == "com.sun.star.chart2.PotentialRegressionCurve" ) { - eResult = CHREGRESS_POWER; + eResult = SvxChartRegress::Power; } else if( aServiceName == "com.sun.star.chart2.MeanValueRegressionCurve" ) { - eResult = CHREGRESS_MEAN_VALUE; + eResult = SvxChartRegress::MeanValue; } else if( aServiceName == "com.sun.star.chart2.PolynomialRegressionCurve" ) { - eResult = CHREGRESS_POLYNOMIAL; + eResult = SvxChartRegress::Polynomial; } else if( aServiceName == "com.sun.star.chart2.MovingAverageRegressionCurve" ) { - eResult = CHREGRESS_MOVING_AVERAGE; + eResult = SvxChartRegress::MovingAverage; } } } @@ -589,7 +589,7 @@ SvxChartRegress RegressionCurveHelper::getRegressionType( SvxChartRegress RegressionCurveHelper::getFirstRegressTypeNotMeanValueLine( const Reference< XRegressionCurveContainer > & xRegCnt ) { - SvxChartRegress eResult = CHREGRESS_NONE; + SvxChartRegress eResult = SvxChartRegress::NONE; if( xRegCnt.is()) { @@ -598,8 +598,8 @@ SvxChartRegress RegressionCurveHelper::getFirstRegressTypeNotMeanValueLine( for( sal_Int32 i = 0; i < aCurves.getLength(); ++i ) { SvxChartRegress eType = getRegressionType( aCurves[i] ); - if( eType != CHREGRESS_MEAN_VALUE && - eType != CHREGRESS_UNKNOWN ) + if( eType != SvxChartRegress::MeanValue && + eType != SvxChartRegress::Unknown ) { eResult = eType; break; diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx index c1a9abf3eaff..0601bacc3d96 100644 --- a/chart2/source/view/main/ChartItemPool.cxx +++ b/chart2/source/view/main/ChartItemPool.cxx @@ -148,7 +148,7 @@ ChartItemPool::ChartItemPool(): ppPoolDefaults[SCHATTR_AXIS_FOR_ALL_SERIES - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_FOR_ALL_SERIES, 0); - ppPoolDefaults[SCHATTR_REGRESSION_TYPE - SCHATTR_START] = new SvxChartRegressItem (CHREGRESS_NONE, SCHATTR_REGRESSION_TYPE); + ppPoolDefaults[SCHATTR_REGRESSION_TYPE - SCHATTR_START] = new SvxChartRegressItem (SvxChartRegress::NONE, SCHATTR_REGRESSION_TYPE); ppPoolDefaults[SCHATTR_REGRESSION_SHOW_EQUATION - SCHATTR_START] = new SfxBoolItem(SCHATTR_REGRESSION_SHOW_EQUATION, false); ppPoolDefaults[SCHATTR_REGRESSION_SHOW_COEFF - SCHATTR_START] = new SfxBoolItem(SCHATTR_REGRESSION_SHOW_COEFF, false); ppPoolDefaults[SCHATTR_REGRESSION_DEGREE - SCHATTR_START] = new SfxInt32Item(SCHATTR_REGRESSION_DEGREE, 2); |