Kaydet (Commit) adff2827 authored tarafından Noel Grandin's avatar Noel Grandin

the container document commands std::set can be static

Change-Id: I00558dad4b8206e5e2a7bf004e32196a15dba3cd
üst b2e24007
......@@ -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;
......
......@@ -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?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment