diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-19 20:11:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-20 17:58:43 +0200 |
commit | 476a652361de507303c7298a40cc96fa4bda22a3 (patch) | |
tree | 573ec85eeb6e2604c5cb2f078ea02f848686d443 /sfx2/source/dialog/backingcomp.cxx | |
parent | 254dfda42e2e7bd8be77ccdc702ed7b09a226e57 (diff) |
loplugin:referencecasting in sfx2
Change-Id: I97cd8821aa9a6f462f9b271940483738655ee9cf
Reviewed-on: https://gerrit.libreoffice.org/75979
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/dialog/backingcomp.cxx')
-rw-r--r-- | sfx2/source/dialog/backingcomp.cxx | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx index ee47f60dcb1b..ccb5f05962f1 100644 --- a/sfx2/source/dialog/backingcomp.cxx +++ b/sfx2/source/dialog/backingcomp.cxx @@ -577,14 +577,8 @@ void SAL_CALL BackingComp::dispose() // stop listening at the window if (m_xWindow.is()) { - css::uno::Reference< css::lang::XComponent > xBroadcaster(m_xWindow, css::uno::UNO_QUERY); - if (xBroadcaster.is()) - { - css::uno::Reference< css::lang::XEventListener > xEventThis(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY); - xBroadcaster->removeEventListener(xEventThis); - } - css::uno::Reference< css::awt::XKeyListener > xKeyThis(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY); - m_xWindow->removeKeyListener(xKeyThis); + m_xWindow->removeEventListener(this); + m_xWindow->removeKeyListener(this); m_xWindow.clear(); } @@ -678,9 +672,7 @@ void SAL_CALL BackingComp::initialize( /*IN*/ const css::uno::Sequence< css::uno // start listening for window disposing // It's set at our owner frame as component window later too. So it will may be disposed there ... - css::uno::Reference< css::lang::XComponent > xBroadcaster(m_xWindow, css::uno::UNO_QUERY); - if (xBroadcaster.is()) - xBroadcaster->addEventListener(static_cast< css::lang::XEventListener* >(this)); + m_xWindow->addEventListener(static_cast< css::lang::XEventListener* >(this)); m_xWindow->setVisible(true); |