include/sfx2/unoctitm.hxx | 2 ++ sfx2/source/control/unoctitm.cxx | 35 ++++++++++++++++++++--------------- 2 files changed, 22 insertions(+), 15 deletions(-)
New commits: commit f2a60c783a8099f07b05f25301833f405c161d59 Author: Caolán McNamara <caol...@redhat.com> Date: Thu Aug 11 14:47:56 2016 +0100 factor this status change code out no logic change intended Change-Id: I74e58f61fdb5d9684384dac5ba9803fc2d411ca7 diff --git a/include/sfx2/unoctitm.hxx b/include/sfx2/unoctitm.hxx index c2e060e..496c5cf 100644 --- a/include/sfx2/unoctitm.hxx +++ b/include/sfx2/unoctitm.hxx @@ -126,6 +126,8 @@ class SfxDispatchController_Impl : public SfxControllerItem css::uno::Sequence< css::beans::PropertyValue >& rArgs ); static SfxMapUnit GetCoreMetric( SfxItemPool& rPool, sal_uInt16 nSlot ); + void sendStatusChanged(const OUString& rURL, const css::frame::FeatureStateEvent& rEvent); + public: SfxDispatchController_Impl( SfxOfficeDispatch* pDisp, SfxBindings* pBind, diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index b799330..33e611e 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); } }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits