Kaydet (Commit) 088e86b8 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Convert some chart2 services to new style

The services already existed, they just needed IDL files

Change-Id: Ia7bdae932c5fb4b47d23afd2bb0756ecc9cbf6f7
üst 5d1ad167
...@@ -76,7 +76,11 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/awt/tree,\ ...@@ -76,7 +76,11 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/awt/tree,\
TreeControl \ TreeControl \
)) ))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/chart2,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/chart2,\
CartesianCoordinateSystem2d \
CartesianCoordinateSystem3d \
FormattedString \ FormattedString \
PolarCoordinateSystem2d \
PolarCoordinateSystem3d \
)) ))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/chart2/data,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/chart2/data,\
DatabaseDataProvider \ DatabaseDataProvider \
......
/* -*- 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: */
/* -*- 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: */
/* -*- 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: */
/* -*- 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: */
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
#include "oox/drawingml/chart/typegroupconverter.hxx" #include "oox/drawingml/chart/typegroupconverter.hxx"
#include <com/sun/star/chart/DataLabelPlacement.hpp> #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/CurveStyle.hpp>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp> #include <com/sun/star/chart2/DataPointGeometry3D.hpp>
#include <com/sun/star/chart2/StackingDirection.hpp> #include <com/sun/star/chart2/StackingDirection.hpp>
...@@ -238,26 +242,24 @@ OUString TypeGroupConverter::getSingleSeriesTitle() const ...@@ -238,26 +242,24 @@ OUString TypeGroupConverter::getSingleSeriesTitle() const
Reference< XCoordinateSystem > TypeGroupConverter::createCoordinateSystem() Reference< XCoordinateSystem > TypeGroupConverter::createCoordinateSystem()
{ {
// find service name for coordinate system // create the coordinate system object
OUString aServiceName; Reference< css::uno::XComponentContext > xContext = getComponentContext();
Reference< XCoordinateSystem > xCoordSystem;
if( maTypeInfo.mbPolarCoordSystem ) if( maTypeInfo.mbPolarCoordSystem )
{ {
if( mb3dChart ) if( mb3dChart )
aServiceName = "com.sun.star.chart2.PolarCoordinateSystem3d"; xCoordSystem = css::chart2::PolarCoordinateSystem2d::create(xContext);
else else
aServiceName = "com.sun.star.chart2.PolarCoordinateSystem2d"; xCoordSystem = css::chart2::PolarCoordinateSystem3d::create(xContext);
} }
else else
{ {
if( mb3dChart ) if( mb3dChart )
aServiceName = "com.sun.star.chart2.CartesianCoordinateSystem3d"; xCoordSystem = css::chart2::CartesianCoordinateSystem3d::create(xContext);
else 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 // swap X and Y axis
if( maTypeInfo.mbSwappedAxesSet ) if( maTypeInfo.mbSwappedAxesSet )
{ {
......
...@@ -37,7 +37,14 @@ ...@@ -37,7 +37,14 @@
#include <com/sun/star/chart/TimeUnit.hpp> #include <com/sun/star/chart/TimeUnit.hpp>
#include <com/sun/star/chart/XChartDocument.hpp> #include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart/XDiagramPositioning.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/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/XChartDocument.hpp>
#include <com/sun/star/chart2/XDiagram.hpp> #include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp> #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
...@@ -45,9 +52,6 @@ ...@@ -45,9 +52,6 @@
#include <com/sun/star/chart2/XDataSeriesContainer.hpp> #include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/XRegressionCurveContainer.hpp> #include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/chart2/XTitled.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/AxisType.hpp>
#include <com/sun/star/chart2/CurveStyle.hpp> #include <com/sun/star/chart2/CurveStyle.hpp>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp> #include <com/sun/star/chart2/DataPointGeometry3D.hpp>
...@@ -57,10 +61,10 @@ ...@@ -57,10 +61,10 @@
#include <com/sun/star/chart2/TickmarkStyle.hpp> #include <com/sun/star/chart2/TickmarkStyle.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp> #include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.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/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 <sfx2/objsh.hxx>
#include <svx/svdpage.hxx> #include <svx/svdpage.hxx>
...@@ -2316,26 +2320,24 @@ bool XclImpChType::HasCategoryLabels() const ...@@ -2316,26 +2320,24 @@ bool XclImpChType::HasCategoryLabels() const
Reference< XCoordinateSystem > XclImpChType::CreateCoordSystem( bool b3dChart ) const Reference< XCoordinateSystem > XclImpChType::CreateCoordSystem( bool b3dChart ) const
{ {
// service name // create the coordinate system object
OUString aCoordSysService; Reference< css::uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
Reference< XCoordinateSystem > xCoordSystem;
if( maTypeInfo.mbPolarCoordSystem ) if( maTypeInfo.mbPolarCoordSystem )
{ {
if( b3dChart ) if( b3dChart )
aCoordSysService = SERVICE_CHART2_POLARCOORDSYS3D; xCoordSystem = css::chart2::PolarCoordinateSystem2d::create(xContext);
else else
aCoordSysService = SERVICE_CHART2_POLARCOORDSYS2D; xCoordSystem = css::chart2::PolarCoordinateSystem3d::create(xContext);
} }
else else
{ {
if( b3dChart ) if( b3dChart )
aCoordSysService = SERVICE_CHART2_CARTESIANCOORDSYS3D; xCoordSystem = css::chart2::CartesianCoordinateSystem3d::create(xContext);
else 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 // swap X and Y axis
if( maTypeInfo.mbSwappedAxesSet ) if( maTypeInfo.mbSwappedAxesSet )
{ {
......
...@@ -49,8 +49,6 @@ class XclRoot; ...@@ -49,8 +49,6 @@ class XclRoot;
#define SERVICE_DRAWING_HATCHTABLE "com.sun.star.drawing.HatchTable" #define SERVICE_DRAWING_HATCHTABLE "com.sun.star.drawing.HatchTable"
#define SERVICE_CHART2_AXIS "com.sun.star.chart2.Axis" #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_DATAPROVIDER "com.sun.star.chart2.data.DataProvider"
#define SERVICE_CHART2_DATASERIES "com.sun.star.chart2.DataSeries" #define SERVICE_CHART2_DATASERIES "com.sun.star.chart2.DataSeries"
#define SERVICE_CHART2_DIAGRAM "com.sun.star.chart2.Diagram" #define SERVICE_CHART2_DIAGRAM "com.sun.star.chart2.Diagram"
...@@ -61,8 +59,6 @@ class XclRoot; ...@@ -61,8 +59,6 @@ class XclRoot;
#define SERVICE_CHART2_LINEARSCALING "com.sun.star.chart2.LinearScaling" #define SERVICE_CHART2_LINEARSCALING "com.sun.star.chart2.LinearScaling"
#define SERVICE_CHART2_LOGREGCURVE "com.sun.star.chart2.LogarithmicRegressionCurve" #define SERVICE_CHART2_LOGREGCURVE "com.sun.star.chart2.LogarithmicRegressionCurve"
#define SERVICE_CHART2_LOGSCALING "com.sun.star.chart2.LogarithmicScaling" #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_POTREGCURVE "com.sun.star.chart2.PotentialRegressionCurve"
#define SERVICE_CHART2_TITLE "com.sun.star.chart2.Title" #define SERVICE_CHART2_TITLE "com.sun.star.chart2.Title"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment