summaryrefslogtreecommitdiff
path: root/chart2/source/controller/itemsetwrapper
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/controller/itemsetwrapper
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/controller/itemsetwrapper')
-rw-r--r--chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx15
-rw-r--r--chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx16
2 files changed, 30 insertions, 1 deletions
diff --git a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx
index 6b284393afc4..81f94d25ca73 100644
--- a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx
@@ -29,6 +29,7 @@
// for SfxBoolItem
#include <svl/eitem.hxx>
#include <svl/intitem.hxx>
+#include <svl/stritem.hxx>
#include <svx/chrtitem.hxx>
#include <functional>
@@ -245,6 +246,13 @@ bool RegressionCurveItemConverter::ApplySpecialItem(
}
break;
+ case SCHATTR_REGRESSION_CURVE_NAME:
+ {
+ uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
+ bChanged = lclConvertToPropertySet<OUString, SfxStringItem>(rItemSet, nWhichId, xProperties, "CurveName");
+ }
+ break;
+
case SCHATTR_REGRESSION_SHOW_EQUATION:
{
uno::Reference< beans::XPropertySet > xEqProp( xCurve->getEquationProperties());
@@ -258,6 +266,7 @@ bool RegressionCurveItemConverter::ApplySpecialItem(
bChanged = lclConvertToPropertySet<sal_Bool, SfxBoolItem>(rItemSet, nWhichId, xEqProp, "ShowCorrelationCoefficient");
}
break;
+
}
return bChanged;
}
@@ -318,6 +327,12 @@ void RegressionCurveItemConverter::FillSpecialItem(sal_uInt16 nWhichId, SfxItemS
}
break;
+ case SCHATTR_REGRESSION_CURVE_NAME:
+ {
+ lclConvertToItemSet<OUString, SfxStringItem>(rOutItemSet, nWhichId, xProperties, "CurveName");
+ }
+ break;
+
case SCHATTR_REGRESSION_SHOW_EQUATION:
{
lclConvertToItemSet<sal_Bool, SfxBoolItem>(rOutItemSet, nWhichId, xCurve->getEquationProperties(), "ShowEquation");
diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
index 3693ea5f511e..506be486b0a5 100644
--- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
@@ -526,7 +526,7 @@ bool StatisticsItemConverter::ApplySpecialItem(
case SCHATTR_REGRESSION_SET_INTERCEPT:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), &rItemSet ));
- bChanged = lclConvertToPropertySet<sal_Bool, SfxBoolItem>(rItemSet, nWhichId, xProperties, "InterceptValue");
+ bChanged = lclConvertToPropertySet<sal_Bool, SfxBoolItem>(rItemSet, nWhichId, xProperties, "ForceIntercept");
}
break;
@@ -537,6 +537,13 @@ bool StatisticsItemConverter::ApplySpecialItem(
}
break;
+ case SCHATTR_REGRESSION_CURVE_NAME:
+ {
+ uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), &rItemSet ));
+ bChanged = lclConvertToPropertySet<OUString, SfxStringItem>(rItemSet, nWhichId, xProperties, "CurveName");
+ }
+ break;
+
case SCHATTR_REGRESSION_SHOW_EQUATION:
{
uno::Reference< beans::XPropertySet > xEqProp( lcl_getEquationProperties( GetPropertySet(), &rItemSet ));
@@ -800,6 +807,13 @@ void StatisticsItemConverter::FillSpecialItem(
}
break;
+ case SCHATTR_REGRESSION_CURVE_NAME:
+ {
+ uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), 0 ));
+ lclConvertToItemSet<OUString, SfxStringItem>(rOutItemSet, nWhichId, xProperties, "CurveName");
+ }
+ break;
+
case SCHATTR_REGRESSION_SHOW_EQUATION:
{
uno::Reference< beans::XPropertySet > xEqProp( lcl_getEquationProperties( GetPropertySet(), 0 ));