summaryrefslogtreecommitdiff
path: root/chart2/source/controller
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/controller')
-rw-r--r--chart2/source/controller/inc/ChartController.hxx1
-rw-r--r--chart2/source/controller/main/ChartController.cxx3
-rw-r--r--chart2/source/controller/main/ChartController_Insert.cxx19
-rw-r--r--chart2/source/controller/main/ControllerCommandDispatch.cxx1
4 files changed, 24 insertions, 0 deletions
diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx
index 505b109fdcc7..f0f53c8b8990 100644
--- a/chart2/source/controller/inc/ChartController.hxx
+++ b/chart2/source/controller/inc/ChartController.hxx
@@ -440,6 +440,7 @@ private:
void executeDispatch_OpenLegendDialog();
void executeDispatch_InsertAxes();
void executeDispatch_InsertGrid();
+ void executeDispatch_OpenInsertDataTableDialog();
void executeDispatch_InsertMenu_DataLabels();
void executeDispatch_InsertMenu_Trendlines();
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 54c91a6147dd..70b15cf0fd04 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1169,6 +1169,8 @@ void SAL_CALL ChartController::dispatch(
this->executeDispatch_InsertErrorBars(false);
else if( aCommand == "InsertMenuYErrorBars" )
this->executeDispatch_InsertErrorBars(true);
+ else if( aCommand == "InsertMenuDataTable" )
+ this->executeDispatch_OpenInsertDataTableDialog();
else if( aCommand == "InsertSymbol" )
this->executeDispatch_InsertSpecialCharacter();
else if( aCommand == "InsertTrendline" )
@@ -1631,6 +1633,7 @@ const o3tl::sorted_vector< OUString >& ChartController::impl_getAvailableCommand
"DeleteTrendline", "DeleteMeanValue", "DeleteTrendlineEquation",
"DeleteXErrorBars", "DeleteYErrorBars",
"DeleteDataLabels", "DeleteDataLabel",
+ "InsertMenuDataTable",
//format objects
"FormatSelection", "TransformDialog",
"DiagramType", "View3D",
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index 4f39f1068cdb..46d00eedb89c 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -52,6 +52,7 @@
#include <ObjectNameProvider.hxx>
#include <Legend.hxx>
#include <LegendHelper.hxx>
+#include <DataTable.hxx>
#include <RegressionCurveModel.hxx>
#include <com/sun/star/chart2/XRegressionCurve.hpp>
@@ -155,6 +156,24 @@ void ChartController::executeDispatch_InsertGrid()
}
}
+void ChartController::executeDispatch_OpenInsertDataTableDialog()
+{
+ rtl::Reference<Diagram> xDiagram = getFirstDiagram();
+ SolarMutexGuard aGuard;
+ if (xDiagram->getDataTable().is())
+ {
+ xDiagram->setDataTable(uno::Reference<chart2::XDataTable>());
+ }
+ else
+ {
+ uno::Reference<chart2::XDataTable> xDataTable(new DataTable);
+ if (xDataTable.is())
+ {
+ xDiagram->setDataTable(xDataTable);
+ }
+ }
+}
+
void ChartController::executeDispatch_InsertTitles()
{
UndoGuard aUndoGuard(
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index e5035b4f053c..828d862f4306 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -584,6 +584,7 @@ void ControllerCommandDispatch::updateCommandAvailability()
m_aCommandAvailability[ ".uno:InsertMenuXErrorBars" ] = bIsWritable && m_apModelState->bSupportsStatistics;
m_aCommandAvailability[ ".uno:InsertMenuYErrorBars" ] = bIsWritable && m_apModelState->bSupportsStatistics;
m_aCommandAvailability[ ".uno:InsertSymbol" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsTextObject;
+ m_aCommandAvailability[ ".uno:InsertMenuDataTable" ] = bIsWritable;
// format objects
bool bFormatObjectAvailable = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsFormateableObjectSelected;