diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-21 11:24:26 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-21 13:53:20 +0200 |
commit | 823377b707fda94222a99b6710363f392fd9e4dd (patch) | |
tree | e6cec63a6c9cd6964d7cc252c3497bccea6ec4bf | |
parent | 2750fe97c5a2c5b374542e3383dfc75ec099c7af (diff) |
fdo#46808, Convert chart2::*RegressionCurve services to new style
The service already existed, they just needed IDL files.
Change-Id: I547b3b40912e2fefdb173c010826f86aa8347b11
-rw-r--r-- | offapi/UnoApi_offapi.mk | 4 | ||||
-rw-r--r-- | offapi/com/sun/star/chart2/ExponentialRegressionCurve.idl | 38 | ||||
-rw-r--r-- | offapi/com/sun/star/chart2/LinearRegressionCurve.idl | 38 | ||||
-rw-r--r-- | offapi/com/sun/star/chart2/LogarithmicRegressionCurve.idl | 38 | ||||
-rw-r--r-- | offapi/com/sun/star/chart2/PotentialRegressionCurve.idl | 38 | ||||
-rw-r--r-- | sc/source/filter/excel/xechart.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/excel/xichart.cxx | 39 | ||||
-rw-r--r-- | sc/source/filter/inc/xlchart.hxx | 4 |
8 files changed, 170 insertions, 37 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 682ef3950dff..1b70c75afbea 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -80,12 +80,16 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/awt/tree,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/chart2,\ CartesianCoordinateSystem2d \ CartesianCoordinateSystem3d \ + ExponentialRegressionCurve \ ExponentialScaling \ FormattedString \ + LogarithmicRegressionCurve \ LogarithmicScaling \ + LinearRegressionCurve \ LinearScaling \ PolarCoordinateSystem2d \ PolarCoordinateSystem3d \ + PotentialRegressionCurve \ PowerScaling \ RegressionEquation \ Scaling \ diff --git a/offapi/com/sun/star/chart2/ExponentialRegressionCurve.idl b/offapi/com/sun/star/chart2/ExponentialRegressionCurve.idl new file mode 100644 index 000000000000..b9e94650ee39 --- /dev/null +++ b/offapi/com/sun/star/chart2/ExponentialRegressionCurve.idl @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef com_sun_star_chart2_ExponentialRegressionCurve_idl +#define com_sun_star_chart2_ExponentialRegressionCurve_idl + +#include <com/sun/star/chart2/XRegressionCurve.idl> + + +module com { module sun { module star { module chart2 { + + +/** + @since LibreOffice 4.1 +*/ +service ExponentialRegressionCurve : com::sun::star::chart2::XRegressionCurve; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/chart2/LinearRegressionCurve.idl b/offapi/com/sun/star/chart2/LinearRegressionCurve.idl new file mode 100644 index 000000000000..6aeee66b6836 --- /dev/null +++ b/offapi/com/sun/star/chart2/LinearRegressionCurve.idl @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef com_sun_star_chart2_LinearRegressionCurve_idl +#define com_sun_star_chart2_LinearRegressionCurve_idl + +#include <com/sun/star/chart2/XRegressionCurve.idl> + + +module com { module sun { module star { module chart2 { + + +/** + @since LibreOffice 4.1 +*/ +service LinearRegressionCurve : com::sun::star::chart2::XRegressionCurve; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/chart2/LogarithmicRegressionCurve.idl b/offapi/com/sun/star/chart2/LogarithmicRegressionCurve.idl new file mode 100644 index 000000000000..cd791e8d25c8 --- /dev/null +++ b/offapi/com/sun/star/chart2/LogarithmicRegressionCurve.idl @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef com_sun_star_chart2_LogarithmicRegressionCurve_idl +#define com_sun_star_chart2_LogarithmicRegressionCurve_idl + +#include <com/sun/star/chart2/XRegressionCurve.idl> + + +module com { module sun { module star { module chart2 { + + +/** + @since LibreOffice 4.1 +*/ +service LogarithmicRegressionCurve : com::sun::star::chart2::XRegressionCurve; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/chart2/PotentialRegressionCurve.idl b/offapi/com/sun/star/chart2/PotentialRegressionCurve.idl new file mode 100644 index 000000000000..6f240745cab8 --- /dev/null +++ b/offapi/com/sun/star/chart2/PotentialRegressionCurve.idl @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef com_sun_star_chart2_PotentialRegressionCurve_idl +#define com_sun_star_chart2_PotentialRegressionCurve_idl + +#include <com/sun/star/chart2/XRegressionCurve.idl> + + +module com { module sun { module star { module chart2 { + + +/** + @since LibreOffice 4.1 +*/ +service PotentialRegressionCurve : com::sun::star::chart2::XRegressionCurve; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index fa7df367a109..e8f88282b614 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -1692,16 +1692,16 @@ bool XclExpChSerTrendLine::Convert( Reference< XRegressionCurve > xRegCurve, sal // trend line type ScfPropertySet aCurveProp( xRegCurve ); OUString aService = aCurveProp.GetServiceName(); - if( aService == SERVICE_CHART2_LINEARREGCURVE ) + if( aService == "com.sun.star.chart2.LinearRegressionCurve" ) { maData.mnLineType = EXC_CHSERTREND_POLYNOMIAL; maData.mnOrder = 1; } - else if( aService == SERVICE_CHART2_EXPREGCURVE ) + else if( aService == "com.sun.star.chart2.ExponentialRegressionCurve" ) maData.mnLineType = EXC_CHSERTREND_EXPONENTIAL; - else if( aService == SERVICE_CHART2_LOGREGCURVE ) + else if( aService == "com.sun.star.chart2.LogarithmicRegressionCurve" ) maData.mnLineType = EXC_CHSERTREND_LOGARITHMIC; - else if( aService == SERVICE_CHART2_POTREGCURVE ) + else if( aService == "com.sun.star.chart2.PotentialRegressionCurve" ) maData.mnLineType = EXC_CHSERTREND_POWER; else return false; diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index e36a1473e9a9..cb85b90d4f9c 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -40,6 +40,10 @@ #include <com/sun/star/chart/DataLabelPlacement.hpp> #include <com/sun/star/chart/ErrorBarStyle.hpp> #include <com/sun/star/chart/MissingValueTreatment.hpp> +#include <com/sun/star/chart2/LinearRegressionCurve.hpp> +#include <com/sun/star/chart2/ExponentialRegressionCurve.hpp> +#include <com/sun/star/chart2/LogarithmicRegressionCurve.hpp> +#include <com/sun/star/chart2/PotentialRegressionCurve.hpp> #include <com/sun/star/chart2/CartesianCoordinateSystem2d.hpp> #include <com/sun/star/chart2/CartesianCoordinateSystem3d.hpp> #include <com/sun/star/chart2/FormattedString.hpp> @@ -104,27 +108,7 @@ using ::com::sun::star::drawing::XDrawPage; using ::com::sun::star::drawing::XDrawPageSupplier; using ::com::sun::star::drawing::XShape; -using ::com::sun::star::chart2::IncrementData; -using ::com::sun::star::chart2::RelativePosition; -using ::com::sun::star::chart2::RelativeSize; -using ::com::sun::star::chart2::ScaleData; -using ::com::sun::star::chart2::SubIncrement; -using ::com::sun::star::chart2::XAxis; -using ::com::sun::star::chart2::XChartDocument; -using ::com::sun::star::chart2::XChartType; -using ::com::sun::star::chart2::XChartTypeContainer; -using ::com::sun::star::chart2::XCoordinateSystem; -using ::com::sun::star::chart2::XCoordinateSystemContainer; -using ::com::sun::star::chart2::XDataSeries; -using ::com::sun::star::chart2::XDataSeriesContainer; -using ::com::sun::star::chart2::XDiagram; -using ::com::sun::star::chart2::XFormattedString; -using ::com::sun::star::chart2::XLegend; -using ::com::sun::star::chart2::XRegressionCurve; -using ::com::sun::star::chart2::XRegressionCurveContainer; -using ::com::sun::star::chart2::XScaling; -using ::com::sun::star::chart2::XTitle; -using ::com::sun::star::chart2::XTitled; +using namespace ::com::sun::star::chart2; using ::com::sun::star::chart2::data::XDataProvider; using ::com::sun::star::chart2::data::XDataReceiver; @@ -1627,27 +1611,24 @@ void XclImpChSerTrendLine::ReadChSerTrendLine( XclImpStream& rStrm ) Reference< XRegressionCurve > XclImpChSerTrendLine::CreateRegressionCurve() const { // trend line type - OUString aService; + Reference< XRegressionCurve > xRegCurve; switch( maData.mnLineType ) { case EXC_CHSERTREND_POLYNOMIAL: // TODO: only linear trend lines are supported by OOChart (#i20819#) if( maData.mnOrder == 1 ) - aService = SERVICE_CHART2_LINEARREGCURVE; + xRegCurve = LinearRegressionCurve::create( comphelper::getProcessComponentContext() ); break; case EXC_CHSERTREND_EXPONENTIAL: - aService = SERVICE_CHART2_EXPREGCURVE; + xRegCurve = ExponentialRegressionCurve::create( comphelper::getProcessComponentContext() ); break; case EXC_CHSERTREND_LOGARITHMIC: - aService = SERVICE_CHART2_LOGREGCURVE; + xRegCurve = LogarithmicRegressionCurve::create( comphelper::getProcessComponentContext() ); break; case EXC_CHSERTREND_POWER: - aService = SERVICE_CHART2_POTREGCURVE; + xRegCurve = PotentialRegressionCurve::create( comphelper::getProcessComponentContext() ); break; } - Reference< XRegressionCurve > xRegCurve; - if( !aService.isEmpty() ) - xRegCurve.set( ScfApiHelper::CreateInstance( aService ), UNO_QUERY ); // trend line formatting if( xRegCurve.is() && mxDataFmt ) diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx index 4e3eb948b522..828d67795dfe 100644 --- a/sc/source/filter/inc/xlchart.hxx +++ b/sc/source/filter/inc/xlchart.hxx @@ -53,11 +53,7 @@ class XclRoot; #define SERVICE_CHART2_DATASERIES "com.sun.star.chart2.DataSeries" #define SERVICE_CHART2_DIAGRAM "com.sun.star.chart2.Diagram" #define SERVICE_CHART2_ERRORBAR "com.sun.star.chart2.ErrorBar" -#define SERVICE_CHART2_EXPREGCURVE "com.sun.star.chart2.ExponentialRegressionCurve" #define SERVICE_CHART2_LEGEND "com.sun.star.chart2.Legend" -#define SERVICE_CHART2_LINEARREGCURVE "com.sun.star.chart2.LinearRegressionCurve" -#define SERVICE_CHART2_LOGREGCURVE "com.sun.star.chart2.LogarithmicRegressionCurve" -#define SERVICE_CHART2_POTREGCURVE "com.sun.star.chart2.PotentialRegressionCurve" // property names #define EXC_CHPROP_ADDITIONALSHAPES "AdditionalShapes" |