diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2013-07-01 22:16:15 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2013-07-03 21:46:47 +0200 |
commit | b0fbaa6fa28df570e8179f166fe0547892b2dbc7 (patch) | |
tree | 5022046f89fb5487814de963d710086c44acaf67 /chart2/source/controller/main/ControllerCommandDispatch.cxx | |
parent | 0a21c4faea3a444a3b6c5a7561754c73310fb77c (diff) |
Adding multiple trendlines with menu item Insert>Trend Lines..
Menu item "Insert>Trend Lines.." allowed adding trendlines for all
data series at the same time. As we can now have more trendlines
per one data series this becomes cumbersome so only allow to add
a trend line when data series is selected or known.
Change-Id: I676876f389d00d3fbe668d429f0f98bd8c8d4d3d
Diffstat (limited to 'chart2/source/controller/main/ControllerCommandDispatch.cxx')
-rw-r--r-- | chart2/source/controller/main/ControllerCommandDispatch.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index 6731998599c2..abb74fc634af 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -117,6 +117,7 @@ struct ControllerState bool bMayMoveSeriesBackward; // trendlines + bool bMayAddMenuTrendline; bool bMayAddTrendline; bool bMayAddTrendlineEquation; bool bMayAddR2Value; @@ -147,6 +148,7 @@ ControllerState::ControllerState() : bIsFormateableObjectSelected(false), bMayMoveSeriesForward( false ), bMayMoveSeriesBackward( false ), + bMayAddMenuTrendline( false ), bMayAddTrendline( false ), bMayAddTrendlineEquation( false ), bMayAddR2Value( false ), @@ -208,6 +210,7 @@ void ControllerState::update( xGivenDataSeries, MOVE_SERIES_BACKWARD ); + bMayAddMenuTrendline = false; bMayAddTrendline = false; bMayAddTrendlineEquation = false; bMayAddR2Value = false; @@ -229,6 +232,7 @@ void ControllerState::update( { if( xGivenDataSeries.is()) { + bMayAddMenuTrendline = true; sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram ); uno::Reference< chart2::XChartType > xFirstChartType( DataSeriesHelper::getChartTypeOfSeries( xGivenDataSeries, xDiagram )); @@ -237,11 +241,9 @@ void ControllerState::update( if( (OBJECTTYPE_DATA_SERIES == aObjectType || OBJECTTYPE_DATA_POINT == aObjectType) && ChartTypeHelper::isSupportingRegressionProperties( xFirstChartType, nDimensionCount )) { - uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt( - xGivenDataSeries, uno::UNO_QUERY ); + uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt( xGivenDataSeries, uno::UNO_QUERY ); if( xRegCurveCnt.is()) { - uno::Reference< chart2::XRegressionCurve > xRegCurve( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) ); // Trendline bMayAddTrendline = true; @@ -578,7 +580,7 @@ void ControllerCommandDispatch::updateCommandAvailability() m_aCommandAvailability[ ".uno:InsertMenuDataLabels" ] = bIsWritable; m_aCommandAvailability[ ".uno:InsertRemoveAxes" ] = m_aCommandAvailability[ ".uno:InsertMenuAxes" ] = bIsWritable && m_apModelState->bSupportsAxes; m_aCommandAvailability[ ".uno:InsertMenuGrids" ] = bIsWritable && m_apModelState->bSupportsAxes; - m_aCommandAvailability[ ".uno:InsertMenuTrendlines" ] = bIsWritable && m_apModelState->bSupportsStatistics; + m_aCommandAvailability[ ".uno:InsertMenuTrendlines" ] = bIsWritable && m_apModelState->bSupportsStatistics && m_apControllerState->bMayAddMenuTrendline; m_aCommandAvailability[ ".uno:InsertMenuMeanValues" ] = bIsWritable && m_apModelState->bSupportsStatistics; m_aCommandAvailability[ ".uno:InsertMenuXErrorBars" ] = bIsWritable && m_apModelState->bSupportsStatistics; m_aCommandAvailability[ ".uno:InsertMenuYErrorBars" ] = bIsWritable && m_apModelState->bSupportsStatistics; |