summaryrefslogtreecommitdiffstats
path: root/chart2/source/controller/dialogs/ObjectNameProvider.cxx
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2016-06-28 23:34:34 +0200
committerLaurent BP <laurent.balland-poirier@laposte.net>2016-08-16 20:54:54 +0000
commit428711f03c31802e339e57384b9f925a0e4dcc12 (patch)
treea7c5d08b20a56890943df67bd82e12021aaee4ee /chart2/source/controller/dialogs/ObjectNameProvider.cxx
parentGSoC - fix build of fasttokenhandler (diff)
downloadcore-428711f03c31802e339e57384b9f925a0e4dcc12.tar.gz
core-428711f03c31802e339e57384b9f925a0e4dcc12.zip
Start tdf#100547 Trendline equation: customize X, Y names
Change trend line UI to add fields: X name and Y name to change "x" and "f(x)" in equation representation Next to be done: save it to ODF file Change-Id: I0680ee1bbfbbb74016ecc858917e10d6790ac63a Reviewed-on: https://gerrit.libreoffice.org/27069 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Laurent BP <laurent.balland-poirier@laposte.net>
Diffstat (limited to 'chart2/source/controller/dialogs/ObjectNameProvider.cxx')
-rw-r--r--chart2/source/controller/dialogs/ObjectNameProvider.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
index 3eccea94c068..6e112ae9fa5c 100644
--- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx
+++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
@@ -565,6 +565,7 @@ OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const Refe
sal_Int32 aPeriod = 2;
bool bForceIntercept = false;
double aInterceptValue = 0.0;
+ OUString aXName ("x"), aYName ("f(x)");
const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
const OUString& aNumDecimalSep = rLocaleDataWrapper.getNumDecimalSep();
assert(aNumDecimalSep.getLength() > 0);
@@ -578,8 +579,17 @@ OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const Refe
xProperties->getPropertyValue( "ForceIntercept") >>= bForceIntercept;
if (bForceIntercept)
xProperties->getPropertyValue( "InterceptValue") >>= aInterceptValue;
+ uno::Reference< beans::XPropertySet > xEqProp( xCurve->getEquationProperties());
+ if( xEqProp.is())
+ {
+ if ( !(xEqProp->getPropertyValue( "XName") >>= aXName) )
+ aXName = "x";
+ if ( !(xEqProp->getPropertyValue( "YName") >>= aYName) )
+ aYName = "f(x)";
+ }
}
xCalculator->setRegressionProperties(aDegree, bForceIntercept, aInterceptValue, 2);
+ xCalculator->setXYNames ( aXName, aYName );
RegressionCurveHelper::initializeCurveCalculator( xCalculator, xSeries, xChartModel );
// change text for Moving Average