Kaydet (Commit) f2a60c78 authored tarafından Caolán McNamara's avatar Caolán McNamara

factor this status change code out

no logic change intended

Change-Id: I74e58f61fdb5d9684384dac5ba9803fc2d411ca7
üst 20469b56
...@@ -126,6 +126,8 @@ class SfxDispatchController_Impl : public SfxControllerItem ...@@ -126,6 +126,8 @@ class SfxDispatchController_Impl : public SfxControllerItem
css::uno::Sequence< css::beans::PropertyValue >& rArgs ); css::uno::Sequence< css::beans::PropertyValue >& rArgs );
static SfxMapUnit GetCoreMetric( SfxItemPool& rPool, sal_uInt16 nSlot ); static SfxMapUnit GetCoreMetric( SfxItemPool& rPool, sal_uInt16 nSlot );
void sendStatusChanged(const OUString& rURL, const css::frame::FeatureStateEvent& rEvent);
public: public:
SfxDispatchController_Impl( SfxOfficeDispatch* pDisp, SfxDispatchController_Impl( SfxOfficeDispatch* pDisp,
SfxBindings* pBind, SfxBindings* pBind,
......
...@@ -835,6 +835,25 @@ void SAL_CALL SfxDispatchController_Impl::addStatusListener(const css::uno::Refe ...@@ -835,6 +835,25 @@ void SAL_CALL SfxDispatchController_Impl::addStatusListener(const css::uno::Refe
aListener->statusChanged( aEvent ); 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 ) void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState, SfxSlotServer* pSlotServ )
{ {
if ( !pDispatch ) if ( !pDispatch )
...@@ -912,21 +931,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt ...@@ -912,21 +931,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt
InterceptLOKStateChangeEvent(pDispatcher->GetFrame(), aEvent); InterceptLOKStateChangeEvent(pDispatcher->GetFrame(), aEvent);
} }
::cppu::OInterfaceContainerHelper* pContnr = pDispatch->GetListeners().getContainer ( aDispatchURL.Complete ); sendStatusChanged(aDispatchURL.Complete, aEvent);
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();
}
}
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment