diff options
author | Noel Grandin <noel@peralex.com> | 2016-04-25 09:21:44 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-04-25 09:21:44 +0200 |
commit | adff28271ba55a94337c00a4d338ac18e6f69a43 (patch) | |
tree | f7a5c50da15f5dcf3d23bce9047c54ad172aa851 /chart2 | |
parent | b2e2400736cbc5fc7e21edbe968f888566de9237 (diff) |
the container document commands std::set can be static
Change-Id: I00558dad4b8206e5e2a7bf004e32196a15dba3cd
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/inc/CommandDispatchContainer.hxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/main/CommandDispatchContainer.cxx | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/chart2/source/controller/inc/CommandDispatchContainer.hxx b/chart2/source/controller/inc/CommandDispatchContainer.hxx index 08e3c55f6f4d..41adb4f19c7c 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 1e9c84860b9c..e8b659895623 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? |