summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-03-21 10:55:06 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-03-25 22:50:49 -0400
commit56aaa39ff83962286fb7b627d847914f8144b750 (patch)
tree6753b7fc340224c7c2efc0bf3514ccdc45b06a9b
parente3ec81a1d3f66b1a76aa865c1be988051db3e25d (diff)
Skeleton template class for GL3D bar chart type.
Still very much empty. It needs to be filled with sub-categories. Change-Id: Iad7ad34efb264025541b585a92ee2ea7b8fff56f
-rw-r--r--chart2/Library_chartcore.mk1
-rw-r--r--chart2/source/model/template/ChartTypeManager.cxx7
-rw-r--r--chart2/source/model/template/GL3DBarChartTypeTemplate.cxx36
-rw-r--r--chart2/source/model/template/GL3DBarChartTypeTemplate.hxx43
-rw-r--r--chart2/source/tools/DiagramHelper.cxx2
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 ];