diff options
-rw-r--r-- | chart2/Library_chartcore.mk | 1 | ||||
-rw-r--r-- | chart2/source/model/template/ChartTypeManager.cxx | 7 | ||||
-rw-r--r-- | chart2/source/model/template/GL3DBarChartTypeTemplate.cxx | 36 | ||||
-rw-r--r-- | chart2/source/model/template/GL3DBarChartTypeTemplate.hxx | 43 | ||||
-rw-r--r-- | chart2/source/tools/DiagramHelper.cxx | 2 |
5 files changed, 88 insertions, 1 deletions
diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk index 2e09fe3c2463..63171f40a9f5 100644 --- a/chart2/Library_chartcore.mk +++ b/chart2/Library_chartcore.mk @@ -154,6 +154,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\ chart2/source/model/template/DataInterpreter \ chart2/source/model/template/FilledNetChartType \ chart2/source/model/template/GL3DBarChartType \ + chart2/source/model/template/GL3DBarChartTypeTemplate \ chart2/source/model/template/LineChartType \ chart2/source/model/template/LineChartTypeTemplate \ chart2/source/model/template/NetChartType \ diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx index e68744cb3474..49775f9d4900 100644 --- a/chart2/source/model/template/ChartTypeManager.cxx +++ b/chart2/source/model/template/ChartTypeManager.cxx @@ -33,6 +33,7 @@ #include "StockChartTypeTemplate.hxx" #include "NetChartTypeTemplate.hxx" #include "BubbleChartTypeTemplate.hxx" +#include "GL3DBarChartTypeTemplate.hxx" #include <cppuhelper/component_context.hxx> #include <comphelper/InlineContainer.hxx> #include <com/sun/star/container/XContentEnumerationAccess.hpp> @@ -121,6 +122,7 @@ enum TemplateId TEMPLATE_STOCKVOLUMELOWHIGHCLOSE, TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE, TEMPLATE_BUBBLE, + TEMPLATE_GL3DBAR_ROUNDED_RECTANGLE, // TEMPLATE_SURFACE, // TEMPLATE_ADDIN, TEMPLATE_NOT_FOUND = 0xffff @@ -196,6 +198,7 @@ const tTemplateMapType & lcl_DefaultChartTypeMap() ( "com.sun.star.chart2.template.StockVolumeLowHighClose", TEMPLATE_STOCKVOLUMELOWHIGHCLOSE ) ( "com.sun.star.chart2.template.StockVolumeOpenLowHighClose", TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE ) ( "com.sun.star.chart2.template.Bubble", TEMPLATE_BUBBLE ) + ( "com.sun.star.chart2.template.GL3DBarRoundedRectangle", TEMPLATE_GL3DBAR_ROUNDED_RECTANGLE ) // ( "com.sun.star.chart2.template.Surface", TEMPLATE_SURFACE ) // ( "com.sun.star.chart2.template.Addin", TEMPLATE_ADDIN ) ); @@ -529,6 +532,10 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance( xTemplate.set( new BubbleChartTypeTemplate( m_xContext, aServiceSpecifier )); break; + case TEMPLATE_GL3DBAR_ROUNDED_RECTANGLE: + xTemplate.set(new GL3DBarChartTypeTemplate(m_xContext, aServiceSpecifier)); + break; + // case TEMPLATE_SURFACE: // case TEMPLATE_ADDIN: // break; diff --git a/chart2/source/model/template/GL3DBarChartTypeTemplate.cxx b/chart2/source/model/template/GL3DBarChartTypeTemplate.cxx new file mode 100644 index 000000000000..306481e5420e --- /dev/null +++ b/chart2/source/model/template/GL3DBarChartTypeTemplate.cxx @@ -0,0 +1,36 @@ +/* -*- 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/. + */ + +#include "GL3DBarChartTypeTemplate.hxx" + +using namespace com::sun::star; + +namespace chart { + +GL3DBarChartTypeTemplate::GL3DBarChartTypeTemplate( + const uno::Reference<uno::XComponentContext>& xContext, const OUString& rServiceName ) : + ChartTypeTemplate(xContext, rServiceName) {} + +GL3DBarChartTypeTemplate::~GL3DBarChartTypeTemplate() {} + +uno::Reference<chart2::XChartType> GL3DBarChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ ) +{ + return uno::Reference<chart2::XChartType>(); +} + +uno::Reference<chart2::XChartType> +GL3DBarChartTypeTemplate::getChartTypeForNewSeries( + const uno::Sequence<uno::Reference<chart2::XChartType> >& /*xOldChartTypes*/ ) +{ + return uno::Reference<chart2::XChartType>(); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/GL3DBarChartTypeTemplate.hxx b/chart2/source/model/template/GL3DBarChartTypeTemplate.hxx new file mode 100644 index 000000000000..257432918e4e --- /dev/null +++ b/chart2/source/model/template/GL3DBarChartTypeTemplate.hxx @@ -0,0 +1,43 @@ +/* -*- 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/. + */ + +#ifndef CHART2_GL3DBARCHARTTYPETEMPLATE_HXX +#define CHART2_GL3DBARCHARTTYPETEMPLATE_HXX + +#include <MutexContainer.hxx> +#include <ChartTypeTemplate.hxx> +#include <OPropertySet.hxx> +#include <ServiceMacros.hxx> + +namespace chart { + +class GL3DBarChartTypeTemplate : public ChartTypeTemplate +{ +public: + GL3DBarChartTypeTemplate( + const css::uno::Reference< + css::uno::XComponentContext>& xContext, + const OUString& rServiceName ); + + virtual ~GL3DBarChartTypeTemplate(); + + virtual css::uno::Reference<css::chart2::XChartType> getChartTypeForIndex( sal_Int32 nChartTypeIndex ); + + // XChartTypeTemplate + + virtual css::uno::Reference<css::chart2::XChartType> SAL_CALL + getChartTypeForNewSeries( + const css::uno::Sequence<css::uno::Reference<css::chart2::XChartType> >& xOldChartTypes ); +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index a683903c9b44..d21b6df6bfe9 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -112,7 +112,7 @@ DiagramHelper::tTemplateWithServiceName Reference< XChartTypeTemplate > xTempl( xChartTypeManager->createInstance( aServiceNames[ i ] ), uno::UNO_QUERY_THROW ); - if( xTempl->matchesTemplate( xDiagram, sal_True )) + if (xTempl.is() && xTempl->matchesTemplate(xDiagram, true)) { aResult.first = xTempl; aResult.second = aServiceNames[ i ]; |