Kaydet (Commit) 7302c4f6 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

Change series and trendline pop-up to support more trendlines.

Conflicts:
	chart2/source/controller/main/ChartController_Window.cxx

Change-Id: I70eb06d74670f54fa3792723711e9f73700f12ba
üst 01fc2a65
...@@ -1301,7 +1301,7 @@ void SAL_CALL ChartController::executeDispatch_ChartType() ...@@ -1301,7 +1301,7 @@ void SAL_CALL ChartController::executeDispatch_ChartType()
void SAL_CALL ChartController::executeDispatch_SourceData() void SAL_CALL ChartController::executeDispatch_SourceData()
{ {
git gr //convert properties to ItemSet //convert properties to ItemSet
uno::Reference< XChartDocument > xChartDoc( getModel(), uno::UNO_QUERY ); uno::Reference< XChartDocument > xChartDoc( getModel(), uno::UNO_QUERY );
OSL_ENSURE( xChartDoc.is(), "Invalid XChartDocument" ); OSL_ENSURE( xChartDoc.is(), "Invalid XChartDocument" );
if( !xChartDoc.is()) if( !xChartDoc.is())
......
...@@ -242,12 +242,12 @@ void ControllerState::update( ...@@ -242,12 +242,12 @@ void ControllerState::update(
if( xRegCurveCnt.is()) if( xRegCurveCnt.is())
{ {
uno::Reference< chart2::XRegressionCurve > xRegCurve( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) ); uno::Reference< chart2::XRegressionCurve > xRegCurve( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) );
bMayFormatTrendline = bMayDeleteTrendline = xRegCurve.is(); // Trendline
bMayAddTrendline = true;
// Mean Value
bMayFormatMeanValue = bMayDeleteMeanValue = RegressionCurveHelper::hasMeanValueLine( xRegCurveCnt ); bMayFormatMeanValue = bMayDeleteMeanValue = RegressionCurveHelper::hasMeanValueLine( xRegCurveCnt );
bMayAddTrendline = ! bMayDeleteTrendline;
bMayAddMeanValue = ! bMayDeleteMeanValue; bMayAddMeanValue = ! bMayDeleteMeanValue;
bMayFormatTrendlineEquation = bMayDeleteTrendlineEquation = RegressionCurveHelper::hasEquation( xRegCurve );
bMayAddTrendlineEquation = !bMayDeleteTrendlineEquation;
} }
} }
...@@ -275,8 +275,11 @@ void ControllerState::update( ...@@ -275,8 +275,11 @@ void ControllerState::update(
if( aObjectType == OBJECTTYPE_DATA_CURVE ) if( aObjectType == OBJECTTYPE_DATA_CURVE )
{ {
bMayFormatTrendline = true; bMayFormatTrendline = true;
bMayDeleteTrendline = true;
uno::Reference< chart2::XRegressionCurve > xRegCurve( uno::Reference< chart2::XRegressionCurve > xRegCurve(
ObjectIdentifier::getObjectPropertySet( aSelObjCID, xModel ), uno::UNO_QUERY ); ObjectIdentifier::getObjectPropertySet( aSelObjCID, xModel ), uno::UNO_QUERY );
// Trendline Equation
bMayFormatTrendlineEquation = bMayDeleteTrendlineEquation = RegressionCurveHelper::hasEquation( xRegCurve ); bMayFormatTrendlineEquation = bMayDeleteTrendlineEquation = RegressionCurveHelper::hasEquation( xRegCurve );
bMayAddTrendlineEquation = !bMayDeleteTrendlineEquation; bMayAddTrendlineEquation = !bMayDeleteTrendlineEquation;
} }
...@@ -286,10 +289,10 @@ void ControllerState::update( ...@@ -286,10 +289,10 @@ void ControllerState::update(
bool bHasR2Value = false; bool bHasR2Value = false;
try try
{ {
uno::Reference< beans::XPropertySet > xEqProp( uno::Reference< beans::XPropertySet > xEquationProperties(
ObjectIdentifier::getObjectPropertySet( aSelObjCID, xModel ), uno::UNO_QUERY ); ObjectIdentifier::getObjectPropertySet( aSelObjCID, xModel ), uno::UNO_QUERY );
if( xEqProp.is()) if( xEquationProperties.is() )
xEqProp->getPropertyValue( "ShowCorrelationCoefficient" ) >>= bHasR2Value; xEquationProperties->getPropertyValue( "ShowCorrelationCoefficient" ) >>= bHasR2Value;
} }
catch(const uno::RuntimeException& e) catch(const uno::RuntimeException& e)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment