summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-10-03 15:59:06 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-10-03 16:00:21 +0200
commit749a0845500d69f99bf1901bab82361f67b5e4f6 (patch)
treeb758bc7dff18029881e1a9c8f3881ce117dadfd6 /chart2/source
parentc70c4d203340999fc039838cc487d3e4c28d2f79 (diff)
don't show area and line panel in pie chart Chart selection, tdf#94320
Change-Id: I0eacedbb3d96a059278bab0ef98a66ed49b827fc
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/main/ChartController.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index c5999ac63f2c..045837e7ccfd 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -61,6 +61,8 @@
#include <com/sun/star/document/XUndoManagerSupplier.hpp>
#include <com/sun/star/document/XUndoAction.hpp>
#include <com/sun/star/ui/XSidebar.hpp>
+#include <com/sun/star/chart2/XChartTypeContainer.hpp>
+#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <svx/sidebar/SelectionChangeHandler.hxx>
#include <vcl/msgbox.hxx>
@@ -298,6 +300,26 @@ bool ChartController::TheModelRef::is() const
return (m_pTheModel != 0);
}
+namespace {
+
+css::uno::Reference<css::chart2::XChartType> getChartType(
+ css::uno::Reference<css::chart2::XChartDocument> xChartDoc)
+{
+ Reference <chart2::XDiagram > xDiagram = xChartDoc->getFirstDiagram();
+
+ Reference< chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY_THROW );
+
+ Sequence< Reference< chart2::XCoordinateSystem > > xCooSysSequence( xCooSysContainer->getCoordinateSystems());
+
+ Reference< chart2::XChartTypeContainer > xChartTypeContainer( xCooSysSequence[0], uno::UNO_QUERY_THROW );
+
+ Sequence< Reference< chart2::XChartType > > xChartTypeSequence( xChartTypeContainer->getChartTypes() );
+
+ return xChartTypeSequence[0];
+}
+
+}
+
OUString ChartController::GetContextName()
{
if (m_bDisposed)
@@ -314,6 +336,8 @@ OUString ChartController::GetContextName()
return OUString("Chart");
ObjectType eObjectID = ObjectIdentifier::getObjectType(aCID);
+
+ css::uno::Reference<css::chart2::XChartType> xChartType = getChartType(css::uno::Reference<css::chart2::XChartDocument>(getModel(), uno::UNO_QUERY_THROW));
switch (eObjectID)
{
case OBJECTTYPE_DATA_SERIES:
@@ -327,6 +351,9 @@ OUString ChartController::GetContextName()
return OUString("Axis");
case OBJECTTYPE_GRID:
return OUString("Grid");
+ case OBJECTTYPE_DIAGRAM:
+ if (xChartType->getChartType() == "com.sun.star.chart2.PieChartType")
+ return OUString("ChartElements");
default:
break;
}