diff options
Diffstat (limited to 'chart2/source/controller/main')
3 files changed, 12 insertions, 66 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index def6c2736caa..bdee1f41486b 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -544,8 +544,8 @@ sal_Bool SAL_CALL ChartController::attachModel( const uno::Reference< frame::XMo pDispatch->initialize(); // the dispatch container will return "this" for all commands returned by - // impl_getAvailableCommands(). That means, for those commands dispatch() - // is called here at the ChartController. + // impl_getAvailableCommands(), and also for which ControllerCommandDispatch::commandHandled() + // gives true. That means, for those commands dispatch() is called here at the ChartController. m_aDispatchContainer.setChartDispatch( pDispatch, impl_getAvailableCommands() ); rtl::Reference<DrawCommandDispatch> pDrawDispatch = new DrawCommandDispatch( m_xCC, this ); @@ -1679,69 +1679,8 @@ const o3tl::sorted_vector< std::u16string_view >& ChartController::impl_getAvail u"Save", u"SaveAs", u"SendMail", u"EditDoc", u"ExportDirectToPDF", u"PrintDefault", - // own commands - u"Cut", u"Copy", u"Paste", - u"DataRanges", u"DiagramData", - // insert objects - u"InsertMenuTitles", u"InsertTitles", - u"InsertMenuLegend", u"InsertLegend", u"DeleteLegend", - u"InsertMenuDataLabels", - u"InsertMenuAxes", u"InsertRemoveAxes", u"InsertMenuGrids", - u"InsertSymbol", - u"InsertTrendlineEquation", u"InsertTrendlineEquationAndR2", - u"InsertR2Value", u"DeleteR2Value", - u"InsertMenuTrendlines", u"InsertTrendline", - u"InsertMenuMeanValues", u"InsertMeanValue", - u"InsertMenuXErrorBars", u"InsertXErrorBars", - u"InsertMenuYErrorBars", u"InsertYErrorBars", - u"InsertDataLabels", u"InsertDataLabel", - u"DeleteTrendline", u"DeleteMeanValue", u"DeleteTrendlineEquation", - u"DeleteXErrorBars", u"DeleteYErrorBars", - u"DeleteDataLabels", u"DeleteDataLabel", - u"InsertMenuDataTable", - u"InsertDataTable", u"DeleteDataTable", - //format objects - u"FormatSelection", u"FontDialog", u"TransformDialog", - u"DiagramType", u"View3D", - u"Forward", u"Backward", - u"MainTitle", u"SubTitle", - u"XTitle", u"YTitle", u"ZTitle", - u"SecondaryXTitle", u"SecondaryYTitle", - u"AllTitles", u"Legend", - u"DiagramAxisX", u"DiagramAxisY", u"DiagramAxisZ", - u"DiagramAxisA", u"DiagramAxisB", u"DiagramAxisAll", - u"DiagramGridXMain", u"DiagramGridYMain", u"DiagramGridZMain", - u"DiagramGridXHelp", u"DiagramGridYHelp", u"DiagramGridZHelp", - u"DiagramGridAll", - u"DiagramWall", u"DiagramFloor", u"DiagramArea", - - //context menu - format objects entries - u"FormatWall", u"FormatFloor", u"FormatChartArea", - u"FormatLegend", - - u"FormatAxis", u"FormatTitle", - u"FormatDataSeries", u"FormatDataPoint", - u"ResetAllDataPoints", u"ResetDataPoint", - u"FormatDataLabels", u"FormatDataLabel", - u"FormatMeanValue", u"FormatTrendline", u"FormatTrendlineEquation", - u"FormatXErrorBars", u"FormatYErrorBars", - u"FormatStockLoss", u"FormatStockGain", - - u"FormatMajorGrid", u"InsertMajorGrid", u"DeleteMajorGrid", - u"FormatMinorGrid", u"InsertMinorGrid", u"DeleteMinorGrid", - u"InsertAxis", u"DeleteAxis", u"InsertAxisTitle", - // toolbar commands - u"ToggleGridHorizontal", u"ToggleGridVertical", u"ToggleLegend", u"ScaleText", - u"NewArrangement", u"Update", - u"DefaultColors", u"BarWidth", u"NumberOfLines", - u"ArrangeRow", u"ChartElementSelector", - - // sidebar commands - u"CharFontName" , u"FontHeight" , u"Italic", u"Underline", - u"Bold", u"Strikeout",u"Shadowed", u"Color", u"FontColor", u"ResetAttributes", - u"Grow", u"Shrink", u"Spacing", u"SuperScript", u"SubScript" }; return s_AvailableCommands; } diff --git a/chart2/source/controller/main/CommandDispatchContainer.cxx b/chart2/source/controller/main/CommandDispatchContainer.cxx index f3b547eebd30..1dc98f1f88b6 100644 --- a/chart2/source/controller/main/CommandDispatchContainer.cxx +++ b/chart2/source/controller/main/CommandDispatchContainer.cxx @@ -67,7 +67,7 @@ void CommandDispatchContainer::setChartDispatch( { OSL_ENSURE(rChartDispatch.is(),"Invalid fall back dispatcher!"); m_xChartDispatcher = rChartDispatch; - m_aChartCommands = rChartCommands; + m_aAdditionalChartCommands = rChartCommands; m_aToBeDisposedDispatches.push_back( m_xChartDispatcher ); } @@ -119,7 +119,9 @@ Reference< frame::XDispatch > CommandDispatchContainer::getDispatchForURL( } } - if (m_xChartDispatcher.is() && m_aChartCommands.count(rURL.Path) > 0) + if (m_xChartDispatcher.is() + && (m_xChartDispatcher->commandHandled(rURL.Complete) + || m_aAdditionalChartCommands.count(rURL.Path) > 0)) return cacheIt(m_xChartDispatcher); // #i12587# support for shapes in chart @@ -156,7 +158,7 @@ void CommandDispatchContainer::DisposeAndClear() DisposeHelper::DisposeAllElements( m_aToBeDisposedDispatches ); m_aToBeDisposedDispatches.clear(); m_xChartDispatcher.clear(); - m_aChartCommands.clear(); + m_aAdditionalChartCommands.clear(); m_pDrawCommandDispatch = nullptr; m_pShapeController = nullptr; } diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index 2c0dc35d4ad9..517fb3c6d4ad 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -881,6 +881,11 @@ bool ControllerCommandDispatch::commandAvailable(const OUString& rCommand) const return false; } +bool ControllerCommandDispatch::commandHandled(const OUString& rCommand) const +{ + return m_aCommandAvailability.contains(rCommand); +} + bool ControllerCommandDispatch::isShapeControllerCommandAvailable( const OUString& rCommand ) { ShapeController* pShapeController(nullptr); |