summaryrefslogtreecommitdiff
path: root/chart2/source/controller/main/CommandDispatchContainer.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-25 09:21:44 +0200
committerNoel Grandin <noel@peralex.com>2016-04-25 09:21:44 +0200
commitadff28271ba55a94337c00a4d338ac18e6f69a43 (patch)
treef7a5c50da15f5dcf3d23bce9047c54ad172aa851 /chart2/source/controller/main/CommandDispatchContainer.cxx
parentb2e2400736cbc5fc7e21edbe968f888566de9237 (diff)
the container document commands std::set can be static
Change-Id: I00558dad4b8206e5e2a7bf004e32196a15dba3cd
Diffstat (limited to 'chart2/source/controller/main/CommandDispatchContainer.cxx')
-rw-r--r--chart2/source/controller/main/CommandDispatchContainer.cxx11
1 files changed, 6 insertions, 5 deletions
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?