summaryrefslogtreecommitdiff
path: root/chart2/source/tools
diff options
context:
space:
mode:
authorTomaž Vajngerl <quikee@gmail.com>2013-11-23 16:06:28 +0100
committerTomaž Vajngerl <quikee@gmail.com>2013-11-24 19:43:16 +0100
commit6f62f3f0af9ae8c1b00d0d620f306cae914a3861 (patch)
tree9e6f39e28706a494db998531e4fd3bc423fc4a8d /chart2/source/tools
parentf58e03e7bb0016c1ca789f7e7b35933c95378121 (diff)
Custom name for a trend line (shown in legend).
Previously, a trendline name was fixed to a combination of the trendline type and the name of the series. With this it is possible to add a custom name for the trendline, which is shown in the legend. Change-Id: I61eaaf14e6df45088abdf1f3e9c24877d26ae8a7
Diffstat (limited to 'chart2/source/tools')
-rw-r--r--chart2/source/tools/RegressionCurveHelper.cxx12
-rw-r--r--chart2/source/tools/RegressionCurveModel.cxx9
2 files changed, 20 insertions, 1 deletions
diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx
index d93fb6489206..a19affda5e32 100644
--- a/chart2/source/tools/RegressionCurveHelper.cxx
+++ b/chart2/source/tools/RegressionCurveHelper.cxx
@@ -590,6 +590,18 @@ OUString RegressionCurveHelper::getUINameForRegressionCurve( const Reference< XR
if(!xServiceName.is())
return aResult;
+ Reference<XPropertySet> xProperties( xRegressionCurve, uno::UNO_QUERY );
+ if( xProperties.is() )
+ {
+ OUString aValue = OUString();
+ if(xProperties->getPropertyValue("CurveName") >>= aValue)
+ {
+ if (!aValue.isEmpty())
+ return aValue;
+ }
+ }
+
+ // Did not get the curve name
OUString aServiceName( xServiceName->getServiceName());
if( aServiceName == "com.sun.star.chart2.MeanValueRegressionCurve" )
{
diff --git a/chart2/source/tools/RegressionCurveModel.cxx b/chart2/source/tools/RegressionCurveModel.cxx
index fb182c0a3d6e..2ff4f4523e9d 100644
--- a/chart2/source/tools/RegressionCurveModel.cxx
+++ b/chart2/source/tools/RegressionCurveModel.cxx
@@ -62,7 +62,8 @@ enum
PROPERTY_EXTRAPOLATE_FORWARD,
PROPERTY_EXTRAPOLATE_BACKWARD,
PROPERTY_FORCE_INTERCEPT,
- PROPERTY_INTERCEPT_VALUE
+ PROPERTY_INTERCEPT_VALUE,
+ PROPERTY_CURVE_NAME
};
void lcl_AddPropertiesToVector(
@@ -109,6 +110,12 @@ void lcl_AddPropertiesToVector(
::getCppuType( reinterpret_cast< const double* >(0) ),
beans::PropertyAttribute::BOUND |
beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( "CurveName",
+ PROPERTY_CURVE_NAME,
+ ::getCppuType( reinterpret_cast< const OUString* >(0) ),
+ beans::PropertyAttribute::BOUND ));
}
struct StaticXXXDefaults_Initializer