Result of css::ui::ContextChangeEventMultiplexer::get cannot be null

Change-Id: I00fba6c2a79404c824feaa5bb302d37c4158f9a3
This commit is contained in:
Stephan Bergmann
2016-12-20 11:44:27 +01:00
parent 2017526bcc
commit 1b616752ea
4 changed files with 11 additions and 15 deletions

View File

@@ -299,7 +299,7 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
= ContextChangeEventMultiplexer::get(
::comphelper::getProcessComponentContext());
if(xFrame.is() && xMultiplexer.is())
if(xFrame.is())
{
xMultiplexer->addContextChangeEventListener(
pNotebookBar->getContextChangeEventListener(),
@@ -326,7 +326,7 @@ void SfxNotebookBar::RemoveListeners(SystemWindow* pSysWindow)
= ContextChangeEventMultiplexer::get(
::comphelper::getProcessComponentContext());
if (pSysWindow->GetNotebookBar() && xMultiplexer.is())
if (pSysWindow->GetNotebookBar())
{
xMultiplexer->removeAllContextChangeEventListeners(
pSysWindow->GetNotebookBar()->getContextChangeEventListener());

View File

@@ -164,10 +164,9 @@ void SidebarController::registerSidebarForFrame(SidebarController* pController,
css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer (
css::ui::ContextChangeEventMultiplexer::get(
::comphelper::getProcessComponentContext()));
if (xMultiplexer.is())
xMultiplexer->addContextChangeEventListener(
static_cast<css::ui::XContextChangeEventListener*>(pController),
xController);
xMultiplexer->addContextChangeEventListener(
static_cast<css::ui::XContextChangeEventListener*>(pController),
xController);
}
void SidebarController::unregisterSidebarForFrame(SidebarController* pController, const css::uno::Reference<css::frame::XController>& xController)
@@ -176,10 +175,9 @@ void SidebarController::unregisterSidebarForFrame(SidebarController* pController
css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer (
css::ui::ContextChangeEventMultiplexer::get(
::comphelper::getProcessComponentContext()));
if (xMultiplexer.is())
xMultiplexer->removeContextChangeEventListener(
static_cast<css::ui::XContextChangeEventListener*>(pController),
xController);
xMultiplexer->removeContextChangeEventListener(
static_cast<css::ui::XContextChangeEventListener*>(pController),
xController);
}
void SidebarController::disposeDecks()

View File

@@ -65,8 +65,7 @@ SidebarPanelBase::SidebarPanelBase (
css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer (
css::ui::ContextChangeEventMultiplexer::get(
::comphelper::getProcessComponentContext()));
if (xMultiplexer.is())
xMultiplexer->addContextChangeEventListener(this, mxFrame->getController());
xMultiplexer->addContextChangeEventListener(this, mxFrame->getController());
}
if (mpControl != nullptr)
{
@@ -89,8 +88,7 @@ void SAL_CALL SidebarPanelBase::disposing()
css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer (
css::ui::ContextChangeEventMultiplexer::get(
::comphelper::getProcessComponentContext()));
if (xMultiplexer.is())
xMultiplexer->removeAllContextChangeEventListeners(this);
xMultiplexer->removeAllContextChangeEventListeners(this);
mxFrame = nullptr;
}
}

View File

@@ -113,7 +113,7 @@ void ParaLRSpacingControl::StateChanged(sal_uInt16 nSID, SfxItemState eState,
m_xMultiplexer = css::ui::ContextChangeEventMultiplexer::get(
::comphelper::getProcessComponentContext());
if(m_xFrame.is() && m_xMultiplexer.is())
if(m_xFrame.is())
m_xMultiplexer->addContextChangeEventListener(this, m_xFrame->getController());
}