summaryrefslogtreecommitdiff
path: root/sfx2/source/notebookbar/SfxNotebookBar.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/notebookbar/SfxNotebookBar.cxx')
-rw-r--r--sfx2/source/notebookbar/SfxNotebookBar.cxx15
1 files changed, 3 insertions, 12 deletions
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index 538886f202a1..a2d7f1f39b17 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -400,15 +400,7 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
if(pView)
{
- Reference<XContextChangeEventMultiplexer> xMultiplexer
- = ContextChangeEventMultiplexer::get( xContext );
-
- if(xFrame.is())
- {
- xMultiplexer->addContextChangeEventListener(
- pNotebookBar->getContextChangeEventListener(),
- xFrame->getController());
- }
+ pNotebookBar->ControlListenerForCurrentController(true);
}
}
@@ -430,10 +422,9 @@ void SfxNotebookBar::RemoveListeners(SystemWindow const * pSysWindow)
= ContextChangeEventMultiplexer::get(
::comphelper::getProcessComponentContext());
- if (pSysWindow->GetNotebookBar())
+ if (auto pNotebookBar = pSysWindow->GetNotebookBar())
{
- xMultiplexer->removeAllContextChangeEventListeners(
- pSysWindow->GetNotebookBar()->getContextChangeEventListener());
+ pNotebookBar->StopListeningAllControllers();
}
}