chart2/source/controller/inc/CommandDispatchContainer.hxx | 2 -- chart2/source/controller/main/CommandDispatchContainer.cxx | 11 ++++++----- 2 files changed, 6 insertions(+), 7 deletions(-)
New commits: commit adff28271ba55a94337c00a4d338ac18e6f69a43 Author: Noel Grandin <[email protected]> Date: Mon Apr 25 09:21:44 2016 +0200 the container document commands std::set can be static Change-Id: I00558dad4b8206e5e2a7bf004e32196a15dba3cd diff --git a/chart2/source/controller/inc/CommandDispatchContainer.hxx b/chart2/source/controller/inc/CommandDispatchContainer.hxx index 08e3c55..41adb4f 100644 --- a/chart2/source/controller/inc/CommandDispatchContainer.hxx +++ b/chart2/source/controller/inc/CommandDispatchContainer.hxx @@ -126,8 +126,6 @@ private: css::uno::Reference< css::frame::XDispatch > m_xChartDispatcher; ::std::set< OUString > m_aChartCommands; - ::std::set< OUString > m_aContainerDocumentCommands; - ChartController* m_pChartController; DrawCommandDispatch* m_pDrawCommandDispatch; ShapeController* m_pShapeController; diff --git a/chart2/source/controller/main/CommandDispatchContainer.cxx b/chart2/source/controller/main/CommandDispatchContainer.cxx index 1e9c848..e8b6598 100644 --- a/chart2/source/controller/main/CommandDispatchContainer.cxx +++ b/chart2/source/controller/main/CommandDispatchContainer.cxx @@ -43,10 +43,6 @@ CommandDispatchContainer::CommandDispatchContainer( ,m_pDrawCommandDispatch( nullptr ) ,m_pShapeController( nullptr ) { - m_aContainerDocumentCommands.insert({ - "AddDirect", "NewDoc", "Open", - "Save", "SaveAs", "SendMail", - "EditDoc", "ExportDirectToPDF", "PrintDefault"}); } void CommandDispatchContainer::setModel( @@ -72,6 +68,11 @@ void CommandDispatchContainer::setChartDispatch( Reference< frame::XDispatch > CommandDispatchContainer::getDispatchForURL( const util::URL & rURL ) { + static const std::set< OUString > s_aContainerDocumentCommands { + "AddDirect", "NewDoc", "Open", + "Save", "SaveAs", "SendMail", + "EditDoc", "ExportDirectToPDF", "PrintDefault"}; + Reference< frame::XDispatch > xResult; tDispatchMap::const_iterator aIt( m_aCachedDispatches.find( rURL.Complete )); if( aIt != m_aCachedDispatches.end()) @@ -102,7 +103,7 @@ Reference< frame::XDispatch > CommandDispatchContainer::getDispatchForURL( m_aToBeDisposedDispatches.push_back( xResult ); } else if( xModel.is() && - (m_aContainerDocumentCommands.find( rURL.Path ) != m_aContainerDocumentCommands.end()) ) + (s_aContainerDocumentCommands.find( rURL.Path ) != s_aContainerDocumentCommands.end()) ) { xResult.set( getContainerDispatchForURL( xModel->getCurrentController(), rURL )); // ToDo: can those dispatches be cached? _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
