diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-08-11 14:47:56 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-08-11 15:38:55 +0100 |
commit | f2a60c783a8099f07b05f25301833f405c161d59 (patch) | |
tree | 7393fa4e38808d1d136981196268b4fee12eae07 /sfx2 | |
parent | 20469b56502687f85ce0fa9e5f7a50273daa3e91 (diff) |
factor this status change code out
no logic change intended
Change-Id: I74e58f61fdb5d9684384dac5ba9803fc2d411ca7
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/unoctitm.cxx | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index b7993300c8ca..33e611e4f181 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -835,6 +835,25 @@ void SAL_CALL SfxDispatchController_Impl::addStatusListener(const css::uno::Refe aListener->statusChanged( aEvent ); } +void SfxDispatchController_Impl::sendStatusChanged(const OUString& rURL, const css::frame::FeatureStateEvent& rEvent) +{ + ::cppu::OInterfaceContainerHelper* pContnr = pDispatch->GetListeners().getContainer(rURL); + if (!pContnr) + return; + ::cppu::OInterfaceIteratorHelper aIt(*pContnr); + while (aIt.hasMoreElements()) + { + try + { + static_cast<css::frame::XStatusListener*>(aIt.next())->statusChanged(rEvent); + } + catch (const css::uno::RuntimeException&) + { + aIt.remove(); + } + } +} + void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState, SfxSlotServer* pSlotServ ) { if ( !pDispatch ) @@ -912,21 +931,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt InterceptLOKStateChangeEvent(pDispatcher->GetFrame(), aEvent); } - ::cppu::OInterfaceContainerHelper* pContnr = pDispatch->GetListeners().getContainer ( aDispatchURL.Complete ); - if (pContnr) { - ::cppu::OInterfaceIteratorHelper aIt( *pContnr ); - while( aIt.hasMoreElements() ) - { - try - { - static_cast< css::frame::XStatusListener *>(aIt.next())->statusChanged( aEvent ); - } - catch (const css::uno::RuntimeException&) - { - aIt.remove(); - } - } - } + sendStatusChanged(aDispatchURL.Complete, aEvent); } } |