summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-09 14:03:18 +0200
committerNoel Grandin <noel@peralex.com>2013-05-13 09:38:03 +0200
commit088e86b865062dd4cc5ba0c85c6068dea62238db (patch)
tree3f4ba85335bae3349bf4852245400b35b36d7ea0
parent5d1ad167294878789e644452f23ef883af93fe87 (diff)
fdo#46808, Convert some chart2 services to new style
The services already existed, they just needed IDL files Change-Id: Ia7bdae932c5fb4b47d23afd2bb0756ecc9cbf6f7
-rw-r--r--offapi/UnoApi_offapi.mk4
-rw-r--r--offapi/com/sun/star/chart2/CartesianCoordinateSystem2d.idl35
-rw-r--r--offapi/com/sun/star/chart2/CartesianCoordinateSystem3d.idl35
-rw-r--r--offapi/com/sun/star/chart2/PolarCoordinateSystem2d.idl35
-rw-r--r--offapi/com/sun/star/chart2/PolarCoordinateSystem3d.idl35
-rw-r--r--oox/source/drawingml/chart/typegroupconverter.cxx20
-rw-r--r--sc/source/filter/excel/xichart.cxx32
-rw-r--r--sc/source/filter/inc/xlchart.hxx4
8 files changed, 172 insertions, 28 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index b500e72e34e8..05f7da2c500c 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -76,7 +76,11 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/awt/tree,\
TreeControl \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/chart2,\
+ CartesianCoordinateSystem2d \
+ CartesianCoordinateSystem3d \
FormattedString \
+ PolarCoordinateSystem2d \
+ PolarCoordinateSystem3d \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/chart2/data,\
DatabaseDataProvider \
diff --git a/offapi/com/sun/star/chart2/CartesianCoordinateSystem2d.idl b/offapi/com/sun/star/chart2/CartesianCoordinateSystem2d.idl
new file mode 100644
index 000000000000..c547575bfda7
--- /dev/null
+++ b/offapi/com/sun/star/chart2/CartesianCoordinateSystem2d.idl
@@ -0,0 +1,35 @@
+/* -*- 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_CartesianCoordinateSystem2d_idl
+#define com_sun_star_chart2_CartesianCoordinateSystem2d_idl
+
+#include <com/sun/star/chart2/XCoordinateSystem.idl>
+
+module com { module sun { module star { module chart2 {
+
+/**
+ @since LibreOffice 4.1
+ */
+service CartesianCoordinateSystem2d : XCoordinateSystem;
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/chart2/CartesianCoordinateSystem3d.idl b/offapi/com/sun/star/chart2/CartesianCoordinateSystem3d.idl
new file mode 100644
index 000000000000..05f475220bb1
--- /dev/null
+++ b/offapi/com/sun/star/chart2/CartesianCoordinateSystem3d.idl
@@ -0,0 +1,35 @@
+/* -*- 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_CartesianCoordinateSystem3d_idl
+#define com_sun_star_chart2_CartesianCoordinateSystem3d_idl
+
+#include <com/sun/star/chart2/XCoordinateSystem.idl>
+
+module com { module sun { module star { module chart2 {
+
+/**
+ @since LibreOffice 4.1
+ */
+service CartesianCoordinateSystem3d : XCoordinateSystem;
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/chart2/PolarCoordinateSystem2d.idl b/offapi/com/sun/star/chart2/PolarCoordinateSystem2d.idl
new file mode 100644
index 000000000000..14597842daf8
--- /dev/null
+++ b/offapi/com/sun/star/chart2/PolarCoordinateSystem2d.idl
@@ -0,0 +1,35 @@
+/* -*- 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_PolarCoordinateSystem2d_idl
+#define com_sun_star_chart2_PolarCoordinateSystem2d_idl
+
+#include <com/sun/star/chart2/XCoordinateSystem.idl>
+
+module com { module sun { module star { module chart2 {
+
+/**
+ @since LibreOffice 4.1
+ */
+service PolarCoordinateSystem2d : XCoordinateSystem;
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/chart2/PolarCoordinateSystem3d.idl b/offapi/com/sun/star/chart2/PolarCoordinateSystem3d.idl
new file mode 100644
index 000000000000..afbdf5ddb213
--- /dev/null
+++ b/offapi/com/sun/star/chart2/PolarCoordinateSystem3d.idl
@@ -0,0 +1,35 @@
+/* -*- 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_PolarCoordinateSystem3d_idl
+#define com_sun_star_chart2_PolarCoordinateSystem3d_idl
+
+#include <com/sun/star/chart2/XCoordinateSystem.idl>
+
+module com { module sun { module star { module chart2 {
+
+/**
+ @since LibreOffice 4.1
+ */
+service PolarCoordinateSystem3d : XCoordinateSystem;
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx
index 7f996bfa062b..12d086d09fef 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -20,6 +20,10 @@
#include "oox/drawingml/chart/typegroupconverter.hxx"
#include <com/sun/star/chart/DataLabelPlacement.hpp>
+#include <com/sun/star/chart2/CartesianCoordinateSystem2d.hpp>
+#include <com/sun/star/chart2/CartesianCoordinateSystem3d.hpp>
+#include <com/sun/star/chart2/PolarCoordinateSystem2d.hpp>
+#include <com/sun/star/chart2/PolarCoordinateSystem3d.hpp>
#include <com/sun/star/chart2/CurveStyle.hpp>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
#include <com/sun/star/chart2/StackingDirection.hpp>
@@ -238,26 +242,24 @@ OUString TypeGroupConverter::getSingleSeriesTitle() const
Reference< XCoordinateSystem > TypeGroupConverter::createCoordinateSystem()
{
- // find service name for coordinate system
- OUString aServiceName;
+ // create the coordinate system object
+ Reference< css::uno::XComponentContext > xContext = getComponentContext();
+ Reference< XCoordinateSystem > xCoordSystem;
if( maTypeInfo.mbPolarCoordSystem )
{
if( mb3dChart )
- aServiceName = "com.sun.star.chart2.PolarCoordinateSystem3d";
+ xCoordSystem = css::chart2::PolarCoordinateSystem2d::create(xContext);
else
- aServiceName = "com.sun.star.chart2.PolarCoordinateSystem2d";
+ xCoordSystem = css::chart2::PolarCoordinateSystem3d::create(xContext);
}
else
{
if( mb3dChart )
- aServiceName = "com.sun.star.chart2.CartesianCoordinateSystem3d";
+ xCoordSystem = css::chart2::CartesianCoordinateSystem3d::create(xContext);
else
- aServiceName = "com.sun.star.chart2.CartesianCoordinateSystem2d";
+ xCoordSystem = css::chart2::CartesianCoordinateSystem2d::create(xContext);
}
- // create the coordinate system object
- Reference< XCoordinateSystem > xCoordSystem( createInstance( aServiceName ), UNO_QUERY );
-
// swap X and Y axis
if( maTypeInfo.mbSwappedAxesSet )
{
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 50d36d26c7fa..e73b0da7fdff 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -37,7 +37,14 @@
#include <com/sun/star/chart/TimeUnit.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart/XDiagramPositioning.hpp>
+#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/CartesianCoordinateSystem2d.hpp>
+#include <com/sun/star/chart2/CartesianCoordinateSystem3d.hpp>
#include <com/sun/star/chart2/FormattedString.hpp>
+#include <com/sun/star/chart2/PolarCoordinateSystem2d.hpp>
+#include <com/sun/star/chart2/PolarCoordinateSystem3d.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
@@ -45,9 +52,6 @@
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
-#include <com/sun/star/chart2/data/XDataProvider.hpp>
-#include <com/sun/star/chart2/data/XDataReceiver.hpp>
-#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/chart2/CurveStyle.hpp>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
@@ -57,10 +61,10 @@
#include <com/sun/star/chart2/TickmarkStyle.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
+#include <com/sun/star/chart2/data/XDataProvider.hpp>
+#include <com/sun/star/chart2/data/XDataReceiver.hpp>
+#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/chart2/data/LabeledDataSequence.hpp>
-#include <com/sun/star/chart/DataLabelPlacement.hpp>
-#include <com/sun/star/chart/ErrorBarStyle.hpp>
-#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <sfx2/objsh.hxx>
#include <svx/svdpage.hxx>
@@ -2316,26 +2320,24 @@ bool XclImpChType::HasCategoryLabels() const
Reference< XCoordinateSystem > XclImpChType::CreateCoordSystem( bool b3dChart ) const
{
- // service name
- OUString aCoordSysService;
+ // create the coordinate system object
+ Reference< css::uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
+ Reference< XCoordinateSystem > xCoordSystem;
if( maTypeInfo.mbPolarCoordSystem )
{
if( b3dChart )
- aCoordSysService = SERVICE_CHART2_POLARCOORDSYS3D;
+ xCoordSystem = css::chart2::PolarCoordinateSystem2d::create(xContext);
else
- aCoordSysService = SERVICE_CHART2_POLARCOORDSYS2D;
+ xCoordSystem = css::chart2::PolarCoordinateSystem3d::create(xContext);
}
else
{
if( b3dChart )
- aCoordSysService = SERVICE_CHART2_CARTESIANCOORDSYS3D;
+ xCoordSystem = css::chart2::CartesianCoordinateSystem3d::create(xContext);
else
- aCoordSysService = SERVICE_CHART2_CARTESIANCOORDSYS2D;
+ xCoordSystem = css::chart2::CartesianCoordinateSystem2d::create(xContext);
}
- // create the coordinate system object
- Reference< XCoordinateSystem > xCoordSystem( ScfApiHelper::CreateInstance( aCoordSysService ), UNO_QUERY );
-
// swap X and Y axis
if( maTypeInfo.mbSwappedAxesSet )
{
diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx
index 9743bee767ce..5ea9a7e54518 100644
--- a/sc/source/filter/inc/xlchart.hxx
+++ b/sc/source/filter/inc/xlchart.hxx
@@ -49,8 +49,6 @@ class XclRoot;
#define SERVICE_DRAWING_HATCHTABLE "com.sun.star.drawing.HatchTable"
#define SERVICE_CHART2_AXIS "com.sun.star.chart2.Axis"
-#define SERVICE_CHART2_CARTESIANCOORDSYS2D "com.sun.star.chart2.CartesianCoordinateSystem2d"
-#define SERVICE_CHART2_CARTESIANCOORDSYS3D "com.sun.star.chart2.CartesianCoordinateSystem3d"
#define SERVICE_CHART2_DATAPROVIDER "com.sun.star.chart2.data.DataProvider"
#define SERVICE_CHART2_DATASERIES "com.sun.star.chart2.DataSeries"
#define SERVICE_CHART2_DIAGRAM "com.sun.star.chart2.Diagram"
@@ -61,8 +59,6 @@ class XclRoot;
#define SERVICE_CHART2_LINEARSCALING "com.sun.star.chart2.LinearScaling"
#define SERVICE_CHART2_LOGREGCURVE "com.sun.star.chart2.LogarithmicRegressionCurve"
#define SERVICE_CHART2_LOGSCALING "com.sun.star.chart2.LogarithmicScaling"
-#define SERVICE_CHART2_POLARCOORDSYS2D "com.sun.star.chart2.PolarCoordinateSystem2d"
-#define SERVICE_CHART2_POLARCOORDSYS3D "com.sun.star.chart2.PolarCoordinateSystem3d"
#define SERVICE_CHART2_POTREGCURVE "com.sun.star.chart2.PotentialRegressionCurve"
#define SERVICE_CHART2_TITLE "com.sun.star.chart2.Title"