namespace svxform
{ using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::uno::Sequence; using ::com::sun::star::frame::XDispatchProviderInterception; using ::com::sun::star::frame::XDispatchProviderInterceptor; using ::com::sun::star::lang::XComponent; using ::com::sun::star::util::URL; using ::com::sun::star::frame::XDispatch; using ::com::sun::star::frame::DispatchDescriptor; using ::com::sun::star::frame::XDispatchProvider; using ::com::sun::star::lang::EventObject;
::osl::MutexGuard aGuard( *m_pMutex );
osl_atomic_increment(&m_refCount); if (_rxToIntercept.is())
{
_rxToIntercept->registerDispatchProviderInterceptor(static_cast<XDispatchProviderInterceptor*>(this)); // this should make us the top-level dispatch-provider for the component, via a call to our // setDispatchProvider we should have got a fallback for requests we (i.e. our master) cannot fulfill
Reference< XComponent> xInterceptedComponent(_rxToIntercept, UNO_QUERY); if (xInterceptedComponent.is())
{
xInterceptedComponent->addEventListener(this);
m_bListening = true;
}
}
osl_atomic_decrement(&m_refCount);
}
DispatchInterceptionMultiplexer::~DispatchInterceptionMultiplexer()
{ if (!rBHelper.bDisposed)
dispose();
// deregister ourself from the interception component
Reference< XDispatchProviderInterception > xIntercepted(m_xIntercepted.get(), UNO_QUERY); if (xIntercepted.is())
xIntercepted->releaseDispatchProviderInterceptor(static_cast<XDispatchProviderInterceptor*>(this));
// m_xIntercepted.clear(); // Don't reset m_xIntercepted: It may be needed by our owner to check for which object we were // responsible. As we hold the object with a weak reference only, this should be no problem. // 88936 - 23.07.2001 - frank.schoenheit@sun.com
m_pMaster = nullptr;
m_pMutex = &m_aFallback;
m_bListening = false;
}
void DispatchInterceptionMultiplexer::disposing()
{ // remove ourself as event listener from the interception component if (m_bListening)
{
Reference< XComponent> xInterceptedComponent(m_xIntercepted.get(), UNO_QUERY); if (xInterceptedComponent.is())
xInterceptedComponent->removeEventListener(static_cast<XEventListener*>(this));
// detach from the interception component
ImplDetach();
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.