[Libreoffice-commits] core.git: sfx2/source svx/source
Stephan Bergmann
sbergman at redhat.com
Tue Dec 20 10:45:17 UTC 2016
sfx2/source/notebookbar/SfxNotebookBar.cxx | 4 ++--
sfx2/source/sidebar/SidebarController.cxx | 14 ++++++--------
sfx2/source/sidebar/SidebarPanelBase.cxx | 6 ++----
svx/source/sidebar/paragraph/ParaSpacingControl.cxx | 2 +-
4 files changed, 11 insertions(+), 15 deletions(-)
New commits:
commit 1b616752eaa389ebefd7caef437368052aecbfa5
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Dec 20 11:44:27 2016 +0100
Result of css::ui::ContextChangeEventMultiplexer::get cannot be null
Change-Id: I00fba6c2a79404c824feaa5bb302d37c4158f9a3
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index c3821b6..c34b666 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -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());
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 2b4a668..eb5cad7 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -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()
diff --git a/sfx2/source/sidebar/SidebarPanelBase.cxx b/sfx2/source/sidebar/SidebarPanelBase.cxx
index ff77084..0e90e95 100644
--- a/sfx2/source/sidebar/SidebarPanelBase.cxx
+++ b/sfx2/source/sidebar/SidebarPanelBase.cxx
@@ -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;
}
}
diff --git a/svx/source/sidebar/paragraph/ParaSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaSpacingControl.cxx
index e4dc5d0..6fde988 100644
--- a/svx/source/sidebar/paragraph/ParaSpacingControl.cxx
+++ b/svx/source/sidebar/paragraph/ParaSpacingControl.cxx
@@ -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());
}
More information about the Libreoffice-commits
mailing list